Skip to content

Commit

Permalink
Update consensus protocol spec (#9607)
Browse files Browse the repository at this point in the history
The spec was written for the buggy protocol which we had before the one
more similar to Raft was implemented. Update the spec with what we
currently have.

ref #8699
  • Loading branch information
arssher authored Dec 2, 2024
1 parent 1b60571 commit fa909c2
Show file tree
Hide file tree
Showing 20 changed files with 3,797 additions and 397 deletions.
3 changes: 3 additions & 0 deletions safekeeper/spec/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*TTrace*
*.toolbox/
states/
31 changes: 31 additions & 0 deletions safekeeper/spec/MCProposerAcceptorStatic.tla
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---- MODULE MCProposerAcceptorStatic ----
EXTENDS TLC, ProposerAcceptorStatic

\* Augments the spec with model checking constraints.

\* For model checking.
CONSTANTS
max_entries, \* model constraint: max log entries acceptor/proposer can hold
max_term \* model constraint: max allowed term

ASSUME max_entries \in Nat /\ max_term \in Nat

\* Model space constraint.
StateConstraint == \A p \in proposers:
/\ prop_state[p].term <= max_term
/\ Len(prop_state[p].wal) <= max_entries
\* Sets of proposers and acceptors are symmetric because we don't take any
\* actions depending on some concrete proposer/acceptor (like IF p = p1 THEN
\* ...)
ProposerAcceptorSymmetry == Permutations(proposers) \union Permutations(acceptors)

\* enforce order of the vars in the error trace with ALIAS
\* Note that ALIAS is supported only since version 1.8.0 which is pre-release
\* as of writing this.
Alias == [
prop_state |-> prop_state,
acc_state |-> acc_state,
committed |-> committed
]

====
34 changes: 0 additions & 34 deletions safekeeper/spec/ProposerAcceptorConsensus.cfg

This file was deleted.

Loading

1 comment on commit fa909c2

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

7018 tests run: 6709 passed, 1 failed, 308 skipped (full report)


Failures on Postgres 15

# Run all failed tests locally:
scripts/pytest -vv -n $(nproc) -k "test_pull_timeline[release-pg15-True]"
Flaky tests (5)

Postgres 17

Postgres 15

Postgres 14

Test coverage report is not available

The comment gets automatically updated with the latest test results
fa909c2 at 2024-12-02T17:13:19.979Z :recycle:

Please sign in to comment.