summaryrefslogtreecommitdiffstats
path: root/geo-replication
diff options
context:
space:
mode:
authorAravinda VK <avishwan@redhat.com>2015-05-26 13:01:17 +0530
committerVenky Shankar <vshankar@redhat.com>2015-05-31 07:44:20 -0700
commit0845b41ad02a1891759c3397374d709afa4cb9d2 (patch)
treeb52a312e40c0ec6fe7861affcda3562122baf2b9 /geo-replication
parent06710aa1085a7c5f3259af6b63d23ac5f51bef18 (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: 1224100 Change-Id: I87617f2fd5f4d3221a1c9f9d5a8efb0686c42bbe Signed-off-by: Aravinda VK <avishwan@redhat.com> Reviewed On: http://review.gluster.org/#/c/10911/ Reviewed-on: http://review.gluster.org/10912 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Venky Shankar <vshankar@redhat.com>
Diffstat (limited to 'geo-replication')
-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):