Skip to content

Commit

Permalink
fix(percolator): incorrect snapshot read (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
s12f authored Nov 30, 2024
1 parent fef3bbd commit bd61272
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tlc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
- multi-paxos-eb0/MultiPaxos.tla
- paxos-eb0/PaxosEb0.tla
- percolator/Transfer.tla
- percolator/SnapshotRead.tla
- sequencer/Sequencer.tla
- simplified-fast-paxos/SimplifiedFastPaxos.tla
steps:
Expand Down
5 changes: 3 additions & 2 deletions percolator/Percolator.tla
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ CanRead(k, ts) ≜

ReadKey(key, ts)
LET data rows[key].data
max_before_ts MaxUnder(DOMAIN data, ts)
IN data[max_before_ts]
write rows[key].write
max_before_ts MaxUnder(DOMAIN write, ts)
IN data[write[max_before_ts]]

StartPreWrite(tx)
LET read txs[tx].read
Expand Down
2 changes: 1 addition & 1 deletion percolator/PhantomP3.cfg → percolator/SnapshotRead.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONSTANTS
None = None
INVARIANT PhantomP3Inv
INVARIANT SnapshotReadInv
SPECIFICATION Spec
4 changes: 2 additions & 2 deletions percolator/PhantomP3.tla → percolator/SnapshotRead.tla
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-------------------------------- MODULE PhantomP3 ----------------------------
-------------------------------- MODULE SnapshotRead ----------------------------
EXTENDS Integers, TLC, FiniteSets

-----------------------------------------------------------------------------
Expand Down Expand Up @@ -35,7 +35,7 @@ TxOp ≜

INSTANCE Percolator

PhantomP3Inv
SnapshotReadInv
txs["t2"].status "committed"
LET r txs["t2"].read
IN 20 = r["k1"] + r["k2"]
Expand Down
2 changes: 1 addition & 1 deletion percolator/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ this project only specifies the core transaction part(without the notifications)

- Percolator.tla: Percolator Specification
- Transfer.tla: Verify the transfer transactions in the Percolator Specification.
- PhantomP3.tla: an example that Percolator allows Phantom P3 history(https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/tr-95-51.pdf), so the tlc will fail, and outputs the state history.
- SnapshotRead.tla: Verify SnapshotRead.

0 comments on commit bd61272

Please sign in to comment.