Browse Source

update raft version

fix #4460
pull/4470/head
chrislu 2 years ago
parent
commit
d999f1f0e2
  1. 2
      go.mod
  2. 6
      weed/server/raft_server.go

2
go.mod

@ -84,7 +84,7 @@ require (
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/seaweedfs/goexif v1.0.3
github.com/seaweedfs/raft v1.1.2
github.com/seaweedfs/raft v1.1.3
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/spf13/afero v1.9.3 // indirect
github.com/spf13/cast v1.5.0 // indirect

6
weed/server/raft_server.go

@ -3,7 +3,6 @@ package weed_server
import (
"encoding/json"
transport "github.com/Jille/raft-grpc-transport"
"github.com/seaweedfs/raft/protobuf"
"io"
"math/rand"
"os"
@ -34,8 +33,6 @@ type RaftServerOption struct {
}
type RaftServer struct {
protobuf.UnimplementedRaftServer
raftGrpcServer *raft.GrpcServer
peers map[string]pb.ServerAddress // initial peers to join with
raftServer raft.Server
RaftHashicorp *hashicorpRaft.Raft
@ -43,6 +40,7 @@ type RaftServer struct {
dataDir string
serverAddr pb.ServerAddress
topo *topology.Topology
*raft.GrpcServer
}
type StateMachine struct {
@ -164,7 +162,7 @@ func NewRaftServer(option *RaftServerOption) (*RaftServer, error) {
}
}
s.raftGrpcServer = raft.NewGrpcServer(s.raftServer)
s.GrpcServer = raft.NewGrpcServer(s.raftServer)
glog.V(0).Infof("current cluster leader: %v", s.raftServer.Leader())

Loading…
Cancel
Save