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 --- xlators/mgmt/glusterd/src/glusterd-mgmt.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'xlators/mgmt/glusterd/src/glusterd-mgmt.h') diff --git a/xlators/mgmt/glusterd/src/glusterd-mgmt.h b/xlators/mgmt/glusterd/src/glusterd-mgmt.h index a9812a4ac52..b49137f383b 100644 --- a/xlators/mgmt/glusterd/src/glusterd-mgmt.h +++ b/xlators/mgmt/glusterd/src/glusterd-mgmt.h @@ -50,4 +50,33 @@ glusterd_snap_pre_validate_use_rsp_dict (dict_t *dst, dict_t *src); int32_t glusterd_set_barrier_value (dict_t *dict, char *option); +int + +glusterd_mgmt_v3_initiate_lockdown (glusterd_op_t op, dict_t *dict, + char **op_errstr, uint32_t *op_errno, + gf_boolean_t *is_acquired, + uint32_t txn_generation); + +int +glusterd_mgmt_v3_build_payload (dict_t **req, char **op_errstr, dict_t *dict, + glusterd_op_t op); + +int +glusterd_mgmt_v3_pre_validate (glusterd_op_t op, dict_t *req_dict, + char **op_errstr, uint32_t *op_errno, + uint32_t txn_generation); + +int +glusterd_mgmt_v3_commit (glusterd_op_t op, dict_t *op_ctx, dict_t *req_dict, + char **op_errstr, uint32_t *op_errno, + uint32_t txn_generation); + +int +glusterd_mgmt_v3_release_peer_locks (glusterd_op_t op, dict_t *dict, + int32_t op_ret, char **op_errstr, + gf_boolean_t is_acquired, + uint32_t txn_generation); + +int32_t +glusterd_multiple_mgmt_v3_unlock (dict_t *dict, uuid_t uuid); #endif /* _GLUSTERD_MGMT_H_ */ -- cgit