summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-self-heal-data.c
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2012-04-02 21:46:42 +0530
committerVijay Bellur <vijay@gluster.com>2012-05-22 04:29:15 -0700
commita289a11b0f7892e62e4b31041c852c4a98fa4c25 (patch)
tree619494b9cf397f031002ea4634da21cbe8b39839 /xlators/cluster/afr/src/afr-self-heal-data.c
parent64156e71bc71d7100b0e81bbe0702740b37c3ffb (diff)
cluster/afr: Perform conservative merge on dir with xattr split-brain
BUG: 765587 Change-Id: Ifa7a4eae37b0c887a913c8c59d83a679c96c345b Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Reviewed-on: http://review.gluster.com/3396 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-data.c')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-data.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-data.c b/xlators/cluster/afr/src/afr-self-heal-data.c
index e38b78039..78798cba1 100644
--- a/xlators/cluster/afr/src/afr-self-heal-data.c
+++ b/xlators/cluster/afr/src/afr-self-heal-data.c
@@ -824,12 +824,23 @@ afr_lookup_select_read_child_by_txn_type (xlator_t *this, afr_local_t *local,
if (subvol_status & SPLIT_BRAIN) {
gf_log (this->name, GF_LOG_WARNING, "%s: Possible split-brain",
local->loc.path);
- if (txn_type == AFR_DATA_TRANSACTION) {
- //succeed lookup fail open
- afr_set_split_brain (this, local->cont.lookup.inode,
+ switch (txn_type) {
+ case AFR_DATA_TRANSACTION:
+ afr_set_split_brain (this,
+ local->cont.lookup.inode,
_gf_true);
nsources = 1;
sources[success_children[0]] = 1;
+ break;
+ case AFR_ENTRY_TRANSACTION:
+ read_child = afr_get_no_xattr_dir_read_child (this,
+ success_children,
+ bufs);
+ sources[read_child] = 1;
+ nsources = 1;
+ break;
+ default:
+ break;
}
}
if (nsources < 0)