summaryrefslogtreecommitdiffstats
path: root/xlators/cluster
diff options
context:
space:
mode:
authorshishir gowda <shishirng@gluster.com>2011-04-15 02:49:51 +0000
committerAnand Avati <avati@gluster.com>2011-04-15 03:58:42 -0700
commitb565cf8bfc75e6f6c85a47bc8a06737cd6e79fae (patch)
tree71d9c5159e3566a87d2541ba9b78e9422d804527 /xlators/cluster
parentdc75b9889d0dca8cde08860e96be1c88059644c6 (diff)
DHT: Make assert-no-child-down a boolean option
Signed-off-by: shishir gowda <shishirng@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2765 (geo-replication should have mercy on brick failure) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2765
Diffstat (limited to 'xlators/cluster')
-rw-r--r--xlators/cluster/dht/src/dht.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/xlators/cluster/dht/src/dht.c b/xlators/cluster/dht/src/dht.c
index ad83d8d4f03..57c3072cd2a 100644
--- a/xlators/cluster/dht/src/dht.c
+++ b/xlators/cluster/dht/src/dht.c
@@ -421,16 +421,17 @@ 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 = dict_get_str_boolean (this->options, "assert-no-child-down", 0);
+ if (ret != -1) {
+ if (conf->assert_no_child_down != ret) {
+ gf_log (this->name, GF_LOG_DEBUG,
+ "Changing assert-no-child-down from %d to %d",
+ conf->assert_no_child_down, ret);
}
+ conf->assert_no_child_down = ret;
+ } else {
+ gf_log (this->name, GF_LOG_ERROR,
+ "'assert-no-child-down' takes only boolean arguments");
}
ret = dht_init_subvolumes (this, conf);
@@ -557,8 +558,7 @@ struct volume_options options[] = {
.type = GF_OPTION_TYPE_BOOL
},
{ .key = {"assert-no-child-down"},
- .value = {"on", "off"},
- .type = GF_OPTION_TYPE_STR
+ .type = GF_OPTION_TYPE_BOOL
},
{ .key = {NULL} },
};