summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd
diff options
context:
space:
mode:
authorMohammed Rafi KC <rkavunga@redhat.com>2015-03-23 14:25:49 +0530
committerKrishnan Parthasarathi <kparthas@redhat.com>2015-04-10 08:21:02 +0000
commita0750e3a921f06c2fb84a7ea1556679ec0f1ce09 (patch)
treea0de0d179d29f582d3b05368555659e3df5e8ce2 /xlators/mgmt/glusterd
parent7a999ac6b1d0dad7e0b6ab6ee0868e97f76fada6 (diff)
snapshot:Fetching wrong peer data during probe
When adding a new friend to the cluster, the snap volfile are populating with wrong information for reconfigured option. For snap volumes, reconfigured data's are filling from the regular volumes data. This is because wrong dictionary key is used here. Change-Id: I659ebdc48c33419a2b825f26ce1f174abc8ea7dd BUG: 1204636 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/9969 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Avra Sengupta <asengupt@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 468b3c0af45..9ee97cf87b5 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -2744,7 +2744,8 @@ glusterd_spawn_daemons (void *opaque)
int32_t
glusterd_import_friend_volume_opts (dict_t *peer_data, int count,
- glusterd_volinfo_t *volinfo)
+ glusterd_volinfo_t *volinfo,
+ char *prefix)
{
char key[512] = {0,};
int32_t ret = -1;
@@ -2756,7 +2757,7 @@ glusterd_import_friend_volume_opts (dict_t *peer_data, int count,
GF_ASSERT (volinfo);
memset (key, 0, sizeof (key));
- snprintf (key, sizeof (key), "volume%d.opt-count", count);
+ snprintf (key, sizeof (key), "%s%d.opt-count", prefix, count);
ret = dict_get_int32 (peer_data, key, &opt_count);
if (ret) {
snprintf (msg, sizeof (msg), "Volume option count not "
@@ -2764,7 +2765,7 @@ glusterd_import_friend_volume_opts (dict_t *peer_data, int count,
goto out;
}
- snprintf (volume_prefix, sizeof (volume_prefix), "volume%d", count);
+ snprintf (volume_prefix, sizeof (volume_prefix), "%s%d", prefix, count);
ret = import_prdict_dict (peer_data, volinfo->dict, "key", "value",
opt_count, volume_prefix);
if (ret) {
@@ -2774,7 +2775,7 @@ glusterd_import_friend_volume_opts (dict_t *peer_data, int count,
}
memset (key, 0, sizeof (key));
- snprintf (key, sizeof (key), "volume%d.gsync-count", count);
+ snprintf (key, sizeof (key), "%s%d.gsync-count", prefix, count);
ret = dict_get_int32 (peer_data, key, &opt_count);
if (ret) {
snprintf (msg, sizeof (msg), "Gsync count not "
@@ -3366,7 +3367,7 @@ glusterd_import_volinfo (dict_t *peer_data, int count,
}
ret = glusterd_import_friend_volume_opts (peer_data, count,
- new_volinfo);
+ new_volinfo, prefix);
if (ret)
goto out;