From 7964a320f380fa23727795ad6456ef0020fab35c Mon Sep 17 00:00:00 2001 From: Sanju Rakonde Date: Mon, 4 Mar 2019 16:53:01 +0530 Subject: 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 > (cherry picked from commit 073444b693b7a91c42963512e0fdafb57ad46670) Change-Id: I1508f000e8c9895588b6011b8b6cc0eda7102193 --- libglusterfs/src/glusterfs/common-utils.h | 4 ++-- libglusterfs/src/glusterfs/globals.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'libglusterfs/src/glusterfs') diff --git a/libglusterfs/src/glusterfs/common-utils.h b/libglusterfs/src/glusterfs/common-utils.h index f03d2c1049a..0e2ecc73af1 100644 --- a/libglusterfs/src/glusterfs/common-utils.h +++ b/libglusterfs/src/glusterfs/common-utils.h @@ -833,12 +833,12 @@ int gf_unlockfd(int fd); int -get_checksum_for_file(int fd, uint32_t *checksum); +get_checksum_for_file(int fd, uint32_t *checksum, int op_version); int log_base2(unsigned long x); int -get_checksum_for_path(char *path, uint32_t *checksum); +get_checksum_for_path(char *path, uint32_t *checksum, int op_version); int get_file_mtime(const char *path, time_t *stamp); char * diff --git a/libglusterfs/src/glusterfs/globals.h b/libglusterfs/src/glusterfs/globals.h index 9a2f5324afc..8d898c3abf4 100644 --- a/libglusterfs/src/glusterfs/globals.h +++ b/libglusterfs/src/glusterfs/globals.h @@ -111,6 +111,8 @@ #define GD_OP_VERSION_5_0 50000 /* Op-version for GlusterFS 5.0 */ +#define GD_OP_VERSION_5_4 50400 /* Op-version for GlusterFS 5.4 */ + #define GD_OP_VERSION_6_0 60000 /* Op-version for GlusterFS 6.0 */ #define GD_OP_VER_PERSISTENT_AFR_XATTRS GD_OP_VERSION_3_6_0 -- cgit