From 1d1452e070f990cc91fea87408ea4905abde2fb7 Mon Sep 17 00:00:00 2001 From: shishir gowda Date: Thu, 14 Apr 2011 04:21:48 +0000 Subject: DHT: Add xlator-option assert_no_child_down If this is set, when CHILD_DOWN event is received, call exit Signed-off-by: shishir gowda Signed-off-by: Anand Avati BUG: 2536 (gsync service introspection) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2536 --- xlators/cluster/dht/src/dht.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'xlators/cluster/dht/src/dht.c') diff --git a/xlators/cluster/dht/src/dht.c b/xlators/cluster/dht/src/dht.c index c9b77d64428..ad83d8d4f03 100644 --- a/xlators/cluster/dht/src/dht.c +++ b/xlators/cluster/dht/src/dht.c @@ -419,6 +419,19 @@ init (xlator_t *this) } } + conf->assert_no_child_down = 0; + + if (!dict_get_str (this->options, "assert-no-child-down", &temp_str)) { + if (!strncmp (temp_str, "on", strlen (temp_str))) { + conf->assert_no_child_down = 1; + gf_log (this->name, GF_LOG_INFO, + "assert-no-child-down set to on"); + } else { + conf->assert_no_child_down = 0; + gf_log (this->name, GF_LOG_INFO, + "assert-no-child-down set to off"); + } + } ret = dht_init_subvolumes (this, conf); if (ret == -1) { @@ -543,5 +556,9 @@ struct volume_options options[] = { { .key = {"use-readdirp"}, .type = GF_OPTION_TYPE_BOOL }, + { .key = {"assert-no-child-down"}, + .value = {"on", "off"}, + .type = GF_OPTION_TYPE_STR + }, { .key = {NULL} }, }; -- cgit