summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster/afr/src')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-common.c9
-rw-r--r--xlators/cluster/afr/src/afr.c9
-rw-r--r--xlators/cluster/afr/src/afr.h1
3 files changed, 16 insertions, 3 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c
index 98ad65f29fd..94ecf454651 100644
--- a/xlators/cluster/afr/src/afr-self-heal-common.c
+++ b/xlators/cluster/afr/src/afr-self-heal-common.c
@@ -1310,7 +1310,6 @@ afr_log_selfheal (uuid_t gfid, xlator_t *this, int ret, char *type,
}
}
}
-
if (ret < 0) {
status = "Failed";
loglevel = GF_LOG_DEBUG;
@@ -2193,6 +2192,9 @@ afr_selfheal (xlator_t *this, uuid_t gfid)
char *ancestry_path = "Unknown";
char *pgfid_str = NULL;
char *gfid_str = NULL;
+ afr_private_t *priv = NULL;
+
+ priv = this->private;
heal_gfid:
frame = afr_frame_create (this);
@@ -2205,8 +2207,9 @@ heal_gfid:
ret = afr_selfheal_do (frame, this, gfid);
- if (tried_parent == _gf_false && ret &&
- !gf_uuid_is_null (local->heal_pgfid)) {
+ if (priv->pgfid_self_heal == _gf_true &&
+ tried_parent == _gf_false && (ret != 0 || ret != 2) &&
+ !gf_uuid_is_null (local->heal_pgfid)) {
tried_parent = _gf_true;
pgfid_str = alloca (strlen (UUID0_STR) + 1);
gfid_str = alloca (strlen (UUID0_STR) + 1);
diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c
index 31949bdcea4..fc5fda6844f 100644
--- a/xlators/cluster/afr/src/afr.c
+++ b/xlators/cluster/afr/src/afr.c
@@ -164,6 +164,9 @@ reconfigure (xlator_t *this, dict_t *options)
GF_OPTION_RECONF ("entry-self-heal", priv->entry_self_heal, options,
bool, out);
+ GF_OPTION_RECONF ("pgfid-self-heal", priv->pgfid_self_heal,
+ options, bool, out);
+
GF_OPTION_RECONF ("data-self-heal-window-size",
priv->data_self_heal_window_size, options,
uint32, out);
@@ -421,6 +424,8 @@ init (xlator_t *this)
GF_OPTION_INIT ("shd-wait-qlength", priv->shd.wait_qlength,
uint32, out);
+ GF_OPTION_INIT ("pgfid-self-heal", priv->pgfid_self_heal, bool, out);
+
GF_OPTION_INIT ("background-self-heal-count",
priv->background_self_heal_count, uint32, out);
@@ -1102,5 +1107,9 @@ struct volume_options options[] = {
" with identical mtime and size in more than half the "
"number of bricks in the replica.",
},
+ { .key = {"pgfid-self-heal"},
+ .type = GF_OPTION_TYPE_BOOL,
+ .default_value = "off",
+ },
{ .key = {NULL} },
};
diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h
index abd2f470131..1d6a0dc5157 100644
--- a/xlators/cluster/afr/src/afr.h
+++ b/xlators/cluster/afr/src/afr.h
@@ -98,6 +98,7 @@ typedef struct _afr_private {
unsigned char *child_up;
int64_t *child_latency;
+ gf_boolean_t pgfid_self_heal;
unsigned char *local;
char **pending_key;