Prevote with different prevote sets

32 views
Skip to first unread message

Chuyen Luong

unread,
Aug 29, 2017, 12:18:58 AM8/29/17
to raft-dev
Dear all,
I have a scenario with different prevote sets as follows:
Given a configuration file with 2 seeds including S1, S2.

Step1: Turn on S1, S2, NS1 (non-seed 1). Then, cluster will include a leader (S1) and two followers(S2, NS1).
Step2: Turn off leader S1, then S2 sends prevote to NS1 and NS1 sends prevote to S2. Next, NS1 will become candidate and then become leader by got vote from S2.
Step3. Turn off leader NS1 and turn on S1. After that S2 sends prevote to NS1 and S1 send prevote to S2.

In this scenario, No one becomes candidate to become leader because the different prevote sets.

Should we have any condition before establishing a stable cluster?

Many thanks,
Chuyen Luong

Oren Eini (Ayende Rahien)

unread,
Aug 29, 2017, 3:45:28 AM8/29/17
to raft...@googlegroups.com
The moment that you added a node to the cluster, the seed / not seed distinction goes away.

The key aspect of pre voting is that it _is_ okay to vote for multiple people. That means that both S2 and S1 will become candidate.


Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


--
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.

Chuyen Luong

unread,
Aug 29, 2017, 5:30:07 AM8/29/17
to raft-dev
Thank you for your help.

I don't think S1 and S2 will becomes Candidate.
In my scenario:
 - S2 has prevote set {S2, NS1}. S2 send prevote to NS1. But NS1 is died at that time. Therefore, S2 has 1 vote which is equal to a half of the prevote size. As a result, S2 continues with Follower state.
 - S1 has prevote set {S1, S2}. S1 send prevote to S2. But S1 has just added. Because S1 has term 0 which is less than term of S2, S2 does not vote to S1. Therefore, S1 continues with Follower state.

Chuyen Luong
To unsubscribe from this group and stop receiving emails from it, send an email to raft-dev+u...@googlegroups.com.

Oren Eini (Ayende Rahien)

unread,
Aug 29, 2017, 6:12:33 AM8/29/17
to raft...@googlegroups.com
Then S2 tries again, and get the vote of S1
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