From 1a5e8518d9abefb8e5c4fbc666a1939718fd6216 Mon Sep 17 00:00:00 2001 From: anand Date: Wed, 18 Nov 2015 16:13:46 +0530 Subject: [PATCH 17/86] glusterd: fix info file checksum mismatch during upgrade peers are moving rejected state when upgrading from RHS2.1 to RHGS3.1.2 due to checksum mismatch. Label: DOWNSTREAM ONLY Change-Id: Ifea6b7dfe8477c7f17eefc5ca87ced58aaa21c84 Signed-off-by: anand Reviewed-on: https://code.engineering.redhat.com/gerrit/61774 Reviewed-by: Atin Mukherjee Tested-by: Atin Mukherjee --- xlators/mgmt/glusterd/src/glusterd-store.c | 21 ++++++++++++--------- 1 files changed, 12 insertions(+), 9 deletions(-) diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c index 1d8efca..70627f3 100644 --- a/xlators/mgmt/glusterd/src/glusterd-store.c +++ b/xlators/mgmt/glusterd/src/glusterd-store.c @@ -1007,16 +1007,19 @@ glusterd_volume_exclude_options_write (int fd, glusterd_volinfo_t *volinfo) goto out; } - snprintf (buf, sizeof (buf), "%d", volinfo->op_version); - ret = gf_store_save_value (fd, GLUSTERD_STORE_KEY_VOL_OP_VERSION, buf); - if (ret) - goto out; + if (conf->op_version >= GD_OP_VERSION_RHS_3_0) { + snprintf (buf, sizeof (buf), "%d", volinfo->op_version); + ret = gf_store_save_value (fd, GLUSTERD_STORE_KEY_VOL_OP_VERSION, buf); + if (ret) + goto out; + + snprintf (buf, sizeof (buf), "%d", volinfo->client_op_version); + ret = gf_store_save_value (fd, GLUSTERD_STORE_KEY_VOL_CLIENT_OP_VERSION, + buf); + if (ret) + goto out; + } - snprintf (buf, sizeof (buf), "%d", volinfo->client_op_version); - ret = gf_store_save_value (fd, GLUSTERD_STORE_KEY_VOL_CLIENT_OP_VERSION, - buf); - if (ret) - goto out; if (volinfo->caps) { snprintf (buf, sizeof (buf), "%d", volinfo->caps); ret = gf_store_save_value (fd, GLUSTERD_STORE_KEY_VOL_CAPS, -- 1.7.1