Просмотр исходного кода

raft: use becomeFollower in cadidate state

Xiang Li 11 лет назад
Родитель
Сommit
ab79550693
1 измененных файлов с 1 добавлено и 1 удалено
  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.sendAppend()
 			case len(sm.votes) - gr:
-				sm.state = stateFollower
+				sm.becomeFollower(sm.term, none)
 			}
 		}
 	case stateFollower: