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