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]
elif __debug__:
other = self._transaction_dict[write_locking_tid] other = self._transaction_dict[write_locking_tid]
x = (oid, ttid, write_locking_tid, x = (oid, ttid, write_locking_tid,
self._replicated, transaction.lockless) self._replicated, transaction.lockless)
lockless = oid in transaction.lockless assert oid in other.serial_dict, x
# If there were multiple lockless writes, lockless can be if oid in transaction.lockless:
# 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
# Several lockless stores for this oid and among them, # Several lockless stores for this oid and among them,
# a higher ttid is still pending. # a higher ttid is still pending.
assert transaction < other, x 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 # 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