summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr.c
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2011-09-08 14:06:32 +0530
committerVijay Bellur <vijay@gluster.com>2011-09-14 05:36:24 -0700
commit45f03a58a0fbfc1d5e647c764b10e37d0a9ebb26 (patch)
tree92b1848d39c867733c3c1876840b2b5f6a9c219e /xlators/cluster/afr/src/afr.c
parent3bea46c1f232a4480e57ac482f92f7673af7034f (diff)
Proactive self heal process implementation
Change-Id: I96db0d94566ceabf1649f890318363f738c06553 BUG: 2458 Reviewed-on: http://review.gluster.com/403 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr.c')
-rw-r--r--xlators/cluster/afr/src/afr.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c
index 044213e0710..8bb94e2053e 100644
--- a/xlators/cluster/afr/src/afr.c
+++ b/xlators/cluster/afr/src/afr.c
@@ -140,6 +140,8 @@ reconfigure (xlator_t *this, dict_t *options)
GF_OPTION_RECONF ("data-self-heal-algorithm",
priv->data_self_heal_algorithm, options, str, out);
+ GF_OPTION_RECONF ("self-heal-daemon", priv->shd.enabled, options, bool, out);
+
GF_OPTION_RECONF ("read-subvolume", read_subvol, options, xlator, out);
if (read_subvol) {
@@ -240,6 +242,8 @@ init (xlator_t *this)
GF_OPTION_INIT ("entry-self-heal", priv->entry_self_heal, bool, out);
+ GF_OPTION_INIT ("self-heal-daemon", priv->shd.enabled, bool, out);
+
GF_OPTION_INIT ("data-change-log", priv->data_change_log, bool, out);
GF_OPTION_INIT ("metadata-change-log", priv->metadata_change_log, bool,
@@ -320,6 +324,13 @@ init (xlator_t *this)
goto out;
}
+ priv->shd.pos = GF_CALLOC (sizeof (*priv->shd.pos), child_count,
+ gf_afr_mt_afr_brick_pos_t);
+ if (!priv->shd.pos) {
+ ret = -ENOMEM;
+ goto out;
+ }
+
LOCK_INIT (&priv->root_inode_lk);
priv->first_lookup = 1;
priv->root_inode = NULL;
@@ -475,5 +486,9 @@ struct volume_options options[] = {
.type = GF_OPTION_TYPE_BOOL,
.default_value = "off",
},
+ { .key = {"self-heal-daemon"},
+ .type = GF_OPTION_TYPE_BOOL,
+ .default_value = "off",
+ },
{ .key = {NULL} },
};