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