diff options
| author | anand <anekkunt@redhat.com> | 2015-10-29 21:36:57 +0530 | 
|---|---|---|
| committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2015-11-01 02:46:02 -0800 | 
| commit | 6d4c63f12f2d87b4ed45ddd7c81825d013a9b43f (patch) | |
| tree | bad9c79c08607b5118371a62a2ec2bf9f1cab6ff | |
| parent | 264b2383f33105f827a6f9d99247b149896b4d05 (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>
BUG: 1276905
Change-Id: Ia601c068706a96621203132429d4417fa1c96f76
Signed-off-by: anand <anekkunt@redhat.com>
Reviewed-on: http://review.gluster.org/12477
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
| -rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-store.c | 25 | 
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 28f3cf994ed..fcc35b56db8 100644 --- a/xlators/mgmt/glusterd/src/glusterd-store.c +++ b/xlators/mgmt/glusterd/src/glusterd-store.c @@ -909,11 +909,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); @@ -946,17 +949,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);  | 
