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
committerAnand Avati <avati@redhat.com>2012-05-18 20:16:40 -0700
commit24c1cbf4f7afd54a506a8265de9d22ce2b2e670f (patch)
treeb37ce7eb41799d80c01d3cb6369577a841d91753 /xlators/cluster/afr/src/afr-self-heal-data.c
parentee5e73bb00cbec6a4ddd398d7461edcbe6d21f87 (diff)
cluster/afr: Perform conservative merge on dir with xattr split-brain
Change-Id: I96d59ad239c2c5efee14dd4b01a10a3f565d491e BUG: 765587 Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Reviewed-on: http://review.gluster.com/3091 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Anand Avati <avati@redhat.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 e38b780398a..78798cba146 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)