From d06692d1deec425f74747e2c463e56f7eca981c8 Mon Sep 17 00:00:00 2001 From: Anuradha Date: Wed, 25 Feb 2015 15:09:28 +0530 Subject: cluster/afr : enable inspection & resolution of files in split-brain Part 2/2 patch to enable users analyze and resolve split-brain. This patch enables : 1) Users to inspect the files in data and metadata split-brain. 2) Resolve the split-brain. Both using a series of setfattr commands. Consider a volume "test" with 2 bricks. 1) To inspect a file f1: setfattr -n replica.split-brain-choice -v test-client-0 f1 After the execution of this command, if no read_subvol is found, reads will be served from test-client-0 (corresponding to brick-0). 2) To resolve split-brain : setfattr -n replica.split-brain-heal-finalize -v test-client-0 f1 Execution of this command will lead to the resolution of data and metadata split-brain with subvol mentioned in the command (test-client-0 here) as the source and the rest as sink. Change-Id: Ia20f3ee5abd3119e3d54fcc599f1e55ac65fd179 BUG: 1191396 Signed-off-by: Anuradha Reviewed-on: http://review.gluster.org/9743 Reviewed-by: Pranith Kumar Karampuri Tested-by: Gluster Build System --- xlators/cluster/afr/src/afr.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'xlators/cluster/afr/src/afr.h') diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h index d7d15c69845..0885b582d77 100644 --- a/xlators/cluster/afr/src/afr.h +++ b/xlators/cluster/afr/src/afr.h @@ -733,6 +733,11 @@ typedef struct _afr_local { } afr_local_t; +typedef struct _afr_inode_ctx { + uint64_t read_subvol; + int spb_choice; +} afr_inode_ctx_t; + /* did a call fail due to a child failing? */ #define child_went_down(op_ret, op_errno) (((op_ret) < 0) && \ ((op_errno == ENOTCONN) || \ @@ -1026,4 +1031,13 @@ afr_heal_splitbrain_file(call_frame_t *frame, xlator_t *this, loc_t *loc); int afr_get_split_brain_status (call_frame_t *frame, xlator_t *this, loc_t *loc); + +int +afr_inode_split_brain_choice_set (inode_t *inode, xlator_t *this, + int spb_choice); +int +afr_inode_split_brain_choice_get (inode_t *inode, xlator_t *this, + int *spb_choice); +int +afr_get_child_index_from_name (xlator_t *this, char *name); #endif /* __AFR_H__ */ -- cgit