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):
"""
Remove a transaction, commited or aborted
"""
neo.lib.logging.debug('Remove TXN %s', dump(ttid))
try:
# only in case of an import:
self._queue.remove((uuid, ttid))
......@@ -420,6 +421,7 @@ class TransactionManager(object):
If transaction is completely locked, calls function given at
instanciation time.
"""
neo.lib.logging.debug('Lock TXN %s for %s', dump(ttid), dump(uuid))
assert ttid in self._ttid_dict, "Transaction not started"
txn = self._ttid_dict[ttid]
if txn.lock(uuid) and self._queue[0][1] == ttid:
......
......@@ -183,6 +183,9 @@ class ReplicationHandler(EventHandler):
length=RANGE_LENGTH):
replicator = self.app.replicator
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)
replicator.checkSerialRange(*check_args)
return Packets.AskCheckSerialRange(*check_args)
......@@ -190,6 +193,9 @@ class ReplicationHandler(EventHandler):
def _doAskCheckTIDRange(self, min_tid, max_tid, length=RANGE_LENGTH):
replicator = self.app.replicator
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)
return Packets.AskCheckTIDRange(min_tid, max_tid, length, partition)
......@@ -198,6 +204,8 @@ class ReplicationHandler(EventHandler):
partition_id = replicator.getCurrentOffset()
max_tid = replicator.getCurrentCriticalTID()
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])
def _doAskObjectHistoryFrom(self, min_oid, min_serial, length):
......
......@@ -150,6 +150,7 @@ class TransactionManager(object):
"""
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)
if transaction is None:
transaction = Transaction(uuid, ttid)
......@@ -180,6 +181,7 @@ class TransactionManager(object):
"""
Lock a transaction
"""
neo.lib.logging.debug('Lock TXN %s (ttid=%s)', dump(tid), dump(ttid))
transaction = self._transaction_dict[ttid]
# remember that the transaction has been locked
transaction.lock()
......@@ -208,6 +210,7 @@ class TransactionManager(object):
"""
Unlock transaction
"""
neo.lib.logging.debug('Unlock TXN %s', dump(ttid))
self._app.dm.finishTransaction(self.getTIDFromTTID(ttid))
self.abort(ttid, even_if_locked=True)
......@@ -314,6 +317,7 @@ class TransactionManager(object):
# of the partition, even if no data was received (eg. conflict on
# another node)
return
neo.lib.logging.debug('Abort TXN %s', dump(ttid))
transaction = self._transaction_dict[ttid]
has_load_lock = transaction.isLocked()
# if the transaction is locked, ensure we can drop it
......@@ -344,6 +348,7 @@ class TransactionManager(object):
"""
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
for ttid in [x.getTTID() for x in self._uuid_dict.get(uuid, [])]:
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