I try to reproduce the bug which is fixed by tikv/tikv#5673. The bug is introduced by the new check_txn_status API, which is a cleanup API substitution. We forgot to write rollback when there is no lock.
To reproduce the problem in TLA+, I change the eraseLock in CollapseRollbacks by:
eraseLock(key, l) ==
IF l \in key_lock[key]
THEN
/\ key_data' = [key_data EXCEPT ![key] = @ \ {[ts |-> l.ts]}]
/\ key_lock' = [key_lock EXCEPT ![key] = @ \ {l}]
/\ key_write' = [key_write EXCEPT ![key] =
Append(@, [ts |-> l.ts, type |-> "rollback"])]
ELSE
UNCHANGED <<key_data, key_lock, key_write>>
This demonstrates the wrong implementation in tikv/tikv#5390. However, the tests still pass.
I try to reproduce the bug which is fixed by tikv/tikv#5673. The bug is introduced by the new check_txn_status API, which is a cleanup API substitution. We forgot to write rollback when there is no lock.
To reproduce the problem in TLA+, I change the eraseLock in
CollapseRollbacksby:This demonstrates the wrong implementation in tikv/tikv#5390. However, the tests still pass.