Question about network partition in Raft

651 views
Skip to first unread message

bo yang

unread,
Feb 22, 2017, 9:07:00 AM2/22/17
to raft-dev
Assume the network is divided into two parts. The first has two nodes with term 2, and the second has three nodes with term 1. So the second has the majority and will commit log entries. When the network recovered,  the leader in the first part with higher term will be the leader for the whole cluster, and it will overwrite the committed entry in the second part. The Leader Completeness no longer last. Is this correct?

susanggg...@gmail.com

unread,
Feb 22, 2017, 11:21:15 AM2/22/17
to raft-dev
No. There is no "leader in the first part". There can only be one leader. There is a candidate with term 2 sending out RequestVote RPC's, which the majority nodes will reject because the candidate’s log is *not* at least as up-to-date as receiver’s log. The heartbeat from *the leader* at term 1 will then convert this candidate to a follower.

Susan

Jordan Halterman

unread,
Feb 22, 2017, 6:27:09 PM2/22/17
to raft...@googlegroups.com
Actually, once the partition is healed and the leader hears about a higher term it will step down, but another election will simply elect one of the three nodes on the majority side of the partition. The leader shouldn't simply ignore a higher term.

However, in most implementations these days, a pre-vote protocol is used. That would ensure that the nodes on the smaller side of the partition never even transition to candidate and increment the term since they can't win an election, and the leader would never hear of a higher term and have to step down.

--
You received this message because you are subscribed to the Google Groups "raft-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to raft-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

bo yang

unread,
Feb 22, 2017, 7:41:02 PM2/22/17
to raft-dev
Thanks Jordan. Very clear.
To unsubscribe from this group and stop receiving emails from it, send an email to raft-dev+u...@googlegroups.com.

bo yang

unread,
Feb 22, 2017, 7:41:23 PM2/22/17
to raft-dev
Thanks Susan. But I think Jordan has a deeper understanding.

在 2017年2月23日星期四 UTC+8上午12:21:15,susanggg...@gmail.com写道:

Arthur Wang

unread,
Aug 13, 2017, 4:37:25 AM8/13/17
to raft-dev


When the network recovered,  the leader in the first part with higher term  --> How could the leader in  part one got a higher term when the network partition healed ? After the election completed in part-two , the newly  elected leader will must have a term number bigger or equal than 2 , since before the election happened  the term is already one. You may mean the log index in the first part is greater than the log index in the second part,  which may happen during a time the first part committed more logs than the second part.  Is that what you mean ?

And if so , I don't think part one can still commit logs since its node number  is 2 now, which doesn't satisfy a majority requirement.

Kijana Woodard

unread,
Aug 13, 2017, 11:57:46 AM8/13/17
to raft...@googlegroups.com
If you have pre-vote in place, the scenario posited by the OP won't ever exist.

--
You received this message because you are subscribed to the Google Groups "raft-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to raft-dev+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages