summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAravinda VK <avishwan@redhat.com>2014-05-05 11:04:00 +0530
committerVenky Shankar <vshankar@redhat.com>2014-05-09 00:17:59 -0700
commit65757e0f57f93103d87fdf9534c5ca25b66d14b7 (patch)
tree9536b28ac93d7a45d76cd30c2aaa975b9ab26c62
parent93129e862a2dde291ddbf22fe30d955b25da6059 (diff)
geo-rep: Changelog History consumption more fixes
Number of parallel threads to process changelog history is made configurable via sync_jobs Change-Id: Idcd8e655d9df540cfa48648b9e98af941f95e9d0 Signed-off-by: Aravinda VK <avishwan@redhat.com> Reviewed-on: http://review.gluster.org/7660 Reviewed-by: Venky Shankar <vshankar@redhat.com> Tested-by: Venky Shankar <vshankar@redhat.com>
-rw-r--r--geo-replication/syncdaemon/libgfchangelog.py5
-rw-r--r--geo-replication/syncdaemon/master.py10
-rw-r--r--geo-replication/syncdaemon/resource.py11
3 files changed, 14 insertions, 12 deletions
diff --git a/geo-replication/syncdaemon/libgfchangelog.py b/geo-replication/syncdaemon/libgfchangelog.py
index 099867a511a..e6bfbefd0a6 100644
--- a/geo-replication/syncdaemon/libgfchangelog.py
+++ b/geo-replication/syncdaemon/libgfchangelog.py
@@ -85,8 +85,9 @@ class Changes(object):
return ret
@classmethod
- def cl_history_changelog(cls, changelog_path, start, end):
- ret = cls._get_api('gf_history_changelog')(changelog_path, start, end)
+ def cl_history_changelog(cls, changelog_path, start, end, num_parallel):
+ ret = cls._get_api('gf_history_changelog')(changelog_path, start, end,
+ num_parallel)
if ret == -1:
cls.raise_changelog_err()
diff --git a/geo-replication/syncdaemon/master.py b/geo-replication/syncdaemon/master.py
index 3047c99050e..b6a7c894814 100644
--- a/geo-replication/syncdaemon/master.py
+++ b/geo-replication/syncdaemon/master.py
@@ -1128,19 +1128,12 @@ class GMasterChangelogMixin(GMasterCommon):
self.process(changes)
def register(self):
- (workdir, logfile) = self.setup_working_dir()
self.sleep_interval = int(gconf.change_interval)
self.changelog_done_func = self.master.server.changelog_done
- # register with the changelog library
- # 9 == log level (DEBUG)
- # 5 == connection retries
- self.master.server.changelog_register(gconf.local_path,
- workdir, logfile, 9, 5)
class GMasterChangeloghistoryMixin(GMasterChangelogMixin):
def register(self):
- super(GMasterChangeloghistoryMixin, self).register()
self.changelog_register_time = int(time.time())
self.changelog_done_func = self.master.server.history_changelog_done
@@ -1166,7 +1159,8 @@ class GMasterChangeloghistoryMixin(GMasterChangelogMixin):
".glusterfs/changelogs")
ts = self.master.server.history_changelog(changelog_path,
purge_time[0],
- self.changelog_register_time)
+ self.changelog_register_time,
+ int(gconf.sync_jobs))
# scan followed by getchanges till scan returns zero.
# history_changelog_scan() is blocking call, till it gets the number
diff --git a/geo-replication/syncdaemon/resource.py b/geo-replication/syncdaemon/resource.py
index f0f6692cae2..185722f5df0 100644
--- a/geo-replication/syncdaemon/resource.py
+++ b/geo-replication/syncdaemon/resource.py
@@ -685,8 +685,9 @@ class Server(object):
Changes.cl_done(clfile)
@classmethod
- def history_changelog(cls, changelog_path, start, end):
- return Changes.cl_history_changelog(changelog_path, start, end)
+ def history_changelog(cls, changelog_path, start, end, num_parallel):
+ return Changes.cl_history_changelog(changelog_path, start, end,
+ num_parallel)
@classmethod
def history_changelog_scan(cls):
@@ -1312,6 +1313,12 @@ class GLUSTER(AbstractUrl, SlaveLocal, SlaveRemote):
# g3 ==> changelog History
g1.register()
try:
+ (workdir, logfile) = g2.setup_working_dir()
+ # register with the changelog library
+ # 9 == log level (DEBUG)
+ # 5 == connection retries
+ brickserver.changelog_register(gconf.local_path,
+ workdir, logfile, 9, 5)
g2.register()
g3.register()
except ChangelogException as e: