summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/switch.c
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2010-02-05 01:38:29 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-02-06 08:44:09 -0800
commit137f94ed123b1c7c7ada541aaa599679e19888f6 (patch)
treefd1e9cc177cd77077bd516a39b8d0c8293ff72b3 /xlators/cluster/dht/src/switch.c
parentc3005ce736d6bb3391e5f46930d355fc6b0f4d6e (diff)
'lookup-unhashed' option of distribute should be 'auto' by default.
* Added 'auto' option, older boolean options works as they used to. * This option should make 'create' rate faster, also handles self-healing of linkfile properly in case of scaling to more servers or filesystem is getting full. Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 584 (automatically configure 'lookup-unhashed' option) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=584
Diffstat (limited to 'xlators/cluster/dht/src/switch.c')
-rw-r--r--xlators/cluster/dht/src/switch.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/xlators/cluster/dht/src/switch.c b/xlators/cluster/dht/src/switch.c
index 6670f0e3b3b..5a36f8dab04 100644
--- a/xlators/cluster/dht/src/switch.c
+++ b/xlators/cluster/dht/src/switch.c
@@ -887,9 +887,11 @@ init (xlator_t *this)
goto err;
}
- conf->search_unhashed = 1;
+ conf->search_unhashed = GF_DHT_LOOKUP_UNHASHED_AUTO;
if (dict_get_str (this->options, "lookup-unhashed", &temp_str) == 0) {
- gf_string2boolean (temp_str, &conf->search_unhashed);
+ /* If option is not "auto", other options _should_ be boolean */
+ if (strcasecmp (temp_str, "auto"))
+ gf_string2boolean (temp_str, &conf->search_unhashed);
}
conf->unhashed_sticky_bit = 0;
@@ -1039,12 +1041,14 @@ struct xlator_cbks cbks = {
struct volume_options options[] = {
+ { .key = {"lookup-unhashed"},
+ .value = {"auto", "yes", "no", "enable", "disable", "1", "0",
+ "on", "off"},
+ .type = GF_OPTION_TYPE_STR
+ },
{ .key = {"pattern.switch.case"},
.type = GF_OPTION_TYPE_ANY
},
- { .key = {"lookup-unhashed"},
- .type = GF_OPTION_TYPE_BOOL
- },
{ .key = {"min-free-disk"},
.type = GF_OPTION_TYPE_PERCENT_OR_SIZET,
},