From d331c3196392dd6cf857b79388780bf03b802392 Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Fri, 20 Mar 2015 03:13:27 +0530 Subject: geo-rep: Use gfchangelog context init API With the RPC based changes to {libgf}changelog, changelog_init is required before changelog_register. Change-Id: Id125b2bd2e51aaaffa22ecab463dfb739c50d83c Signed-off-by: Venky Shankar BUG: 1170075 Reviewed-on: http://review.gluster.org/9993 Reviewed-by: Saravanakumar Arumugam Tested-by: Saravanakumar Arumugam Tested-by: Gluster Build System --- geo-replication/syncdaemon/changelogagent.py | 3 +++ geo-replication/syncdaemon/libgfchangelog.py | 6 ++++++ geo-replication/syncdaemon/resource.py | 1 + 3 files changed, 10 insertions(+) (limited to 'geo-replication') diff --git a/geo-replication/syncdaemon/changelogagent.py b/geo-replication/syncdaemon/changelogagent.py index 54d82cefcd2..ad5f69cfb23 100644 --- a/geo-replication/syncdaemon/changelogagent.py +++ b/geo-replication/syncdaemon/changelogagent.py @@ -34,6 +34,9 @@ class Changelog(object): def version(self): return CHANGELOG_AGENT_SERVER_VERSION + def init(self): + return Changes.cl_init() + def register(self, cl_brick, cl_dir, cl_log, cl_level, retries=0): return Changes.cl_register(cl_brick, cl_dir, cl_log, cl_level, retries) diff --git a/geo-replication/syncdaemon/libgfchangelog.py b/geo-replication/syncdaemon/libgfchangelog.py index ac5ff05bdfa..1d580caf6e8 100644 --- a/geo-replication/syncdaemon/libgfchangelog.py +++ b/geo-replication/syncdaemon/libgfchangelog.py @@ -30,6 +30,12 @@ class Changes(object): def _get_api(cls, call): return getattr(cls.libgfc, call) + @classmethod + def cl_init(cls): + ret = cls._get_api('gf_changelog_init')(None) + if ret == -1: + cls.raise_changelog_err() + @classmethod def cl_register(cls, brick, path, log_file, log_level, retries=0): ret = cls._get_api('gf_changelog_register')(brick, path, diff --git a/geo-replication/syncdaemon/resource.py b/geo-replication/syncdaemon/resource.py index a4bec50b9ae..10c6406e283 100644 --- a/geo-replication/syncdaemon/resource.py +++ b/geo-replication/syncdaemon/resource.py @@ -1310,6 +1310,7 @@ class GLUSTER(AbstractUrl, SlaveLocal, SlaveRemote): # register with the changelog library # 9 == log level (DEBUG) # 5 == connection retries + changelog_agent.init() changelog_agent.register(gconf.local_path, workdir, gconf.changelog_log_file, g2.CHANGELOG_LOG_LEVEL, -- cgit