From b2e8a4517d63100e9527a1995ef24507192fc363 Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Tue, 27 Aug 2013 12:20:30 +0530 Subject: gsyncd / geo-rep: maximum number of retries per changelog With entry retries MAX_RETRIES is the threashold for the number of times we retry a changelog. After hitting this limit, the changelog is marked as processed after warning for incompleteness in the log. Change-Id: I777b71b4cdaa63335d9c936f2d64e5c0264a0f26 BUG: 1003803 Signed-off-by: Venky Shankar Reviewed-by: Amar Tumballi Tested-by: Amar Tumballi Reviewed-on: http://review.gluster.org/5758 Tested-by: Gluster Build System Reviewed-by: Avra Sengupta Tested-by: Avra Sengupta Reviewed-by: Anand Avati --- geo-replication/syncdaemon/master.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/geo-replication/syncdaemon/master.py b/geo-replication/syncdaemon/master.py index d33e4ed3..f18a60e6 100644 --- a/geo-replication/syncdaemon/master.py +++ b/geo-replication/syncdaemon/master.py @@ -580,6 +580,9 @@ class GMasterChangelogMixin(GMasterCommon): # flat directory heirarchy for gfid based access FLAT_DIR_HIERARCHY = '.' + # maximum retries per changelog before giving up + MAX_RETRIES = 10 + def fallback_xsync(self): logging.info('falling back to xsync mode') gconf.configinterface.set('change-detector', 'xsync') @@ -734,6 +737,7 @@ class GMasterChangelogMixin(GMasterCommon): def process(self, changes, done=1): for change in changes: + tries = 0 retry = False while True: logging.debug('processing change %s' % change) @@ -741,6 +745,13 @@ class GMasterChangelogMixin(GMasterCommon): self.sync_done() break retry = True + tries += 1 + if tries == self.MAX_RETRIES: + logging.warn('changelog %s could not be processed - moving on...' % os.path.basename(change)) + self.sync_done() + if done: + self.master.server.changelog_done(change) + break # it's either entry_ops() or Rsync that failed to do it's # job. Mostly it's entry_ops() [which currently has a problem # of failing to create an entry but failing to return an errno] -- cgit