summaryrefslogtreecommitdiffstats
path: root/xlators/performance
diff options
context:
space:
mode:
authorKaushik BV <kaushikbv@gluster.com>2010-10-07 06:37:12 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-10-07 05:43:35 -0700
commitc7b518ab85f6fbcbdbae64c8fa092e998a14d1e9 (patch)
tree4f55db97bf6e843c96637264c8d97219a5b0aa38 /xlators/performance
parentf62484f42230db9d240c9b0eaadac48d845053b1 (diff)
mgmt/Glusterd: Volume set enhancements
- performance.flush-behind, transport.keepalive added - volume info to display the options reconfigured Signed-off-by: Kaushik BV <kaushikbv@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1159 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1159
Diffstat (limited to 'xlators/performance')
-rw-r--r--xlators/performance/io-cache/src/io-cache.c8
-rw-r--r--xlators/performance/quick-read/src/quick-read.c48
-rw-r--r--xlators/performance/write-behind/src/write-behind.c25
3 files changed, 74 insertions, 7 deletions
diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c
index b094f97c4ef..04b5c394e0e 100644
--- a/xlators/performance/io-cache/src/io-cache.c
+++ b/xlators/performance/io-cache/src/io-cache.c
@@ -1674,7 +1674,7 @@ reconfigure (xlator_t *this, dict_t *options)
goto out;
}
- if (cache_size < (4*(2^20))) {
+ if (cache_size < (4 * GF_UNIT_MB)) {
gf_log(this->name, GF_LOG_ERROR, "Reconfiguration"
"'option cache-size %s' failed , Max value"
"can be 4MiB, Defaulting to old value (%d)"
@@ -1683,8 +1683,8 @@ reconfigure (xlator_t *this, dict_t *options)
goto out;
}
- if (cache_size > (6 *(2^30))) {
- gf_log(this->name, GF_LOG_ERROR, "Reconfiguration"
+ if (cache_size > (6 * GF_UNIT_GB)) {
+ gf_log (this->name, GF_LOG_ERROR, "Reconfiguration"
"'option cache-size %s' failed , Max value"
"can be 6GiB, Defaulting to old value (%d)"
, cache_size_string, table->cache_size);
@@ -1694,7 +1694,7 @@ reconfigure (xlator_t *this, dict_t *options)
gf_log (this->name, GF_LOG_DEBUG, "Reconfiguring "
- " cache-size %"PRIu64"", table->cache_size);
+ " cache-size %"PRIu64"", cache_size);
table->cache_size = cache_size;
}
else
diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c
index 91243561e3c..965f943799b 100644
--- a/xlators/performance/quick-read/src/quick-read.c
+++ b/xlators/performance/quick-read/src/quick-read.c
@@ -2417,6 +2417,7 @@ validate_options (xlator_t *this, dict_t *options, char **op_errstr)
char *str = NULL;
int32_t ret = -1;
int32_t cache_timeout;
+ uint64_t cache_size;
if (!this)
goto out;
@@ -2442,6 +2443,32 @@ validate_options (xlator_t *this, dict_t *options, char **op_errstr)
goto out;
}
}
+
+ ret = dict_get_str (this->options, "cache-size", &str);
+ if (ret == 0) {
+ ret = gf_string2bytesize (str, &cache_size);
+ if (ret != 0) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "invalid cache-size value %s", str);
+ ret = -1;
+ goto out;
+ }
+ if (cache_size > 6 * GF_UNIT_GB) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "invalid cache-size value %s", str);
+ *op_errstr = "Range 4mb <= value <= 6gb";
+ ret = -1;
+ goto out;
+ }
+ if (cache_size < 4* GF_UNIT_MB) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "invalid cache-size value %s", str);
+ *op_errstr = "Range 4mb <= value <= 6gb";
+ ret = -1;
+ goto out;
+ }
+
+ }
ret =0;
@@ -2461,6 +2488,7 @@ reconfigure (xlator_t *this, dict_t *options)
qr_private_t *priv = NULL;
qr_conf_t *conf = NULL;
int32_t cache_timeout;
+ uint64_t cache_size;
if (!this)
goto out;
@@ -2474,7 +2502,7 @@ reconfigure (xlator_t *this, dict_t *options)
goto out;
cache_timeout = conf->cache_timeout;
- ret = dict_get_str (this->options, "cache-timeout", &str);
+ ret = dict_get_str (options, "cache-timeout", &str);
if (ret == 0) {
ret = gf_string2uint_base10 (str,
(unsigned int *)&conf->cache_timeout);
@@ -2489,6 +2517,24 @@ reconfigure (xlator_t *this, dict_t *options)
else
conf->cache_timeout = 1;
+ cache_size = conf->cache_size;
+ ret = dict_get_str (options, "cache-size", &str);
+ if (ret == 0) {
+ ret = gf_string2bytesize (str, &cache_size);
+ if (ret != 0) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "invalid cache-size %s(old value used)", str);
+ conf->cache_size = cache_size;
+ ret = -1;
+ goto out;
+ }
+ gf_log (this->name, GF_LOG_DEBUG,
+ "Reconfiguring cache-siz to %d", cache_size);
+ conf->cache_size = cache_size;
+ }
+ else
+ conf->cache_size = QR_DEFAULT_CACHE_SIZE;
+
ret = 0;
out:
return ret;
diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c
index ef596dfbeaa..8a4be0f7f99 100644
--- a/xlators/performance/write-behind/src/write-behind.c
+++ b/xlators/performance/write-behind/src/write-behind.c
@@ -2751,7 +2751,7 @@ validate_options (xlator_t *this, dict_t *options, char **op_errstr)
goto out;
}
- if (window_size < (524288)) {
+ if (window_size < (512 * GF_UNIT_KB)) {
gf_log(this->name, GF_LOG_WARNING, "Validation"
"'option cache-size %s' failed , Min value"
"should be 512KiB ", str);
@@ -2760,7 +2760,7 @@ validate_options (xlator_t *this, dict_t *options, char **op_errstr)
goto out;
}
- if (window_size > (1073741824)) {
+ if (window_size > (1 * GF_UNIT_GB)) {
gf_log(this->name, GF_LOG_WARNING, "Reconfiguration"
"'option cache-size %s' failed , Max value"
"can be 1 GiB", str);
@@ -2840,6 +2840,27 @@ reconfigure (xlator_t *this, dict_t *options)
}
else
conf->window_size = WB_WINDOW_SIZE;
+
+ ret = dict_get_str (options, "flush-behind",
+ &str);
+ if (ret == 0) {
+ ret = gf_string2boolean (str,
+ &conf->flush_behind);
+ if (ret == -1) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "'flush-behind' takes only boolean arguments");
+ conf->flush_behind = 1;
+ return -1;
+ }
+ if (conf->flush_behind) {
+ gf_log (this->name, GF_LOG_DEBUG,
+ "enabling flush-behind");
+ }
+ else
+ gf_log (this->name, GF_LOG_DEBUG,
+ "disabling flush-behind");
+ }
+
out:
return 0;