Browse Source

raft: use becomeFollower in cadidate state

Xiang Li 11 years ago
parent
commit
ab79550693
1 changed files with 1 additions and 1 deletions
  1. 1 1
      raft/raft.go

+ 1 - 1
raft/raft.go

@@ -305,7 +305,7 @@ func (sm *stateMachine) Step(m Message) {
 				sm.lead = sm.addr
 				sm.lead = sm.addr
 				sm.sendAppend()
 				sm.sendAppend()
 			case len(sm.votes) - gr:
 			case len(sm.votes) - gr:
-				sm.state = stateFollower
+				sm.becomeFollower(sm.term, none)
 			}
 			}
 		}
 		}
 	case stateFollower:
 	case stateFollower: