Skip to content

Commit

Permalink
nextIndex unchanged on AE ACK
Browse files Browse the repository at this point in the history
  • Loading branch information
heidihoward committed Jan 8, 2024
1 parent ed9e178 commit effaa85
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions tests/raft_scenarios/replicate_deprecated
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dispatch_all
state_all
replicate,1,helloworld
emit_signature,1
emit_signature,1
periodic_all,10
dispatch_all
periodic_all,1
Expand Down
2 changes: 1 addition & 1 deletion tla/consensus/ccfraft.tla
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ HandleAppendEntriesResponse(i, j, m) ==
/\ m.success \* successful
\* max(...) because why would we ever want to go backwards on a success response?!
/\ matchIndex' = [matchIndex EXCEPT ![i][j] = max(@, m.lastLogIndex)]
/\ nextIndex' = [nextIndex EXCEPT ![i][j] = max(@, m.lastLogIndex + 1)]
/\ UNCHANGED nextIndex
\/ /\ \lnot m.success \* not successful
/\ LET tm == FindHighestPossibleMatch(log[i], m.lastLogIndex, m.term)
IN nextIndex' = [nextIndex EXCEPT ![i][j] = max(min(tm, nextIndex[i][j]-1), matchIndex[i][j]) + 1 ]
Expand Down

0 comments on commit effaa85

Please sign in to comment.