Skip to content

Commit b4699fe

Browse files
committed
remove redundant pendingUpgrade flag.
git ignore states folder Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
1 parent ebd9166 commit b4699fe

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ deploy_key
22
transaction_lifecycle.out
33
.vscode/
44
states/
5+
.tlacache/

transaction_lifecycle.tla

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ Symmetry == Permutations(Stores) \cup Permutations(Connections) \cup Permutation
2626

2727
ConnOpen(c) == connections[c].open
2828

29-
ConnPendingUpgrade(c) == connections[c].pendingUpgrade
30-
3129
TxForConn(c) == { tx \in Transactions : Live(tx) /\ transactions[tx].conn = c }
3230

3331
AllTxFinishedForConn(c) ==
@@ -67,7 +65,6 @@ TypeOK ==
6765
/\ oldDbVersion \in Versions
6866
/\ connections \in [Connections ->
6967
[open: BOOLEAN,
70-
pendingUpgrade: BOOLEAN,
7168
requestedVersion: Versions,
7269
closed: BOOLEAN,
7370
close_pending: BOOLEAN ]]
@@ -137,7 +134,6 @@ DefaultTx ==
137134

138135
DefaultConn ==
139136
[ open |-> FALSE,
140-
pendingUpgrade |-> FALSE,
141137
requestedVersion|-> 0,
142138
closed |-> FALSE,
143139
close_pending |-> FALSE ]
@@ -160,7 +156,6 @@ StartOpenConnection(c, requestedVersion) ==
160156
/\ Len(connection_queue) < Cardinality(Connections)
161157
/\ connections' = [connections EXCEPT
162158
![c] = [open |-> FALSE,
163-
pendingUpgrade |-> (requestedVersion > dbVersion),
164159
requestedVersion|-> requestedVersion,
165160
closed |-> FALSE,
166161
close_pending |-> FALSE]
@@ -179,8 +174,8 @@ FinishOpenConnection(c) ==
179174
/\ IF connections[c].closed
180175
\* If connection was closed,
181176
\* return a newly created "AbortError" DOMException and abort these steps.
182-
THEN connections' = [connections EXCEPT ![c].pendingUpgrade = FALSE]
183-
ELSE connections' = [connections EXCEPT ![c].open = TRUE, ![c].pendingUpgrade = FALSE]
177+
THEN connections' = connections
178+
ELSE connections' = [connections EXCEPT ![c].open = TRUE]
184179
/\ connection_queue' = Tail(connection_queue)
185180
/\ UNCHANGED <<transactions, stores, pending_stores, dbVersion, oldDbVersion, next_tx_order>>
186181

@@ -190,7 +185,6 @@ FinishOpenConnection(c) ==
190185
RejectOpenConnection(c) ==
191186
/\ Len(connection_queue) > 0
192187
/\ c = Head(connection_queue)
193-
/\ ~connections[c].pendingUpgrade
194188
/\ connections[c].requestedVersion < dbVersion
195189
/\ connections' = [connections EXCEPT ![c] = DefaultConn]
196190
/\ connection_queue' = Tail(connection_queue)
@@ -207,7 +201,7 @@ CreateUpgradeTransaction(c) ==
207201
/\ Len(connection_queue) > 0
208202
/\ ~ConnOpen(c)
209203
/\ c = Head(connection_queue)
210-
/\ ConnPendingUpgrade(c)
204+
/\ connections[c].requestedVersion > dbVersion
211205
/\ \A other \in (Connections \ {c}): ~ConnOpen(other)
212206
/\ freeTxs # {}
213207
/\ transactions' = [transactions EXCEPT

0 commit comments

Comments
 (0)