Browse Source

etcdserver: consistent naming in raftReadyHandler

fanmin shi 9 years ago
parent
commit
2a1bae0c2a
2 changed files with 3 additions and 3 deletions
  1. 1 1
      etcdserver/raft.go
  2. 2 2
      etcdserver/server.go

+ 1 - 1
etcdserver/raft.go

@@ -162,7 +162,7 @@ func (r *raftNode) start(rh *raftReadyHandler) {
 
 					atomic.StoreUint64(&r.lead, rd.SoftState.Lead)
 					islead = rd.RaftState == raft.StateLeader
-					rh.leadershipUpdate()
+					rh.updateLeadership()
 				}
 
 				if len(rd.ReadStates) != 0 {

+ 2 - 2
etcdserver/server.go

@@ -598,7 +598,7 @@ type etcdProgress struct {
 // and helps decouple state machine logic from Raft algorithms.
 // TODO: add a state machine interface to apply the commit entries and do snapshot/recover
 type raftReadyHandler struct {
-	leadershipUpdate     func()
+	updateLeadership     func()
 	updateCommittedIndex func(uint64)
 }
 
@@ -624,7 +624,7 @@ func (s *EtcdServer) run() {
 		return
 	}
 	rh := &raftReadyHandler{
-		leadershipUpdate: func() {
+		updateLeadership: func() {
 			if !s.isLeader() {
 				if s.lessor != nil {
 					s.lessor.Demote()