summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht.c
diff options
context:
space:
mode:
authorshishir gowda <shishirng@gluster.com>2012-05-08 16:21:29 +0530
committerAnand Avati <avati@redhat.com>2012-05-24 00:03:36 -0700
commit9f81eb0b24f27ea9797bb8a4ff062e6f77e872fd (patch)
tree06c78440191efc51fa836872d98f8529d428c0ba /xlators/cluster/dht/src/dht.c
parenteff9a75fd95d98b30d0aaa04903ab42b56951d34 (diff)
glusterd/rebalance: Display run-time of rebalance process
Added run-time value field to cli output of rebalance/remove-brick. A new cluster/distribute boolean option rebalance-stats when set to ON, time taken for migration of each file is logged. With rebalance-stats OFF (default), rebalance logs will only have entries showing time spent in each directory. Change-Id: I02a8918621120068cd71ffaf2999d30b3a2d10a2 BUG: 821987 Signed-off-by: shishir gowda <shishirng@gluster.com> Reviewed-on: http://review.gluster.com/3303 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.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/xlators/cluster/dht/src/dht.c b/xlators/cluster/dht/src/dht.c
index e3930e2af3f..c25cdb4fd80 100644
--- a/xlators/cluster/dht/src/dht.c
+++ b/xlators/cluster/dht/src/dht.c
@@ -332,6 +332,11 @@ reconfigure (xlator_t *this, dict_t *options)
GF_OPTION_RECONF ("directory-layout-spread", conf->dir_spread_cnt,
options, uint32, out);
+ if (conf->defrag) {
+ GF_OPTION_RECONF ("rebalance-stats", conf->defrag->stats,
+ options, bool, out);
+ }
+
if (dict_get_str (options, "decommissioned-bricks", &temp_str) == 0) {
ret = dht_parse_decommissioned_bricks (this, conf, temp_str);
if (ret == -1)
@@ -401,9 +406,11 @@ init (xlator_t *this)
defrag->cmd = cmd;
+ defrag->stats = _gf_false;
+
conf->defrag = defrag;
- }
+ }
conf->search_unhashed = GF_DHT_LOOKUP_UNHASHED_ON;
if (dict_get_str (this->options, "lookup-unhashed", &temp_str) == 0) {
@@ -432,6 +439,10 @@ init (xlator_t *this)
GF_OPTION_INIT ("assert-no-child-down", conf->assert_no_child_down,
bool, err);
+ if (defrag) {
+ GF_OPTION_INIT ("rebalance-stats", defrag->stats, bool, err);
+ }
+
ret = dht_init_subvolumes (this, conf);
if (ret == -1) {
goto err;
@@ -593,6 +604,10 @@ struct volume_options options[] = {
{ .key = {"node-uuid"},
.type = GF_OPTION_TYPE_STR,
},
+ { .key = {"rebalance-stats"},
+ .type = GF_OPTION_TYPE_BOOL,
+ .default_value = "off",
+ },
{ .key = {NULL} },
};