diff options
author | Aravinda VK <avishwan@redhat.com> | 2014-08-08 15:06:11 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-08-19 23:27:26 -0700 |
commit | d0a3b4307e40b70d73faf4baed9fa0c930682894 (patch) | |
tree | 2710140e3a1b38eb0fed69be7b1dc0cd69e0a012 /geo-replication/syncdaemon/resource.py | |
parent | 9b5231e5c98b8cfa116838287c7a14042702795f (diff) |
geo-rep: Fixing issue with xsync upper limit
While identifying the file/dir to sync, xtime of the file was compared
with xsync_upper_limit as `xtime < xsync_upper_limit` After the sync,
xtime of parent directory is updated as stime. With the upper limit
condition, stime is updated as MIN(xtime_parent, xsync_upper_limit)
With this files will get missed if `xtime_of_file == xsync_upper_limit`
With this patch xtime_of_file is compared as
xtime_of_file <= xsync_upper_limit
BUG: 1128093
Change-Id: I5022ce67ba503ed4621531a649a16fc06b2229d9
Signed-off-by: Aravinda VK <avishwan@redhat.com>
Reviewed-on: http://review.gluster.org/8439
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kotresh HR <khiremat@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'geo-replication/syncdaemon/resource.py')
-rw-r--r-- | geo-replication/syncdaemon/resource.py | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/geo-replication/syncdaemon/resource.py b/geo-replication/syncdaemon/resource.py index 09310c1f1aa..2a887daab15 100644 --- a/geo-replication/syncdaemon/resource.py +++ b/geo-replication/syncdaemon/resource.py @@ -1293,22 +1293,27 @@ class GLUSTER(AbstractUrl, SlaveLocal, SlaveRemote): try: workdir = g2.setup_working_dir() - # register with the changelog library - # 9 == log level (DEBUG) - # 5 == connection retries - changelog_agent.register(gconf.local_path, - workdir, gconf.changelog_log_file, - g2.CHANGELOG_LOG_LEVEL, - g2.CHANGELOG_CONN_RETRIES) + # Register only when change_detector is not set to + # xsync, else agent will generate changelog files + # in .processing directory of working dir + if gconf.change_detector != 'xsync': + # register with the changelog library + # 9 == log level (DEBUG) + # 5 == connection retries + changelog_agent.register(gconf.local_path, + workdir, gconf.changelog_log_file, + g2.CHANGELOG_LOG_LEVEL, + g2.CHANGELOG_CONN_RETRIES) + register_time = int(time.time()) g2.register(register_time, changelog_agent) g3.register(register_time, changelog_agent) except ChangelogException: changelog_register_failed = True - register_time = int(time.time()) + register_time = None logging.info("Changelog register failed, fallback to xsync") - g1.register(register_time) + g1.register() logging.info("Register time: %s" % register_time) # oneshot: Try to use changelog history api, if not # available switch to FS crawl @@ -1328,17 +1333,8 @@ class GLUSTER(AbstractUrl, SlaveLocal, SlaveRemote): logging.info('Partial history available, using xsync crawl' ' after consuming history ' 'till %s' % str(e)) - g1.crawlwrap(oneshot=True, no_stime_update=True) - - # Reset xsync upper limit. g2, g3 are changelog and history - # instances, but if change_detector is set to xsync then - # g1, g2, g3 will be xsync instances. - g1.xsync_upper_limit = None - if getattr(g2, "xsync_upper_limit", None) is not None: - g2.xsync_upper_limit = None - - if getattr(g3, "xsync_upper_limit", None) is not None: - g3.xsync_upper_limit = None + g1.crawlwrap(oneshot=True, no_stime_update=True, + register_time=register_time) # crawl loop: Try changelog crawl, if failed # switch to FS crawl |