Commit f25b8ee3 authored by Julien Muchembled's avatar Julien Muchembled

storage: clarify several assertions

parent 4150ffb1
......@@ -580,24 +580,22 @@ class TransactionManager(EventQueue):
# Lockless store (we are replicating this partition),
# or unresolved deadlock.
continue
if ttid != write_locking_tid:
if __debug__:
if ttid == write_locking_tid:
del self._store_lock_dict[oid]
elif __debug__:
other = self._transaction_dict[write_locking_tid]
x = (oid, ttid, write_locking_tid,
self._replicated, transaction.lockless)
lockless = oid in transaction.lockless
# If there were multiple lockless writes, lockless can be
# False (after a rebase) whereas the partition is still not
# notified as replicated.
assert oid in other.serial_dict and not (lockless and
not self._replicated.get(self.getPartition(oid))), x
if not lockless:
assert not locked, x
continue # unresolved deadlock
assert oid in other.serial_dict, x
if oid in transaction.lockless:
# 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]
# 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
# remove the transaction
del self._transaction_dict[ttid]
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