Selaa lähdekoodia

Merge pull request #1805 from xiang90/fix_raft_b

raft: fix start term
Xiang Li 11 vuotta sitten
vanhempi
commit
fe0bc4ff36
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      raft/raft.go

+ 1 - 1
raft/raft.go

@@ -163,7 +163,7 @@ func newRaft(id uint64, peers []uint64, election, heartbeat int, storage Storage
 	if !isHardStateEqual(hs, emptyState) {
 		r.loadState(hs)
 	}
-	r.becomeFollower(0, None)
+	r.becomeFollower(r.Term, None)
 	return r
 }