diff options
author | Ravishankar N <ravishankar@redhat.com> | 2015-05-30 10:23:33 +0530 |
---|---|---|
committer | Raghavendra Bhat <raghavendra@redhat.com> | 2015-06-15 06:18:44 -0700 |
commit | fecebde3fbae17ace970a4d9c440f6455161dc62 (patch) | |
tree | 34ee1bea0384de838d21a46c61514817a4731521 /xlators/cluster/afr/src/afr-self-heal-common.c | |
parent | 4a1a1c9945656b3197b2677dd6c2142f02ade4dc (diff) |
afr: honour selfheal enable/disable volume set options
Backport of http://review.gluster.org/11012
Note: http://review.gluster.org/9459 is not backported to 3.6 but the change it
makes to afr_get_heal_info() (i.e. handling ret values) is needed for heal info
to work correctly and tests/basic/afr/client-side-heal.t to pass.
--------------------------
afr-v1 had the following volume set options that are used to enable/ disable
self-heals from happening in AFR xlator when loaded in the client graph:
cluster.metadata-self-heal
cluster.data-self-heal
cluster.entry-self-heal
In afr-v2, these 3 heals can happen from the client if there is an inode
refresh. This patch allows such heals to proceed only if the corresponding
volume set options are set to true.
--------------------------
Change-Id: Iebf863758d902fd2f95be320c6791d4e15f634e7
BUG: 1230259
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-on: http://review.gluster.org/11170
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anuradha Talur <atalur@redhat.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-common.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-common.c | 11 |
1 files changed, 8 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 7fb6e2b9dc4..b3194724e51 100644 --- a/xlators/cluster/afr/src/afr-self-heal-common.c +++ b/xlators/cluster/afr/src/afr-self-heal-common.c @@ -1133,6 +1133,11 @@ afr_selfheal_do (call_frame_t *frame, xlator_t *this, uuid_t gfid) gf_boolean_t data_selfheal = _gf_false; gf_boolean_t metadata_selfheal = _gf_false; gf_boolean_t entry_selfheal = _gf_false; + afr_private_t *priv = NULL; + gf_boolean_t dataheal_enabled = _gf_false; + + priv = this->private; + gf_string2boolean (priv->data_self_heal, &dataheal_enabled); ret = afr_selfheal_unlocked_inspect (frame, this, gfid, &inode, &data_selfheal, @@ -1146,13 +1151,13 @@ afr_selfheal_do (call_frame_t *frame, xlator_t *this, uuid_t gfid) goto out; } - if (data_selfheal) + if (data_selfheal && dataheal_enabled) data_ret = afr_selfheal_data (frame, this, inode); - if (metadata_selfheal) + if (metadata_selfheal && priv->metadata_self_heal) metadata_ret = afr_selfheal_metadata (frame, this, inode); - if (entry_selfheal) + if (entry_selfheal && priv->entry_self_heal) entry_ret = afr_selfheal_entry (frame, this, inode); or_ret = (data_ret | metadata_ret | entry_ret); |