Commit 2241c3a1 authored by Julien Muchembled's avatar Julien Muchembled

In logs, show tid in hex instead of decimal

parent 7e4e75e4
......@@ -35,7 +35,7 @@ from neo.lib.exception import PrimaryFailure
from neo.lib.node import NodeManager
from neo.lib.protocol import CellStates, ClusterStates, NodeTypes, Packets
from neo.lib.protocol import INVALID_TID, ZERO_TID
from neo.lib.util import add64, u64, dump
from neo.lib.util import add64, dump
from .app import StateChangedException
from .pt import PartitionTable
from .handlers.backup import BackupHandler
......@@ -167,8 +167,8 @@ class BackupApplication(object):
cell.replicating = tid
if cell.backup_tid < tid:
neo.lib.logging.debug(
"ask %s to replicate partition %u up to %u from %r",
dump(cell.getUUID()), offset, u64(tid),
"ask %s to replicate partition %u up to %s from %r",
dump(cell.getUUID()), offset, dump(tid),
dump(primary_node.getUUID()))
cell.getNode().getConnection().notify(p)
trigger_set.add(primary_node)
......@@ -198,8 +198,8 @@ class BackupApplication(object):
# This is the last time we can increase
# 'backup_tid' without replication.
neo.lib.logging.debug(
"partition %u: updating backup_tid of %r to %u",
offset, cell, u64(prev_tid))
"partition %u: updating backup_tid of %r to %s",
offset, cell, dump(prev_tid))
cell.backup_tid = prev_tid
assert node_list
trigger_set.update(node_list)
......@@ -214,8 +214,8 @@ class BackupApplication(object):
if last_max_tid <= cell.backup_tid:
cell.backup_tid = tid
neo.lib.logging.debug(
"partition %u: updating backup_tid of %r to %u",
offset, cell, u64(tid))
"partition %u: updating backup_tid of %r to %s",
offset, cell, dump(tid))
for node in trigger_set:
self.triggerBackup(node)
count = sum(map(len, self.tid_list))
......@@ -251,8 +251,8 @@ class BackupApplication(object):
address_set.add(addr)
source_dict[offset] = addr
neo.lib.logging.debug(
"ask %s to replicate partition %u up to %u from %r",
dump(node.getUUID()), offset, u64(tid), addr)
"ask %s to replicate partition %u up to %s from %r",
dump(node.getUUID()), offset, dump(tid), addr)
node.getConnection().notify(Packets.Replicate(
tid, self.name, source_dict))
......@@ -269,8 +269,8 @@ class BackupApplication(object):
tid = add64(tid_list[bisect(tid_list, tid)], -1)
except IndexError:
tid = app.getLastTransaction()
neo.lib.logging.debug("partition %u: updating backup_tid of %r to %u",
offset, cell, u64(tid))
neo.lib.logging.debug("partition %u: updating backup_tid of %r to %s",
offset, cell, dump(tid))
cell.backup_tid = tid
# Forget tids we won't need anymore.
cell_list = app.pt.getCellList(offset, readable=True)
......@@ -286,8 +286,8 @@ class BackupApplication(object):
if tid < max_tid:
cell.replicating = max_tid
neo.lib.logging.debug(
"ask %s to replicate partition %u up to %u from %r",
dump(node.getUUID()), offset, u64(max_tid),
"ask %s to replicate partition %u up to %s from %r",
dump(node.getUUID()), offset, dump(max_tid),
dump(primary_node.getUUID()))
node.getConnection().notify(Packets.Replicate(max_tid,
'', {offset: primary_node.getAddress()}))
......@@ -301,8 +301,8 @@ class BackupApplication(object):
if max(cell.backup_tid, cell.replicating) < tid:
cell.replicating = tid
neo.lib.logging.debug(
"ask %s to replicate partition %u up to %u from"
" %r", dump(cell.getUUID()), offset, u64(tid),
"ask %s to replicate partition %u up to %s from"
" %r", dump(cell.getUUID()), offset, dump(tid),
dump(node.getUUID()))
cell.getNode().getConnection().notify(p)
return result
......@@ -22,7 +22,7 @@ from neo.lib.connector import ConnectorConnectionClosedException
from neo.lib.handler import EventHandler
from neo.lib.protocol import Errors, NodeStates, Packets, \
ZERO_HASH, ZERO_TID, ZERO_OID
from neo.lib.util import add64, u64
from neo.lib.util import add64
def checkConnectionIsReplicatorConnection(func):
def decorator(self, conn, *args, **kw):
......
......@@ -57,7 +57,7 @@ import neo.lib
from neo.lib.protocol import CellStates, NodeTypes, NodeStates, Packets, \
INVALID_TID, ZERO_TID, ZERO_OID
from neo.lib.connection import ClientConnection
from neo.lib.util import add64, u64
from neo.lib.util import add64, dump
from .handlers.storage import StorageOperationHandler
FETCH_COUNT = 1000
......@@ -242,8 +242,8 @@ class Replicator(object):
min_tid = p.next_trans
self.replicate_tid = self.replicate_dict.pop(offset)
neo.lib.logging.debug("starting replication of <partition=%u"
" min_tid=%u max_tid=%u> from %r", offset, u64(min_tid),
u64(self.replicate_tid), self.current_node)
" min_tid=%s max_tid=%s> from %r", offset, dump(min_tid),
dump(self.replicate_tid), self.current_node)
max_tid = self.replicate_tid
tid_list = self.app.dm.getReplicationTIDList(min_tid, max_tid,
FETCH_COUNT, offset)
......@@ -286,8 +286,8 @@ class Replicator(object):
if not p.max_ttid:
p = Packets.NotifyReplicationDone(offset, tid)
self.app.master_conn.notify(p)
neo.lib.logging.debug("partition %u replicated up to %u from %r",
offset, u64(tid), self.current_node)
neo.lib.logging.debug("partition %u replicated up to %s from %r",
offset, dump(tid), self.current_node)
self._nextPartition()
def abort(self, message=''):
......
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