From 3dddca7eeb15c017a268c849ea6287f6e3a838bb Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Thu, 29 Nov 2012 23:05:17 +0100 Subject: geo-rep / gsyncd: play nicely with peer multiplexing when setting a checkpoint From upstream commit 01217e4e16677b13c7febc66e4e4ca3f0025739b: > The gsyncd invocation that instruments the "geo-rep config" command is > multiplexed over peers to ensure the uniformity of configuration. > In general, that works well, but checkpoint setting is a special case, > because (unlike other instances of config-set) it is logged (as recording > of checkpoint events is part of the feature). > > Problem is that the path components leading to the log file are > created only on the original node, where gsyncd was started. > Therefore the logging attempt will fail on the other nodes. > > Fix: ignore if opening the logfile on behalf of checkpoint setting > fails with ENOENT. > > Change-Id: I677f3f081bf4b9e3ba4d25d58979d86931e6beb4 > BUG: 881997 > Signed-off-by: Csaba Henk > Reviewed-on: http://review.gluster.org/4248 > Reviewed-by: Niels de Vos > Tested-by: Christos Triantafyllidis > Reviewed-by: Christos Triantafyllidis > Reviewed-by: Anand Avati Change-Id: I83b2cb7f78cf8613b78d3c8ff8e7b3828050cfc3 BUG: 881736 Signed-off-by: Niels de Vos Reviewed-on: https://code.engineering.redhat.com/gerrit/1929 Reviewed-by: Vijay Bellur Tested-by: Vijay Bellur --- xlators/features/marker/utils/syncdaemon/gsyncd.py | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/xlators/features/marker/utils/syncdaemon/gsyncd.py b/xlators/features/marker/utils/syncdaemon/gsyncd.py index d7deca86c6b..efb0e3aa50a 100644 --- a/xlators/features/marker/utils/syncdaemon/gsyncd.py +++ b/xlators/features/marker/utils/syncdaemon/gsyncd.py @@ -358,11 +358,22 @@ def main_i(): gconf.log_level = lvl2 if checkpoint_change: - GLogger._gsyncd_loginit(log_file=gconf.log_file, label='conf') - if confdata.op == 'set': - logging.info('checkpoint %s set' % confdata.val) - elif confdata.op == 'del': - logging.info('checkpoint info was reset') + try: + GLogger._gsyncd_loginit(log_file=gconf.log_file, label='conf') + if confdata.op == 'set': + logging.info('checkpoint %s set' % confdata.val) + elif confdata.op == 'del': + logging.info('checkpoint info was reset') + except IOError: + if sys.exc_info()[1].errno == ENOENT: + # directory of log path is not present, + # which happens if we get here from + # a peer-multiplexed "config-set checkpoint" + # (as that directory is created only on the + # original node) + pass + else: + raise return go_daemon = rconf['go_daemon'] -- cgit