diff --git a/tla/consensus/MCccfraft.cfg b/tla/consensus/MCccfraft.cfg index 61acf564d01f..1aecc3249a90 100644 --- a/tla/consensus/MCccfraft.cfg +++ b/tla/consensus/MCccfraft.cfg @@ -78,6 +78,7 @@ INVARIANTS MatchIndexLowerBoundNextIndexInv CommitCommittableIndices CommittableIndicesAreKnownSignaturesInv + \* DebugAllReconfigurationsReachableInv \* DebugInvLeaderCannotStepDown \* DebugInvAnyCommitted \* DebugInvAllCommitted diff --git a/tla/consensus/MCccfraft.tla b/tla/consensus/MCccfraft.tla index 37a0dc2b2547..7b4d8ebdb83f 100644 --- a/tla/consensus/MCccfraft.tla +++ b/tla/consensus/MCccfraft.tla @@ -22,10 +22,9 @@ CCF == INSTANCE ccfraft \* In addition to basic settings of how many nodes are to be model checked, \* the model allows to place additional limitations on the state space of the program. MCChangeConfigurationInt(i, newConfiguration) == - /\ reconfigurationCount < Len(Configurations)-1 + /\ reconfigurationCount < Len(Configurations) \* +1 because TLA+ sequences are 1-index - \* +1 to lookup the *next* and not the current configuration. - /\ newConfiguration = Configurations[reconfigurationCount+2] + /\ newConfiguration = Configurations[reconfigurationCount+1] /\ CCF!ChangeConfigurationInt(i, newConfiguration) \* Limit the terms that can be reached. Needs to be set to at least 3 to @@ -102,6 +101,16 @@ View == << reconfigurationVars, <>, serverVars, candi ---- +AllReconfigurationsCommitted == + \E s \in ToServers: + \A c \in ToSet(Configurations): + \E i \in DOMAIN Committed(s): + /\ HasTypeReconfiguration(Committed(s)[i]) + /\ Committed(s)[i].configuration = c + +DebugAllReconfigurationsReachableInv == + ~AllReconfigurationsCommitted + \* Returns true if server i has committed value v, false otherwise IsCommittedByServer(v,i) == IF commitIndex[i] = 0 diff --git a/tla/consensus/MCccfraftWithReconfig.cfg b/tla/consensus/MCccfraftWithReconfig.cfg index c53bf13bc2d3..31a39d9e6531 100644 --- a/tla/consensus/MCccfraftWithReconfig.cfg +++ b/tla/consensus/MCccfraftWithReconfig.cfg @@ -4,7 +4,7 @@ CONSTANTS Configurations <- 3Configurations Servers <- ToServers - MaxTermLimit = 2 + MaxTermLimit = 3 MaxCommitsNotified = 2 Timeout <- MCTimeout @@ -78,6 +78,7 @@ INVARIANTS MatchIndexLowerBoundNextIndexInv CommitCommittableIndices CommittableIndicesAreKnownSignaturesInv + DebugAllReconfigurationsReachableInv \* DebugInvLeaderCannotStepDown \* DebugInvAnyCommitted \* DebugInvAllCommitted