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