summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranand <anekkunt@redhat.com>2015-10-29 21:36:57 +0530
committerKaushal M <kaushal@redhat.com>2015-10-31 23:52:36 -0700
commitd29dd0747dbb2e7383867c97cbbaa8c41851db78 (patch)
tree97cd2f7f8ac03a8b4e17a0d9c0187b5eb9684142
parentd1b488fbf9b0b985657297f842819785b7599e5d (diff)
glusterd: fix info file checksum mismatch during upgrade
issue: probing a new node(>=3.6) from 3.5 cluster is moving the peer to rejected state. fix: Disperse vol support is added from 3.6 release, so write disperse fields (disperse_count=0 and redundancy_count=0) in vol info file only if cluster version supported. Change-Id: I11d5e2e337b9bbaddc8e52ca7295ba481beb1132 BUG: 1276423 Signed-off-by: anand <anekkunt@redhat.com> Reviewed-on: http://review.gluster.org/12464 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaushal M <kaushal@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-store.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c
index 75131b28cbf..b9991b36c68 100644
--- a/xlators/mgmt/glusterd/src/glusterd-store.c
+++ b/xlators/mgmt/glusterd/src/glusterd-store.c
@@ -905,11 +905,14 @@ glusterd_volume_exclude_options_write (int fd, glusterd_volinfo_t *volinfo)
char buf[PATH_MAX] = "";
int32_t ret = -1;
xlator_t *this = NULL;
+ glusterd_conf_t *conf = NULL;
this = THIS;
GF_ASSERT (this);
GF_ASSERT (fd > 0);
GF_ASSERT (volinfo);
+ conf = this->private;
+ GF_VALIDATE_OR_GOTO (this->name, (conf != NULL), out);
snprintf (buf, sizeof (buf), "%d", volinfo->type);
ret = gf_store_save_value (fd, GLUSTERD_STORE_KEY_VOL_TYPE, buf);
@@ -942,17 +945,19 @@ glusterd_volume_exclude_options_write (int fd, glusterd_volinfo_t *volinfo)
if (ret)
goto out;
- snprintf (buf, sizeof (buf), "%d", volinfo->disperse_count);
- ret = gf_store_save_value (fd, GLUSTERD_STORE_KEY_VOL_DISPERSE_CNT,
- buf);
- if (ret)
- goto out;
+ if (conf->op_version >= GD_OP_VERSION_3_6_0) {
+ snprintf (buf, sizeof (buf), "%d", volinfo->disperse_count);
+ ret = gf_store_save_value (fd, GLUSTERD_STORE_KEY_VOL_DISPERSE_CNT,
+ buf);
+ if (ret)
+ goto out;
- snprintf (buf, sizeof (buf), "%d", volinfo->redundancy_count);
- ret = gf_store_save_value (fd, GLUSTERD_STORE_KEY_VOL_REDUNDANCY_CNT,
- buf);
- if (ret)
- goto out;
+ snprintf (buf, sizeof (buf), "%d", volinfo->redundancy_count);
+ ret = gf_store_save_value (fd, GLUSTERD_STORE_KEY_VOL_REDUNDANCY_CNT,
+ buf);
+ if (ret)
+ goto out;
+ }
snprintf (buf, sizeof (buf), "%d", volinfo->version);
ret = gf_store_save_value (fd, GLUSTERD_STORE_KEY_VOL_VERSION, buf);