Commit f25b8ee3 authored by Julien Muchembled's avatar Julien Muchembled

storage: clarify several assertions

parent 4150ffb1
...@@ -580,24 +580,22 @@ class TransactionManager(EventQueue): ...@@ -580,24 +580,22 @@ class TransactionManager(EventQueue):
# Lockless store (we are replicating this partition), # Lockless store (we are replicating this partition),
# or unresolved deadlock. # or unresolved deadlock.
continue continue
if ttid != write_locking_tid: if ttid == write_locking_tid:
if __debug__: del self._store_lock_dict[oid]
other = self._transaction_dict[write_locking_tid] elif __debug__:
x = (oid, ttid, write_locking_tid, other = self._transaction_dict[write_locking_tid]
self._replicated, transaction.lockless) x = (oid, ttid, write_locking_tid,
lockless = oid in transaction.lockless self._replicated, transaction.lockless)
# If there were multiple lockless writes, lockless can be assert oid in other.serial_dict, x
# False (after a rebase) whereas the partition is still not if oid in transaction.lockless:
# notified as replicated. # Several lockless stores for this oid and among them,
assert oid in other.serial_dict and not (lockless and # a higher ttid is still pending.
not self._replicated.get(self.getPartition(oid))), x assert transaction < other, x
if not lockless: # There may remain a single lockless store so we'll need
# this partition to be checked in _notifyReplicated.
assert self._replicated.get(self.getPartition(oid)), x
else: # unresolved deadlock
assert not locked, x assert not locked, x
continue # unresolved deadlock
# Several lockless stores for this oid and among them,
# a higher ttid is still pending.
assert transaction < other, x
del self._store_lock_dict[oid]
# remove the transaction # remove the transaction
del self._transaction_dict[ttid] del self._transaction_dict[ttid]
if self._replicated: if self._replicated:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment