From 550148f3bb3505335909cde9e937c2362a1e67e3 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Fri, 2 Sep 2011 08:50:48 +0530 Subject: cluster/afr: Make data selfheal trigger to be configurable. By default, lookup triggers data self-heal but that is not the preferred way of operating replicated volumes. We would like the data self heals to be triggered in open instead. Number of back-ground self-heals allowed is 16 and lookups block until self-heal is completed. We want to prevent blocking in fops. We can not make lookups independent of self-heal frames because when there are gfid conflicts the decision of which file is correct is determined in self-heal phase. So in afr, lookup self-heal is going to guarantee name space consistency and open/fd fops will take responsibility for data consistency, these are non blocking. The user needs to set the option cluster.data-self-heal "open" for this behavior. Change-Id: If9463cdb9ebac114708558ec13bbca0270acd659 BUG: 3503 Reviewed-on: http://review.gluster.com/334 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/cluster/afr/src/afr.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'xlators/cluster/afr/src/afr.c') diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c index 46091523e..044213e07 100644 --- a/xlators/cluster/afr/src/afr.c +++ b/xlators/cluster/afr/src/afr.c @@ -115,7 +115,7 @@ reconfigure (xlator_t *this, dict_t *options) GF_OPTION_RECONF ("metadata-self-heal", priv->metadata_self_heal, options, bool, out); - GF_OPTION_RECONF ("data-self-heal", priv->data_self_heal, options, bool, + GF_OPTION_RECONF ("data-self-heal", priv->data_self_heal, options, str, out); GF_OPTION_RECONF ("entry-self-heal", priv->entry_self_heal, options, @@ -227,7 +227,7 @@ init (xlator_t *this) GF_OPTION_INIT ("background-self-heal-count", priv->background_self_heal_count, uint32, out); - GF_OPTION_INIT ("data-self-heal", priv->data_self_heal, bool, out); + GF_OPTION_INIT ("data-self-heal", priv->data_self_heal, str, out); GF_OPTION_INIT ("data-self-heal-algorithm", priv->data_self_heal_algorithm, str, out); @@ -414,7 +414,11 @@ struct volume_options options[] = { .default_value = "16", }, { .key = {"data-self-heal"}, - .type = GF_OPTION_TYPE_BOOL, + .type = GF_OPTION_TYPE_STR, + .default_value = "", + .value = {"1", "on", "yes", "true", "enable", + "0", "off", "no", "false", "disable", + "open"}, .default_value = "on", }, { .key = {"data-self-heal-algorithm"}, -- cgit