summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-self-heal-data.c
diff options
context:
space:
mode:
authorRavishankar N <ravishankar@redhat.com>2016-05-25 21:18:19 +0530
committerNiels de Vos <ndevos@redhat.com>2016-05-27 07:56:37 -0700
commit6f08b9f2b006a4eafaa176cfd792038eed7f6c98 (patch)
treedf77633dff8909d3a50d9d55524f216172ec2ed4 /xlators/cluster/afr/src/afr-self-heal-data.c
parentbc47e3255e35a2e02675d4d74e49138274b33f66 (diff)
afr: Automagic unsplit-brain by [ctime|mtime|size|majority]
Backport of http://review.gluster.org/#/c/14026/ Introduce cluster.favorite-child-policy which when enabled with [ctime|mtime|size|majority], automatically heals files that are in split-brian. The majority policy will not pick a source if there is no majority. The other three policies pick the first brick with a valid reply and non-zero ctime/mtime/size as source. Change-Id: I93623a914dce2839957fce87b514050e9d274d4c BUG: 1339639 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/14535 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@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.c8
1 files changed, 5 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 f4cd16c3a70..2a33e53764c 100644
--- a/xlators/cluster/afr/src/afr-self-heal-data.c
+++ b/xlators/cluster/afr/src/afr-self-heal-data.c
@@ -568,6 +568,7 @@ afr_mark_newest_file_as_source (xlator_t *this, unsigned char *sources,
static int
__afr_selfheal_data_finalize_source (call_frame_t *frame, xlator_t *this,
+ inode_t *inode,
unsigned char *sources,
unsigned char *sinks,
unsigned char *healed_sinks,
@@ -585,7 +586,7 @@ __afr_selfheal_data_finalize_source (call_frame_t *frame, xlator_t *this,
if ((AFR_CMP (locked_on, healed_sinks, priv->child_count) == 0)
|| !sources_count) {
/* split brain */
- source = afr_mark_split_brain_source_sinks (frame, this,
+ source = afr_mark_split_brain_source_sinks (frame, this, inode,
sources, sinks,
healed_sinks,
locked_on, replies,
@@ -663,8 +664,9 @@ __afr_selfheal_data_prepare (call_frame_t *frame, xlator_t *this,
*/
AFR_INTERSECT (healed_sinks, sinks, locked_on, priv->child_count);
- source = __afr_selfheal_data_finalize_source (frame, this, sources,
- sinks, healed_sinks,
+ source = __afr_selfheal_data_finalize_source (frame, this, inode,
+ sources, sinks,
+ healed_sinks,
locked_on, replies,
witness);
if (source < 0)