summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht.c
diff options
context:
space:
mode:
authorJeff Darcy <jdarcy@redhat.com>2013-03-19 14:06:39 -0400
committerAnand Avati <avati@redhat.com>2013-03-21 15:04:31 -0700
commit76bc5d1b2d25a4f25f4cf458e43ec3e19c3efae6 (patch)
tree6b331f8f900633aa05d15d41a8f3808edc7d87ce /xlators/cluster/dht/src/dht.c
parent790cbb82a12accc99312117bfa632227c8127f53 (diff)
dht: make DHT xattr names configurable
This is necessary to support "DHT over DHT" configurations, so that the upper and lower instances of DHT don't step all over each other. Why would we even consider such a thing? Because it gives us the ability to do data tiering and rack-aware placement, either by themselves or as complements to other functionality such as erasure codes or deduplication which save space but cost performance. By setting up the top-level DHT to place data into one of several lower-level DHT pools based on policy instead of pure elastic hashing, we get better performance for 90% of accesses and better storage efficiency for 90% of data, all for relatively low effort. Change-Id: I72e65c29edfc80babf39f7a2a00090f4588c4070 BUG: 924265 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/4694 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht.c')
-rw-r--r--xlators/cluster/dht/src/dht.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht.c b/xlators/cluster/dht/src/dht.c
index 14f3eb1d1ac..777086ab4bc 100644
--- a/xlators/cluster/dht/src/dht.c
+++ b/xlators/cluster/dht/src/dht.c
@@ -489,6 +489,7 @@ init (xlator_t *this)
if (!conf) {
goto err;
}
+ memset (conf, 0, sizeof(*conf));
ret = dict_get_int32 (this->options, "rebalance-cmd", &cmd);
@@ -602,6 +603,13 @@ init (xlator_t *this)
goto err;
}
+ GF_OPTION_INIT ("xattr-name", conf->xattr_name, str, err);
+ gf_asprintf (&conf->link_xattr_name, "%s.linkto", conf->xattr_name);
+ gf_asprintf (&conf->wild_xattr_name, "%s*", conf->xattr_name);
+ if (!conf->link_xattr_name || !conf->wild_xattr_name) {
+ goto err;
+ }
+
this->private = conf;
return 0;
@@ -623,6 +631,10 @@ err:
GF_FREE (conf->defrag);
+ GF_FREE (conf->xattr_name);
+ GF_FREE (conf->link_xattr_name);
+ GF_FREE (conf->wild_xattr_name);
+
GF_FREE (conf);
}
@@ -781,6 +793,13 @@ struct volume_options options[] = {
{ .key = {"rebalance-filter"},
.type = GF_OPTION_TYPE_STR,
},
+ { .key = {"xattr-name"},
+ .type = GF_OPTION_TYPE_STR,
+ .default_value = "trusted.glusterfs.dht",
+ .description = "Base for extended attributes used by this "
+ "translator instance, to avoid conflicts with others above or "
+ "below it."
+ },
{ .key = {NULL} },
};