From e28ac41c5ffc7b87f09b5bf2fe7f43cd4d4a5af5 Mon Sep 17 00:00:00 2001 From: Anuradha Date: Fri, 5 Jun 2015 16:46:39 +0530 Subject: glusterd/ afr : set afr pending xattrs on replace brick Backport of: http://review.gluster.org/10076/ This patch is part one change to prevent data loss in a replicate volume on doing a replace-brick commit force operation. Problem: After doing replace-brick commit force, there is a chance that self heal happens from the replaced (sink) brick rather than the source brick leading to data loss. Solution: During the commit phase of replace brick, after old brick is brought down, create a temporary mount and perform setfattr operation (on virtual xattr) indicating AFR to mark the replaced brick as sink. As a part of this change replace-brick command is being changed to use mgmt_v3 framework rather than op-state-machine framework. Many thanks to Krishnan Parthasarathi for helping me out on this. Change-Id: If0d51b5b3cef5b34d5672d46ea12eaa9d35fd894 BUG: 1232173 Signed-off-by: Anuradha Talur Reviewed-on: http://review.gluster.org/11253 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Ravishankar N Reviewed-by: Pranith Kumar Karampuri --- libglusterfs/src/glusterfs.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libglusterfs') diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h index 4a0b9df4be4..62f08fb08db 100644 --- a/libglusterfs/src/glusterfs.h +++ b/libglusterfs/src/glusterfs.h @@ -170,6 +170,8 @@ #define GF_AFR_SBRAIN_CHOICE "replica.split-brain-choice" #define GF_AFR_SPB_CHOICE_TIMEOUT "replica.split-brain-choice-timeout" #define GF_AFR_SBRAIN_RESOLVE "replica.split-brain-heal-finalize" +#define GF_AFR_REPLACE_BRICK "trusted.replace-brick" +#define GF_AFR_DIRTY "trusted.afr.dirty" #define GF_GFIDLESS_LOOKUP "gfidless-lookup" /* replace-brick and pump related internal xattrs */ -- cgit