summaryrefslogtreecommitdiffstats
path: root/geo-replication/syncdaemon
diff options
context:
space:
mode:
authorAravinda VK <avishwan@redhat.com>2015-05-26 13:01:17 +0530
committerVenky Shankar <vshankar@redhat.com>2015-05-30 22:19:08 -0700
commit5863ab43d7f3b045f5b889b98f73687b07b3f0e8 (patch)
treee6bce8afc00cd853b0cf4ab64b3bb51878aa078b /geo-replication/syncdaemon
parent35f7d213fe7395ba502a8e209b04c2be1ea75928 (diff)
geo-rep: Fix Data counter issue in status
ENTRY and META operations executed sequentially, DATA operations are handled async, increment happens when a changelog parsed. Decrement happens after the sync of all files. 'files_in_batch' was reset multiple times in batch instead of once. BUG: 1224098 Change-Id: I87617f2fd5f4d3221a1c9f9d5a8efb0686c42bbe Signed-off-by: Aravinda VK <avishwan@redhat.com> Reviewed-on: http://review.gluster.org/10911 Reviewed-by: Kotresh HR <khiremat@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'geo-replication/syncdaemon')
-rw-r--r--geo-replication/syncdaemon/master.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/geo-replication/syncdaemon/master.py b/geo-replication/syncdaemon/master.py
index aedfc232b07..e05dc376662 100644
--- a/geo-replication/syncdaemon/master.py
+++ b/geo-replication/syncdaemon/master.py
@@ -895,8 +895,8 @@ class GMasterChangelogMixin(GMasterCommon):
# Increment counters for Status
self.status.inc_value("entry", len(entries))
- self.files_in_batch = len(datas)
- self.status.inc_value("data", self.files_in_batch)
+ self.files_in_batch += len(datas)
+ self.status.inc_value("data", len(datas))
# sync namespace
if entries:
@@ -930,6 +930,7 @@ class GMasterChangelogMixin(GMasterCommon):
tries = 0
retry = False
self.unlinked_gfids = []
+ self.files_in_batch = 0
while True:
self.skipped_gfid_list = []
@@ -983,6 +984,8 @@ class GMasterChangelogMixin(GMasterCommon):
self.status.set_last_synced(xtl, checkpoint_time)
map(self.changelog_done_func, changes)
self.archive_and_purge_changelogs(changes)
+
+ # Reset Data counter after sync
self.status.dec_value("data", self.files_in_batch)
self.files_in_batch = 0
break
@@ -999,7 +1002,10 @@ class GMasterChangelogMixin(GMasterCommon):
logging.warn('SKIPPED GFID = %s' %
','.join(self.skipped_gfid_list))
+ # Reset data counter on failure
+ self.status.dec_value("data", self.files_in_batch)
self.files_in_batch = 0
+
if done:
xtl = (int(change.split('.')[-1]) - 1, 0)
self.upd_stime(xtl)
@@ -1022,6 +1028,10 @@ class GMasterChangelogMixin(GMasterCommon):
# TODO: remove entry retries when it's gets fixed.
logging.warn('incomplete sync, retrying changelogs: %s' %
' '.join(map(os.path.basename, changes)))
+
+ # Reset the Data counter before Retry
+ self.status.dec_value("data", self.files_in_batch)
+ self.files_in_batch = 0
time.sleep(0.5)
def upd_stime(self, stime, path=None):