Request for clarification regarding the identification of delayed+duplicated AppendEntries replies

31 views
Skip to first unread message

Johann Borck

unread,
Sep 6, 2016, 8:05:24 PM9/6/16
to raft-dev

Hey!

I'm wondering how Raft ensures that replies to AppendEntries requests refer to a specific log index, since the reply doesn't specifically include the index.
Consider a scenario, where an AppendEntry reply is both duplicated and delayed long enough so that the leader has moved on to the next index.

Term 0:
F2
[0,_] <-1- L[0,_]   -1->  F1 [0,_]  L sends AE 1 to both followers
..            L[0,1,_]<-1-   F1 [0,_]  F1 and F2 ack 1, ack from F2 is delayed
..       <-2- L[0,1,_] -2->  F1 [0,_]  L considers 1 committed, sends next entry 2
..                                     F1 is cut off and AE 2 to F1 & F2 is lost  
F2
[0,_] -1-> L[0,1,_]                 F2s ack for AE 1 arrives late
         
-1-> L[0,1,_]                 A duplicate of F2s ack for AE 1 arrives
              L
[0,1,2]                 L increases matchIndex for F2
                                       
and hence considers index 2 committed (??)
                                       L dies
Term 1:
                                       F1s connection
is reestablished after a
                                       timeout
and F1 sends a vote-request
                                       F2 votes
for F1, F1 becomes leader
                                       F2
& F2 agree on a different entry at index 2
                                       
in the new term                                      


Is this scenario possible? I realize  that it's a bit of a stretch, but if I understand correctly, at the last step before L dies, increasing the matchIndex for F2 and applying it to the state machine leads to an inconsistent state. I'm probably missing something here, but my intuition is that even if Raft does handle this situation, including an index in the AppendEntries reply would make detecting duplicates a more trivial matter. 

Thanks for consideration,
Johann


Oren Eini (Ayende Rahien)

unread,
Sep 7, 2016, 1:30:54 AM9/7/16
to raft...@googlegroups.com
You either use sync RPC (such as REST), in which case you know what the reply is for, or your reply message contain the info to know what you are replying for.

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.

Johann Borck

unread,
Sep 7, 2016, 7:08:01 AM9/7/16
to raft-dev


On Wednesday, September 7, 2016 at 7:30:54 AM UTC+2, Ayende Rahien wrote:
You either use sync RPC (such as REST), in which case you know what the reply is for, or your reply message contain the info to know what you are replying for.

Thank you!
Reply all
Reply to author
Forward
0 new messages