From 545a7ce6762a1b3a7b989b43a9d18b5b1b299df0 Mon Sep 17 00:00:00 2001 From: Susant Palai Date: Thu, 18 Jan 2018 13:06:12 +0530 Subject: cluster/dht: avoid overwriting client writes during migration For more details on this issue see https://github.com/gluster/glusterfs/issues/308 Solution: This is a restrictive solution where a file will not be migrated if a client writes to it during the migration. This does not check if the writes from the rebalance and the client actually do overlap. If dht_writev_cbk finds that the file is being migrated (PHASE1) it will set an xattr on the destination file indicating the file was updated by a non-rebalance client. Rebalance checks if any other client has written to the dst file and aborts the file migration if it finds the xattr. updates gluster/glusterfs#308 Change-Id: I73aec28bc9dbb8da57c7425ec88c6b6af0fbc9dd Signed-off-by: Susant Palai Signed-off-by: Raghavendra G Signed-off-by: N Balachandran --- libglusterfs/src/globals.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libglusterfs') diff --git a/libglusterfs/src/globals.h b/libglusterfs/src/globals.h index 315eec1e667..487facd9183 100644 --- a/libglusterfs/src/globals.h +++ b/libglusterfs/src/globals.h @@ -19,6 +19,11 @@ #define GD_MIN_OP_VERSION_KEY "minimum-operating-version" #define GD_MAX_OP_VERSION_KEY "maximum-operating-version" +#define GF_PROTECT_FROM_EXTERNAL_WRITES "trusted.glusterfs.protect.writes" +#define GF_AVOID_OVERWRITE "glusterfs.avoid.overwrite" +#define GF_CLEAN_WRITE_PROTECTION "glusterfs.clean.writexattr" + + /* Gluster versions - OP-VERSION mapping * * 3.3.x - 1 -- cgit