diff --git a/append_entries.go b/append_entries.go index 2629bdc..2ef04be 100644 --- a/append_entries.go +++ b/append_entries.go @@ -4,8 +4,8 @@ import ( "io" "io/ioutil" + "github.com/chrislusf/raft/protobuf" "github.com/golang/protobuf/proto" - "github.com/robin1900/raft/protobuf" ) // The request sent to a server to append entries to the log. diff --git a/go.mod b/go.mod index 6383094..000bf7c 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/robin1900/raft +module github.com/chrislusf/raft go 1.14 diff --git a/grpc_transporter.go b/grpc_transporter.go index 8d572a3..7500d4d 100644 --- a/grpc_transporter.go +++ b/grpc_transporter.go @@ -3,7 +3,7 @@ package raft import ( context2 "context" "fmt" - "github.com/robin1900/raft/protobuf" + "github.com/chrislusf/raft/protobuf" "google.golang.org/grpc" "google.golang.org/grpc/keepalive" "sync" diff --git a/log.go b/log.go index f914438..ac81877 100644 --- a/log.go +++ b/log.go @@ -8,7 +8,7 @@ import ( "os" "sync" - "github.com/robin1900/raft/protobuf" + "github.com/chrislusf/raft/protobuf" ) //------------------------------------------------------------------------------ diff --git a/log_entry.go b/log_entry.go index a9b4559..690a27d 100644 --- a/log_entry.go +++ b/log_entry.go @@ -6,8 +6,8 @@ import ( "fmt" "io" + "github.com/chrislusf/raft/protobuf" "github.com/golang/protobuf/proto" - "github.com/robin1900/raft/protobuf" ) // A log entry stores a single item in the log. diff --git a/protobuf/seaweed_raft.proto b/protobuf/seaweed_raft.proto index a93bc96..3abd55e 100644 --- a/protobuf/seaweed_raft.proto +++ b/protobuf/seaweed_raft.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package protobuf; -option go_package = "github.com/robin1900/raft/protobuf"; +option go_package = "github.com/chrislusf/raft/protobuf"; message LogEntry { uint64 Index = 1; diff --git a/request_vote.go b/request_vote.go index c7ec068..a3cdb75 100644 --- a/request_vote.go +++ b/request_vote.go @@ -4,8 +4,8 @@ import ( "io" "io/ioutil" + "github.com/chrislusf/raft/protobuf" "github.com/golang/protobuf/proto" - "github.com/robin1900/raft/protobuf" ) // The request sent to a server to vote for a candidate to become a leader. diff --git a/server.go b/server.go index 7fa8533..08b4786 100644 --- a/server.go +++ b/server.go @@ -988,12 +988,7 @@ func (s *server) processAppendEntriesRequest(req *AppendEntriesRequest) (*Append // discover new leader when candidate // save leader name when follower - prevLeader := s.leader s.leader = req.LeaderName - if prevLeader != s.leader { - s.DispatchEvent(newEvent(LeaderChangeEventType, s.leader, prevLeader)) - } - } else { // Update term and leader. s.updateCurrentTerm(req.Term, req.LeaderName) diff --git a/snapshot.go b/snapshot.go index 92a0e95..85d24d7 100644 --- a/snapshot.go +++ b/snapshot.go @@ -3,12 +3,13 @@ package raft import ( "encoding/json" "fmt" - "github.com/golang/protobuf/proto" - "github.com/robin1900/raft/protobuf" "hash/crc32" "io" "io/ioutil" "os" + + "github.com/chrislusf/raft/protobuf" + "github.com/golang/protobuf/proto" ) // Snapshot represents an in-memory representation of the current state of the system.