summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVenky Shankar <vshankar@redhat.com>2013-08-27 12:20:30 +0530
committerAnand Avati <avati@redhat.com>2013-09-04 20:54:38 -0700
commitb2e8a4517d63100e9527a1995ef24507192fc363 (patch)
tree6e46d7af81f9820de83a717d5494ea68bd97e302
parente0fa0bb1b1e1758d2e68b4940939e87d438fa14f (diff)
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 <vshankar@redhat.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Tested-by: Amar Tumballi <amarts@redhat.com> Reviewed-on: http://review.gluster.org/5758 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Avra Sengupta <asengupt@redhat.com> Tested-by: Avra Sengupta <asengupt@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
-rw-r--r--geo-replication/syncdaemon/master.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/geo-replication/syncdaemon/master.py b/geo-replication/syncdaemon/master.py
index d33e4ed..f18a60e 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]