summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-self-heal-common.c
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2011-09-02 08:50:48 +0530
committerAnand Avati <avati@gluster.com>2011-09-08 20:33:55 -0700
commit550148f3bb3505335909cde9e937c2362a1e67e3 (patch)
treec84f99aef6ab39f2d8c3fad8a6ae11e90fdd8014 /xlators/cluster/afr/src/afr-self-heal-common.c
parent4d2afaae2f3c42b710acf8c7ebdb4b50d502b813 (diff)
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 <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-common.c')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-common.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c
index 169d549d9c6..489a5bf4462 100644
--- a/xlators/cluster/afr/src/afr-self-heal-common.c
+++ b/xlators/cluster/afr/src/afr-self-heal-common.c
@@ -1924,11 +1924,11 @@ afr_local_t *afr_local_copy (afr_local_t *l, xlator_t *this)
shc->unwind = sh->unwind;
shc->gfid_sh_success_cbk = sh->gfid_sh_success_cbk;
- shc->need_missing_entry_self_heal = sh->need_missing_entry_self_heal;
- shc->need_gfid_self_heal = sh->need_gfid_self_heal;
- shc->need_data_self_heal = sh->need_data_self_heal;
- shc->need_metadata_self_heal = sh->need_metadata_self_heal;
- shc->need_entry_self_heal = sh->need_entry_self_heal;
+ shc->do_missing_entry_self_heal = sh->do_missing_entry_self_heal;
+ shc->do_gfid_self_heal = sh->do_gfid_self_heal;
+ shc->do_data_self_heal = sh->do_data_self_heal;
+ shc->do_metadata_self_heal = sh->do_metadata_self_heal;
+ shc->do_entry_self_heal = sh->do_entry_self_heal;
shc->forced_merge = sh->forced_merge;
shc->data_lock_held = sh->data_lock_held;
shc->background = sh->background;
@@ -2065,9 +2065,9 @@ afr_self_heal (call_frame_t *frame, xlator_t *this, inode_t *inode)
gf_log (this->name, GF_LOG_TRACE,
"performing self heal on %s (metadata=%d data=%d entry=%d)",
local->loc.path,
- local->self_heal.need_metadata_self_heal,
- local->self_heal.need_data_self_heal,
- local->self_heal.need_entry_self_heal);
+ local->self_heal.do_metadata_self_heal,
+ local->self_heal.do_data_self_heal,
+ local->self_heal.do_entry_self_heal);
sh_frame = copy_frame (frame);
afr_set_lk_owner (sh_frame, this);
@@ -2120,9 +2120,9 @@ afr_self_heal (call_frame_t *frame, xlator_t *this, inode_t *inode)
FRAME_SU_DO (sh_frame, afr_local_t);
- if (sh->need_missing_entry_self_heal) {
+ if (sh->do_missing_entry_self_heal) {
afr_self_heal_conflicting_entries (sh_frame, this);
- } else if (sh->need_gfid_self_heal) {
+ } else if (sh->do_gfid_self_heal) {
GF_ASSERT (!uuid_is_null (sh->sh_gfid_req));
afr_self_heal_gfids (sh_frame, this);
} else {
@@ -2143,24 +2143,24 @@ afr_self_heal_type_str_get (afr_self_heal_t *self_heal_p, char *str,
GF_ASSERT (str && (size > strlen (" missing-entry gfid "
"meta-data data entry")));
- if (self_heal_p->need_metadata_self_heal) {
+ if (self_heal_p->do_metadata_self_heal) {
snprintf (str, size, " meta-data");
}
- if (self_heal_p->need_data_self_heal) {
+ if (self_heal_p->do_data_self_heal) {
snprintf (str + strlen(str), size - strlen(str), " data");
}
- if (self_heal_p->need_entry_self_heal) {
+ if (self_heal_p->do_entry_self_heal) {
snprintf (str + strlen(str), size - strlen(str), " entry");
}
- if (self_heal_p->need_missing_entry_self_heal) {
+ if (self_heal_p->do_missing_entry_self_heal) {
snprintf (str + strlen(str), size - strlen(str),
" missing-entry");
}
- if (self_heal_p->need_gfid_self_heal) {
+ if (self_heal_p->do_gfid_self_heal) {
snprintf (str + strlen(str), size - strlen(str), " gfid");
}
}