summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAshish Pandey <aspandey@redhat.com>2015-07-08 12:42:50 +0530
committerXavier Hernandez <xhernandez@datalab.es>2015-07-14 00:07:46 -0700
commitc4009f895818a84ed4c3bb8f826e78d17a6a5b3e (patch)
treea5399f802a3c0d02906352f8c00989665ae11ca8
parent8c39f1487461fb366e6156955f5045ee9f71c1a9 (diff)
ec : Implement check for the cluster.heal-timeout values
for disperse volume. Problem : User can set wrong values for cluster.heal-timeout using cli. Any value like string, negative numbers or 0 could be set. Solution : Check the value given by user. It should be numerical, non negative and within the range. Change-Id: I5184ef1a11bb2c225f42ac9ccb1ba680a86cfe09 BUG: 1239037 Signed-off-by: Ashish Pandey <aspandey@redhat.com> Reviewed-on: http://review.gluster.org/11573 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
-rw-r--r--xlators/cluster/ec/src/ec.c10
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volume-set.c6
2 files changed, 16 insertions, 0 deletions
diff --git a/xlators/cluster/ec/src/ec.c b/xlators/cluster/ec/src/ec.c
index e28f402e6fe..72dc919ded5 100644
--- a/xlators/cluster/ec/src/ec.c
+++ b/xlators/cluster/ec/src/ec.c
@@ -246,6 +246,8 @@ reconfigure (xlator_t *this, dict_t *options)
uint32, failed);
GF_OPTION_RECONF ("heal-wait-qlength", heal_wait_qlen, options,
uint32, failed);
+ GF_OPTION_RECONF ("heal-timeout", ec->shd.timeout, options,
+ int32, failed);
ec_configure_background_heal_opts (ec, background_heals,
heal_wait_qlen);
return 0;
@@ -1315,5 +1317,13 @@ struct volume_options options[] =
.description = "This option can be used to control number of heals"
" that can wait",
},
+ { .key = {"heal-timeout"},
+ .type = GF_OPTION_TYPE_INT,
+ .min = 60,
+ .max = INT_MAX,
+ .default_value = "600",
+ .description = "time interval for checking the need to self-heal "
+ "in self-heal-daemon"
+ },
{ }
};
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
index a5fcecf3d73..f1413dbf525 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
@@ -2018,6 +2018,12 @@ struct volopt_map_entry glusterd_volopt_map[] = {
.voltype = "cluster/disperse",
.op_version = GD_OP_VERSION_3_7_3,
},
+ { .key = "cluster.heal-timeout",
+ .voltype = "cluster/disperse",
+ .option = "!heal-timeout",
+ .op_version = GD_OP_VERSION_3_7_3,
+ .type = NO_DOC,
+ },
{ .key = NULL
}
};