summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authoranand <anekkunt@redhat.com>2015-10-29 21:36:57 +0530
committerRaghavendra Bhat <raghavendra@redhat.com>2015-11-18 04:43:27 -0800
commit50cde2853bd144ff19ac8b6ac06e993cfb734f63 (patch)
treefb515f606fbe2f991fb184aa889cad8f1be93308 /xlators
parent69b5471d138f3a947b9086ec8fec8fdf6eb44ff6 (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. Backport of: >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> >(cherry picked from commit d29dd0747dbb2e7383867c97cbbaa8c41851db78) Change-Id: I8351457d15e76936851128eb8609746ae87d5aa8 BUG: 1277822 Signed-off-by: anand <anekkunt@redhat.com> Reviewed-on: http://review.gluster.org/12501 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Diffstat (limited to 'xlators')
-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 1f31d196af2..ad20d0f3190 100644
--- a/xlators/mgmt/glusterd/src/glusterd-store.c
+++ b/xlators/mgmt/glusterd/src/glusterd-store.c
@@ -818,11 +818,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);
@@ -855,17 +858,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);