How can this situation occur in the log?

39 views
Skip to first unread message

sriram srinivasan

unread,
Feb 3, 2015, 1:47:03 AM2/3/15
to raft...@googlegroups.com

I was looking at question #2 in the quizzes posted by Prof. Ousterhout. 


Can someone help me see what sequence of events can possibly lead to server #2 having the log as shown: 1;1;1;3? 

- Clearly, it was the elected as the leader for term 3, since it is the only one with a #3 entry.
- Prior to that, all it had was 1;1;1, and this was enough to win the election.  How? If index 3 has a majority for term 2, one of them would have been the leader, and there is no way they'd endorse server 2. 

Is this a wrong example? 

Thank you much.

--sriram.

Kijana Woodard

unread,
Feb 3, 2015, 11:09:25 AM2/3/15
to sriram srinivasan, raft...@googlegroups.com
Here's my thought.

From top to bottom, let's apply the labels (a) - (e).

(a) could have been elected to tern 2 and quickly gotten four entries, but was never able to replicate them before being partitioned or crashing.
(b) gets elected to term 3, but never replicates.
(c), (d), and (e) still only have their term 1 entries.
(a) comes back on line and wins the election for term 4 and manages to replicate term 2 entries up to the point shown in the question. (b) is partitioned or 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+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

sriram srinivasan

unread,
Feb 4, 2015, 7:07:12 AM2/4/15
to raft...@googlegroups.com, fatty.d...@gmail.com
Thanks for your response.

The problem is with (b) (or server 2, as I call it below).  I don't see how it could have gotten elected. 

Server 2 was clearly leader #1 (since it has the longest series of 1's).  

Then server 1 (say, or server 5) become leader #2. Now entry #3 and entry #4 are on a majority of  servers. 

Server 2 now attempts to be the candidate for term #3, but there is no way it'll get a majority of servers to vote for it because there are others that have a more recent term in their logs (#2).  Which means it should never get to term #3.

I'm unable to come up with a single counter example (including in the next question). 

.

sriram srinivasan

unread,
Feb 4, 2015, 10:56:29 AM2/4/15
to raft...@googlegroups.com, fatty.d...@gmail.com
Ah, I get it now.  Thanks, Kijana. You are right.
Reply all
Reply to author
Forward
0 new messages