Skip to content

Commit

Permalink
Raft Paper section 5.4.2: "[A leader] never commits log entries from …
Browse files Browse the repository at this point in the history
…previous terms...".
  • Loading branch information
lemmy committed Oct 19, 2023
1 parent bcb0613 commit 7593bea
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions tla/MCccfraft.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ PROPERTIES
PermittedLogChangesProp
StateTransitionsProp
PendingBecomesFollowerProp
NeverCommitEntryPrevTermsProp

INVARIANTS
LogInv
Expand Down
1 change: 1 addition & 0 deletions tla/MCccfraftWithReconfig.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ PROPERTIES
PermittedLogChangesProp
StateTransitionsProp
PendingBecomesFollowerProp
NeverCommitEntryPrevTermsProp

INVARIANTS
LogInv
Expand Down
1 change: 1 addition & 0 deletions tla/SIMccfraft.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ PROPERTIES
PermittedLogChangesProp
StateTransitionsProp
PendingBecomesFollowerProp
NeverCommitEntryPrevTermsProp

INVARIANTS
LogInv
Expand Down
7 changes: 7 additions & 0 deletions tla/ccfraft.tla
Original file line number Diff line number Diff line change
Expand Up @@ -1364,6 +1364,13 @@ PendingBecomesFollowerProp ==
s \in GetServerSet(s)' =>
state[s]' = Follower]_vars

\* Raft Paper section 5.4.2: "[A leader] never commits log entries from previous terms...".
NeverCommitEntryPrevTermsProp ==
[][\A i \in { s \in Servers : state[s] = Leader }:
\* If the commitIndex of a leader changes, the log entry's term that the new commitIndex
\* points to equals the leader's term.
commitIndex'[i] > commitIndex[i] => log[i][commitIndex'[i]].term = currentTerm'[i] ]_vars

LogMatchingProp ==
\A i, j \in Servers : []<>(log[i] = log[j])

Expand Down

0 comments on commit 7593bea

Please sign in to comment.