Commit 3c034eca authored by Julien Muchembled's avatar Julien Muchembled

More logs

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2795 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent e05f909e
...@@ -400,6 +400,7 @@ class TransactionManager(object): ...@@ -400,6 +400,7 @@ class TransactionManager(object):
""" """
Remove a transaction, commited or aborted Remove a transaction, commited or aborted
""" """
neo.lib.logging.debug('Remove TXN %s', dump(ttid))
try: try:
# only in case of an import: # only in case of an import:
self._queue.remove((uuid, ttid)) self._queue.remove((uuid, ttid))
...@@ -420,6 +421,7 @@ class TransactionManager(object): ...@@ -420,6 +421,7 @@ class TransactionManager(object):
If transaction is completely locked, calls function given at If transaction is completely locked, calls function given at
instanciation time. instanciation time.
""" """
neo.lib.logging.debug('Lock TXN %s for %s', dump(ttid), dump(uuid))
assert ttid in self._ttid_dict, "Transaction not started" assert ttid in self._ttid_dict, "Transaction not started"
txn = self._ttid_dict[ttid] txn = self._ttid_dict[ttid]
if txn.lock(uuid) and self._queue[0][1] == ttid: if txn.lock(uuid) and self._queue[0][1] == ttid:
......
...@@ -183,6 +183,9 @@ class ReplicationHandler(EventHandler): ...@@ -183,6 +183,9 @@ class ReplicationHandler(EventHandler):
length=RANGE_LENGTH): length=RANGE_LENGTH):
replicator = self.app.replicator replicator = self.app.replicator
partition = replicator.getCurrentOffset() partition = replicator.getCurrentOffset()
neo.lib.logging.debug("Check serial range (offset=%s, min_oid=%x,"
" min_tid=%x, max_tid=%x, length=%s)", partition, u64(min_oid),
u64(min_tid), u64(max_tid), length)
check_args = (min_oid, min_tid, max_tid, length, partition) check_args = (min_oid, min_tid, max_tid, length, partition)
replicator.checkSerialRange(*check_args) replicator.checkSerialRange(*check_args)
return Packets.AskCheckSerialRange(*check_args) return Packets.AskCheckSerialRange(*check_args)
...@@ -190,6 +193,9 @@ class ReplicationHandler(EventHandler): ...@@ -190,6 +193,9 @@ class ReplicationHandler(EventHandler):
def _doAskCheckTIDRange(self, min_tid, max_tid, length=RANGE_LENGTH): def _doAskCheckTIDRange(self, min_tid, max_tid, length=RANGE_LENGTH):
replicator = self.app.replicator replicator = self.app.replicator
partition = replicator.getCurrentOffset() partition = replicator.getCurrentOffset()
neo.lib.logging.debug(
"Check TID range (offset=%s, min_tid=%x, max_tid=%x, length=%s)",
partition, u64(min_tid), u64(max_tid), length)
replicator.checkTIDRange(min_tid, max_tid, length, partition) replicator.checkTIDRange(min_tid, max_tid, length, partition)
return Packets.AskCheckTIDRange(min_tid, max_tid, length, partition) return Packets.AskCheckTIDRange(min_tid, max_tid, length, partition)
...@@ -198,6 +204,8 @@ class ReplicationHandler(EventHandler): ...@@ -198,6 +204,8 @@ class ReplicationHandler(EventHandler):
partition_id = replicator.getCurrentOffset() partition_id = replicator.getCurrentOffset()
max_tid = replicator.getCurrentCriticalTID() max_tid = replicator.getCurrentCriticalTID()
replicator.getTIDsFrom(min_tid, max_tid, length, partition_id) replicator.getTIDsFrom(min_tid, max_tid, length, partition_id)
neo.lib.logging.debug("Ask TIDs (offset=%s, min_tid=%x, max_tid=%x,"
"length=%s)", partition_id, u64(min_tid), u64(max_tid), length)
return Packets.AskTIDsFrom(min_tid, max_tid, length, [partition_id]) return Packets.AskTIDsFrom(min_tid, max_tid, length, [partition_id])
def _doAskObjectHistoryFrom(self, min_oid, min_serial, length): def _doAskObjectHistoryFrom(self, min_oid, min_serial, length):
......
...@@ -150,6 +150,7 @@ class TransactionManager(object): ...@@ -150,6 +150,7 @@ class TransactionManager(object):
""" """
Register a transaction, it may be already registered Register a transaction, it may be already registered
""" """
neo.lib.logging.debug('Register TXN %s for %s', dump(ttid), dump(uuid))
transaction = self._transaction_dict.get(ttid, None) transaction = self._transaction_dict.get(ttid, None)
if transaction is None: if transaction is None:
transaction = Transaction(uuid, ttid) transaction = Transaction(uuid, ttid)
...@@ -180,6 +181,7 @@ class TransactionManager(object): ...@@ -180,6 +181,7 @@ class TransactionManager(object):
""" """
Lock a transaction Lock a transaction
""" """
neo.lib.logging.debug('Lock TXN %s (ttid=%s)', dump(tid), dump(ttid))
transaction = self._transaction_dict[ttid] transaction = self._transaction_dict[ttid]
# remember that the transaction has been locked # remember that the transaction has been locked
transaction.lock() transaction.lock()
...@@ -208,6 +210,7 @@ class TransactionManager(object): ...@@ -208,6 +210,7 @@ class TransactionManager(object):
""" """
Unlock transaction Unlock transaction
""" """
neo.lib.logging.debug('Unlock TXN %s', dump(ttid))
self._app.dm.finishTransaction(self.getTIDFromTTID(ttid)) self._app.dm.finishTransaction(self.getTIDFromTTID(ttid))
self.abort(ttid, even_if_locked=True) self.abort(ttid, even_if_locked=True)
...@@ -314,6 +317,7 @@ class TransactionManager(object): ...@@ -314,6 +317,7 @@ class TransactionManager(object):
# of the partition, even if no data was received (eg. conflict on # of the partition, even if no data was received (eg. conflict on
# another node) # another node)
return return
neo.lib.logging.debug('Abort TXN %s', dump(ttid))
transaction = self._transaction_dict[ttid] transaction = self._transaction_dict[ttid]
has_load_lock = transaction.isLocked() has_load_lock = transaction.isLocked()
# if the transaction is locked, ensure we can drop it # if the transaction is locked, ensure we can drop it
...@@ -344,6 +348,7 @@ class TransactionManager(object): ...@@ -344,6 +348,7 @@ class TransactionManager(object):
""" """
Abort any non-locked transaction of a node Abort any non-locked transaction of a node
""" """
neo.lib.logging.debug('Abort for %s', dump(uuid))
# 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)
......
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