summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornik-redhat <nladha@redhat.com>2020-08-26 15:08:56 +0530
committernik-redhat <nladha@redhat.com>2020-09-04 19:20:44 +0530
commit17c7b12cf2840239bbe905ef10b65c7de46c5425 (patch)
treeef2cb7aeaef388e770d2a30d59c93138675f2ad7
parent0d63dff4be92380f9b67f2b17397a02b8980abe1 (diff)
glusterd: cksum mismatch on upgrading to latest gluster
Issue: In gluster versions less than 7, the checksums were calculated whether or not the quota is enabled or not, and that cksum value was also getting stored in the quota.cksum file. But, from gluster 7 version onwards cksum was calculated only if the quota is enabled. Due to this, the cksums in quota.cksum files differ after upgrading. Fix: Added a check to see if the OP_VERSION is less than 7 then, follow the previous method otherwise, move as per the latest changes for cksum calculation. This changes for the cksum calculation was done in this commit : https://github.com/gluster/glusterfs/commit/3b5eb592f5 Updates: #1332 Change-Id: I7a95e5e5f4d4be4983fb7816225bf9187856c003 Signed-off-by: nik-redhat <nladha@redhat.com> (cherry picked from commit 865cca1190e233381f975ff36118f46e29477dcf) Signed-off-by: nik-redhat <nladha@redhat.com>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 3ec71621acd..eecc2a1d41b 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -2721,6 +2721,15 @@ glusterd_volume_compute_cksum(glusterd_volinfo_t *volinfo, char *cksum_path,
ret = -1;
goto out;
}
+ } else if (priv->op_version < GD_OP_VERSION_7_0) {
+ ret = get_checksum_for_path(filepath, &cksum, priv->op_version);
+ if (ret) {
+ gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_CKSUM_GET_FAIL,
+ "unable to get "
+ "checksum for path: %s",
+ filepath);
+ goto out;
+ }
}
ret = get_checksum_for_file(fd, &cksum, priv->op_version);