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

Send ack message after commit

parent e28b3b44
......@@ -50,7 +50,7 @@ class AckSyncMessage(Message):
self.objname = kwargs["objname"]
self.archive = kwargs["archive"]
self.serial = kwargs["serial"]
self.logger.info("Acking archive: %s, object: '%s', serial: %s" %
self.logger.info("Acked archive: %s, object: '%s', serial: %s" %
(self.archive, self.objname, self.serial))
......
......@@ -235,17 +235,25 @@ class FileSyncer(object):
# here we could do any checks needed on the old state,
# perhaps triggering a probe
@transaction()
def ack_file_sync(self, synced_source_state, synced_target_state):
db = self.get_db()
self._ack_file_sync(synced_source_state, synced_target_state)
serial = synced_source_state.serial
objname = synced_source_state.objname
source = synced_source_state.archive
target = synced_target_state.archive
msg = messaging.AckSyncMessage(
archive=target, objname=objname, serial=serial,
logger=logger)
self.messager.put(msg)
@transaction()
def _ack_file_sync(self, synced_source_state, synced_target_state):
db = self.get_db()
serial = synced_source_state.serial
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))
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