summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht
diff options
context:
space:
mode:
authorshishir gowda <shishirng@gluster.com>2011-04-14 04:21:48 +0000
committerAnand Avati <avati@gluster.com>2011-04-14 03:38:33 -0700
commit1d1452e070f990cc91fea87408ea4905abde2fb7 (patch)
treec4bf937fe22bc609db5a7f9ef08b182ae5d982b8 /xlators/cluster/dht
parent6c16974a0ed485c72f84922fcf67b76ac8f64358 (diff)
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 <shishirng@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2536 (gsync service introspection) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2536
Diffstat (limited to 'xlators/cluster/dht')
-rw-r--r--xlators/cluster/dht/src/dht-common.c6
-rw-r--r--xlators/cluster/dht/src/dht-common.h1
-rw-r--r--xlators/cluster/dht/src/dht.c17
3 files changed, 24 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index c89b809b4..5cf19d017 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -5164,6 +5164,12 @@ dht_notify (xlator_t *this, int event, void *data, ...)
case GF_EVENT_CHILD_DOWN:
subvol = data;
+ if (conf->assert_no_child_down) {
+ gf_log (this->name, GF_LOG_WARNING,
+ "Received CHILD_DOWN. Exiting");
+ exit(0);
+ }
+
for (i = 0; i < conf->subvolume_cnt; i++) {
if (subvol == conf->subvolumes[i]) {
cnt = i;
diff --git a/xlators/cluster/dht/src/dht-common.h b/xlators/cluster/dht/src/dht-common.h
index 9c39d0d63..67cc16e43 100644
--- a/xlators/cluster/dht/src/dht-common.h
+++ b/xlators/cluster/dht/src/dht-common.h
@@ -165,6 +165,7 @@ struct dht_conf {
dht */
gf_boolean_t use_readdirp;
char vol_uuid[UUID_SIZE + 1];
+ gf_boolean_t assert_no_child_down;
};
typedef struct dht_conf dht_conf_t;
diff --git a/xlators/cluster/dht/src/dht.c b/xlators/cluster/dht/src/dht.c
index c9b77d644..ad83d8d4f 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} },
};