diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2014-12-29 15:32:28 +0530 |
---|---|---|
committer | Krishnan Parthasarathi <kparthas@redhat.com> | 2015-01-20 02:24:24 -0800 |
commit | 7510d8edf4e7bea50e0c1f041202f063a5d138af (patch) | |
tree | 77814773e915cedccbcb9149ff8c86ca704514fa /xlators/cluster | |
parent | 1ee8ce725f0e70f45419aa0e2f4d85db7223d766 (diff) |
mgmt/glusterd: Implement Volume heal enable/disable
For volumes with replicate, disperse xlators, self-heal daemon should do
healing. This patch provides enable/disable functionality for the xlators to be
part of self-heal-daemon. Replicate already had this functionality with
'gluster volume set cluster.self-heal-daemon on/off'. But this patch makes it
uniform for both types of volumes. Internally it still does 'volume set' based
on the volume type.
Change-Id: Ie0f3799b74c2afef9ac658ef3d50dce3e8072b29
BUG: 1177601
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/9358
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'xlators/cluster')
-rw-r--r-- | xlators/cluster/ec/src/ec.c | 34 | ||||
-rw-r--r-- | xlators/cluster/ec/src/ec.h | 2 |
2 files changed, 30 insertions, 6 deletions
diff --git a/xlators/cluster/ec/src/ec.c b/xlators/cluster/ec/src/ec.c index bd3fbc717e5..9f620c75457 100644 --- a/xlators/cluster/ec/src/ec.c +++ b/xlators/cluster/ec/src/ec.c @@ -181,12 +181,18 @@ int32_t mem_acct_init(xlator_t * this) return 0; } -int32_t reconfigure(xlator_t * this, dict_t * options) +int32_t +reconfigure (xlator_t *this, dict_t *options) { - gf_log(this->name, GF_LOG_ERROR, "Online volume reconfiguration is not " - "supported."); + ec_t *ec = this->private; - return -1; + GF_OPTION_RECONF ("self-heal-daemon", ec->shd, options, bool, failed); + GF_OPTION_RECONF ("iam-self-heal-daemon", ec->iamshd, options, + bool, failed); + + return 0; +failed: + return -1; } void ec_up(xlator_t * this, ec_t * ec) @@ -336,9 +342,10 @@ int32_t notify(xlator_t * this, int32_t event, void * data, ...) return 0; } -int32_t init(xlator_t * this) +int32_t +init (xlator_t *this) { - ec_t * ec; + ec_t *ec = NULL; if (this->parents == NULL) { @@ -385,6 +392,8 @@ int32_t init(xlator_t * this) } ec_method_initialize(); + GF_OPTION_INIT ("self-heal-daemon", ec->shd, bool, failed); + GF_OPTION_INIT ("iam-self-heal-daemon", ec->iamshd, bool, failed); gf_log(this->name, GF_LOG_DEBUG, "Disperse translator initialized."); @@ -977,5 +986,18 @@ struct volume_options options[] = .description = "Maximum number of bricks that can fail " "simultaneously without losing data." }, + { + .key = { "self-heal-daemon" }, + .type = GF_OPTION_TYPE_BOOL, + .description = "self-heal daemon enable/disable", + .default_value = "enable", + }, + { .key = {"iam-self-heal-daemon"}, + .type = GF_OPTION_TYPE_BOOL, + .default_value = "off", + .description = "This option differentiates if the disperse " + "translator is running as part of self-heal-daemon " + "or not." + }, { } }; diff --git a/xlators/cluster/ec/src/ec.h b/xlators/cluster/ec/src/ec.h index 2a042ae577f..cb3832ae097 100644 --- a/xlators/cluster/ec/src/ec.h +++ b/xlators/cluster/ec/src/ec.h @@ -43,6 +43,8 @@ struct _ec struct mem_pool * fop_pool; struct mem_pool * cbk_pool; struct mem_pool * lock_pool; + gf_boolean_t shd; + gf_boolean_t iamshd; }; #endif /* __EC_H__ */ |