update raft version

fix #4460
This commit is contained in:
chrislu 2023-05-09 22:54:23 -07:00
parent 25b237b83c
commit d999f1f0e2
2 changed files with 3 additions and 5 deletions

2
go.mod
View File

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

View File

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