Commit da54d3bb authored by Giorgos Korfiatis's avatar Giorgos Korfiatis
Browse files

add some more log

parent 35437151
......@@ -405,6 +405,8 @@ class LocalfsSourceHandle(object):
def check_log(self):
with self.heartbeat.lock() as hb:
prev_log = hb.get(self.objname)
logger.info("object: %s heartbeat: %s" %
(self.objname, prev_log))
if prev_log is not None:
actionstate, ts = prev_log
if actionstate != self.SIGNATURE or \
......@@ -415,6 +417,7 @@ class LocalfsSourceHandle(object):
logger.warning("Ignoring previous run in %s: %s %s" %
(self.SIGNATURE, self.objname, prev_log))
hb.set(self.objname, (self.SIGNATURE, utils.time_stamp()))
print "LOG", self.heartbeat._LOG
def get_synced_state(self):
return self.source_state
......@@ -446,6 +449,7 @@ class LocalfsSourceHandle(object):
def clear_log(self):
with self.heartbeat.lock() as hb:
hb.delete(self.objname)
logger.info("DELETED %s" % self.objname)
def do_unstage(self):
if self.stage_filename is None:
......
......@@ -40,8 +40,10 @@ class SyncMessage(Message):
self.objname = kwargs["objname"]
self.archive = kwargs["archive"]
self.serial = kwargs["serial"]
self.logger.info("Syncing archive: %s, object: '%s', serial: %s" %
(self.archive, self.objname, self.serial))
self.info = kwargs["info"]
self.logger.info("Syncing archive: %s, object: '%s', serial: %s "
"info: %s" %
(self.archive, self.objname, self.serial, self.info))
class AckSyncMessage(Message):
......
......@@ -83,6 +83,8 @@ class PithosSourceHandle(object):
def check_log(self):
with self.heartbeat.lock() as hb:
prev_log = hb.get(self.objname)
logger.info("object: %s heartbeat: %s" %
(self.objname, prev_log))
if prev_log is not None:
actionstate, ts = prev_log
if actionstate != self.SIGNATURE or \
......@@ -149,7 +151,7 @@ class PithosSourceHandle(object):
def clear_log(self):
with self.heartbeat.lock() as hb:
hb.delete(self.objname)
logger.info("DELETED %s" % self.objname)
STAGED_FOR_DELETION_SUFFIX = ".pithos_staged_for_deletion"
exclude_staged_regex = ".*" + STAGED_FOR_DELETION_SUFFIX + "$"
......
......@@ -223,6 +223,7 @@ class FileSyncer(object):
objname=source_state.objname,
archive=source_state.archive,
serial=source_state.serial,
info=source_state.info,
logger=logger)
self.messager.put(msg)
thread = threading.Thread(
......@@ -276,8 +277,10 @@ class FileSyncer(object):
objname = synced_source_state.objname
source = synced_source_state.archive
target = synced_target_state.archive
logger.info("Acking archive: %s, object: '%s', serial: %s" %
(target, objname, serial))
tinfo = synced_target_state.info
logger.info("Acking archive: %s, object: '%s', serial: %s "
"info: %s" %
(target, objname, serial, tinfo))
decision_state = db.get_state(self.DECISION, objname)
sync_state = db.get_state(self.SYNC, objname)
......
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