summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-self-heal-data.c
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2011-12-26 10:10:13 +0530
committerVijay Bellur <vijay@gluster.com>2011-12-27 02:18:05 -0800
commit8543529f381d16349662269342d55ab67a1a4582 (patch)
treecc459739a416fc86dcfefc3a9677d2de631ca0ea /xlators/cluster/afr/src/afr-self-heal-data.c
parenta0c5efcf2cb2be5c9736c75af7a6d8754a101bf5 (diff)
cluster/afr: Handle split-brain/all-fool xattrs for directory
In case of split-brain/all-fool xattrs perform conservative merge. Don't treat ignorant subvol as fool. Change-Id: I6ddf89949cd5793c2abbead7c47f091e8461f1d4 BUG: 765528 Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Reviewed-on: http://review.gluster.com/2521 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.c11
1 files changed, 8 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 431cef492..83920c081 100644
--- a/xlators/cluster/afr/src/afr-self-heal-data.c
+++ b/xlators/cluster/afr/src/afr-self-heal-data.c
@@ -662,7 +662,7 @@ afr_sh_data_fix (call_frame_t *frame, xlator_t *this)
frame->root->lk_owner);
nsources = afr_build_sources (this, sh->xattr, sh->buf, sh->pending_matrix,
sh->sources, sh->success_children,
- AFR_DATA_TRANSACTION);
+ AFR_DATA_TRANSACTION, NULL, _gf_false);
if (nsources == 0) {
gf_log (this->name, GF_LOG_DEBUG,
"No self-heal needed for %s",
@@ -806,6 +806,7 @@ afr_lookup_select_read_child_by_txn_type (xlator_t *this, afr_local_t *local,
int32_t nsources = 0;
int32_t prev_read_child = -1;
int32_t config_read_child = -1;
+ int32_t subvol_status = 0;
priv = this->private;
bufs = local->cont.lookup.bufs;
@@ -819,7 +820,11 @@ afr_lookup_select_read_child_by_txn_type (xlator_t *this, afr_local_t *local,
memset (sources, 0, sizeof (*sources) * priv->child_count);
nsources = afr_build_sources (this, xattr, bufs, pending_matrix,
- sources, success_children, txn_type);
+ sources, success_children, txn_type,
+ &subvol_status, _gf_false);
+ if (subvol_status & SPLIT_BRAIN)
+ gf_log (this->name, GF_LOG_WARNING, "%s: Possible split-brain",
+ local->loc.path);
if (nsources < 0)
goto out;
@@ -991,7 +996,7 @@ afr_post_sh_data_fxattrop_cbk (call_frame_t *frame, void *cookie,
(void) afr_build_sources (this, sh->xattr, NULL,
sh->pending_matrix,
sh->sources, sh->success_children,
- AFR_DATA_TRANSACTION);
+ AFR_DATA_TRANSACTION, NULL, _gf_false);
ret = afr_sh_inode_set_read_ctx (sh, this);
if (ret)
afr_sh_data_fail (frame, this);