diff options
author | Niels de Vos <ndevos@redhat.com> | 2012-11-29 23:05:17 +0100 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2012-12-17 12:41:03 -0500 |
commit | 3dddca7eeb15c017a268c849ea6287f6e3a838bb (patch) | |
tree | 95343d0685a5cfd0fb761f23f966c7e9700b1d73 /xlators/features/marker | |
parent | b793589e856b866f3cab54227237f3548267e9bc (diff) |
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 <csaba@redhat.com>
> Reviewed-on: http://review.gluster.org/4248
> Reviewed-by: Niels de Vos <ndevos@redhat.com>
> Tested-by: Christos Triantafyllidis <ctrianta@redhat.com>
> Reviewed-by: Christos Triantafyllidis <ctrianta@redhat.com>
> Reviewed-by: Anand Avati <avati@redhat.com>
Change-Id: I83b2cb7f78cf8613b78d3c8ff8e7b3828050cfc3
BUG: 881736
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/1929
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/features/marker')
-rw-r--r-- | xlators/features/marker/utils/syncdaemon/gsyncd.py | 21 |
1 files 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'] |