diff options
author | Kotresh HR <khiremat@redhat.com> | 2017-04-20 07:18:52 -0400 |
---|---|---|
committer | Raghavendra Talur <rtalur@redhat.com> | 2017-05-02 09:24:37 +0000 |
commit | a00ebebdb68bfe97cca263d0327889abf37b3d19 (patch) | |
tree | ba4c1a1e685a0185d696e83b9ee0862a87546afd /xlators/mgmt | |
parent | 05dca214324ea252dff1403e2571f6811b91f550 (diff) |
glusterd/geo-rep: Fix snapshot create in geo-rep setup
glusterd persists geo-rep sessions in glusterd
info file which is represented by dictionary
'volinfo->gsync_slaves' in memory. Glusterd also
maintains in memory active geo-rep sessions in
dictionary 'volinfo->gsync_active_slaves' whose key
is "<slave_url>::<slavhost>".
When glusterd is restarted while the geo-rep sessions
are active, it builds the 'volinfo->gsync_active_slaves'
from persisted glusterd info file. Since slave volume
uuid is added to "voinfo->gsync_slaves" with the commit
"http://review.gluster.org/13111", it builds it with key
"<slave_url>::<slavehost>:<slavevol_uuid>" which is
wrong. So during snapshot pre-validation which checks
whether geo-rep is active or not, it always says it is
ACTIVE, as geo-rep stop would not deleted this key.
Fixed the same in this patch.
> BUG: 1443977
> Signed-off-by: Kotresh HR <khiremat@redhat.com>
> Reviewed-on: https://review.gluster.org/17093
> Smoke: Gluster Build System <jenkins@build.gluster.org>
> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
(cherry picked from commit f071d2a285ea4802fe8f328f9f275180983fbbba)
Change-Id: I185178910b4b8a62e66aba406d88d12fabc5c122
BUG: 1445209
Signed-off-by: Kotresh HR <khiremat@redhat.com>
Reviewed-on: https://review.gluster.org/17108
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Aravinda VK <avishwan@redhat.com>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 79c398e3676..333be2e5c0c 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -5543,7 +5543,7 @@ _local_gsyncd_start (dict_t *this, char *key, data_t *value, void *data) glusterd_conf_t *priv = NULL; gf_boolean_t is_template_in_use = _gf_false; gf_boolean_t is_paused = _gf_false; - char *key1 = NULL; + char key1[1024] = {0,}; xlator_t *this1 = NULL; this1 = THIS; @@ -5638,9 +5638,8 @@ _local_gsyncd_start (dict_t *this, char *key, data_t *value, void *data) goto out; } - /* Move the pointer two characters ahead to surpass '//' */ - if ((key1 = strchr (slave, '/'))) - key1 = key1 + 2; + /* Form key1 which is "<user@><slave_host>::<slavevol>" */ + snprintf (key1, sizeof (key1), "%s::%s", slave_url, slave_vol); /* Looks for the last status, to find if the session was running * when the node went down. If the session was just created or |