summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
diff options
context:
space:
mode:
authorSanju Rakonde <srakonde@redhat.com>2019-03-04 16:53:01 +0530
committerShyamsundar Ranganathan <srangana@redhat.com>2019-03-08 14:45:41 +0000
commit7964a320f380fa23727795ad6456ef0020fab35c (patch)
tree6424f8f13818a570720c3d29857e909d51e93a69 /xlators/mgmt
parent9c441360acc7288b75ba948726d2b7bc2e3d561c (diff)
core: make compute_cksum function op_version compatible
Problem: commit 5a152a changed the mechansim of computing the checksum. In heterogeneous cluster, peers are running into rejected state because we have different cksum computation mechansims in upgraded and non-upgraded nodes. Solution: add a check for op-version so that all the nodes in the cluster follow the same mechanism for computing the cksum. fixes: bz#1684029 > Change-Id: I1508f000e8c9895588b6011b8b6cc0eda7102193 > BUG: bz#1685120 > Signed-off-by: Sanju Rakonde <srakonde@redhat.com> > (cherry picked from commit 073444b693b7a91c42963512e0fdafb57ad46670) Change-Id: I1508f000e8c9895588b6011b8b6cc0eda7102193
Diffstat (limited to 'xlators/mgmt')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 1aa6947fbba..8bbd795c6ab 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -2806,7 +2806,7 @@ glusterd_volume_compute_cksum(glusterd_volinfo_t *volinfo, char *cksum_path,
cksum_path_final = is_quota_conf ? filepath : sort_filepath;
- ret = get_checksum_for_path(cksum_path_final, &cksum);
+ ret = get_checksum_for_path(cksum_path_final, &cksum, priv->op_version);
if (ret) {
gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_CKSUM_GET_FAIL,
"unable to get "
@@ -2823,7 +2823,7 @@ glusterd_volume_compute_cksum(glusterd_volinfo_t *volinfo, char *cksum_path,
}
}
- ret = get_checksum_for_file(fd, &cksum);
+ ret = get_checksum_for_file(fd, &cksum, priv->op_version);
if (ret)
goto out;
@@ -9383,12 +9383,16 @@ glusterd_check_files_identical(char *filename1, char *filename2,
uint32_t cksum1 = 0;
uint32_t cksum2 = 0;
xlator_t *this = NULL;
+ glusterd_conf_t *priv = NULL;
GF_ASSERT(filename1);
GF_ASSERT(filename2);
GF_ASSERT(identical);
this = THIS;
+ GF_VALIDATE_OR_GOTO("glusterd", this, out);
+ priv = this->private;
+ GF_VALIDATE_OR_GOTO(this->name, priv, out);
ret = sys_stat(filename1, &buf1);
@@ -9415,11 +9419,11 @@ glusterd_check_files_identical(char *filename1, char *filename2,
goto out;
}
- ret = get_checksum_for_path(filename1, &cksum1);
+ ret = get_checksum_for_path(filename1, &cksum1, priv->op_version);
if (ret)
goto out;
- ret = get_checksum_for_path(filename2, &cksum2);
+ ret = get_checksum_for_path(filename2, &cksum2, priv->op_version);
if (ret)
goto out;