From d999f1f0e2a13deeb8d221009ac352d86095480d Mon Sep 17 00:00:00 2001 From: chrislu Date: Tue, 9 May 2023 22:54:23 -0700 Subject: [PATCH] update raft version fix #4460 --- go.mod | 2 +- weed/server/raft_server.go | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 39d8aea6e..252f208b3 100644 --- a/go.mod +++ b/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 diff --git a/weed/server/raft_server.go b/weed/server/raft_server.go index 16736eb5b..d718ecac7 100644 --- a/weed/server/raft_server.go +++ b/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())