Commit 2d388048 authored by Julien Muchembled's avatar Julien Muchembled

storage: review TransactionManager.abortFor

This reverts commit 7aecdada partially.
There seems to be no bug here, because:
- abortFor() is only called upon a notification from the master that a client
  is disconnected,
- and from the same TCP connection, we only receive a LockInformation packet
  if there's still such a transaction on the master side.

The code removed in abortFor() was redundant with abort().
parent cb144fdb
...@@ -355,17 +355,9 @@ class TransactionManager(object): ...@@ -355,17 +355,9 @@ class TransactionManager(object):
Abort any non-locked transaction of a node Abort any non-locked transaction of a node
""" """
logging.debug('Abort for %s', uuid_str(uuid)) logging.debug('Abort for %s', uuid_str(uuid))
# BUG: Discarding voted transactions must only be a decision of the
# master, and for this, we'll need to review how transactions are
# aborted. As a workaround, we rely on the fact that lock() will
# disconnect from the master in case of LockInformation.
# abort any non-locked transaction of this node # abort any non-locked transaction of this node
for ttid in [x.getTTID() for x in self._uuid_dict.get(uuid, [])]: for ttid in [x.getTTID() for x in self._uuid_dict.get(uuid, ())]:
self.abort(ttid) self.abort(ttid)
# cleanup _uuid_dict if no transaction remains for this node
transaction_set = self._uuid_dict.get(uuid)
if transaction_set is not None and not transaction_set:
del self._uuid_dict[uuid]
def isLockedTid(self, tid): def isLockedTid(self, tid):
for t in self._transaction_dict.itervalues(): for t in self._transaction_dict.itervalues():
......
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