summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorN Balachandran <nbalacha@redhat.com>2017-08-08 23:11:10 +0530
committerN Balachandran <nbalacha@redhat.com>2017-11-09 09:11:36 +0530
commit63b541f29fab77c1e801e1e22642bc959febeec5 (patch)
treeab6ceb7b8c21f1ddee9fa4d0545afc555e80b348 /cli
parent2beb3177b804e5316cc17618f1fa7c8e1ad2ebe8 (diff)
cli: correct rebalance status elapsed check
Check that elapsed time has crossed 10 mins for at least one rebalance process before displaying the estimates. > BUG: 1479528 > Signed-off-by: N Balachandran <nbalacha@redhat.com> (cherry picked from commit 56aef68530b3bab27730aa62e4fbc513d3dba65f) Change-Id: Ib357a6f0d0125a178e94ede1e31514fdc6ce3593 BUG: 1511274 Signed-off-by: N Balachandran <nbalacha@redhat.com>
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-rpc-ops.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index d6199b4..0015a11 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -1613,6 +1613,7 @@ gf_cli_print_rebalance_status (dict_t *dict, enum gf_task_types task_type,
gf_boolean_t down = _gf_false;
gf_boolean_t fix_layout = _gf_false;
uint64_t max_time = 0;
+ uint64_t max_elapsed = 0;
uint64_t time_left = 0;
gf_boolean_t show_estimates = _gf_false;
@@ -1755,6 +1756,9 @@ gf_cli_print_rebalance_status (dict_t *dict, enum gf_task_types task_type,
gf_log ("cli", GF_LOG_TRACE,
"failed to get time left");
+ if (elapsed > max_elapsed)
+ max_elapsed = elapsed;
+
if (time_left > max_time)
max_time = time_left;
@@ -1815,7 +1819,7 @@ gf_cli_print_rebalance_status (dict_t *dict, enum gf_task_types task_type,
if (!show_estimates) {
goto out;
}
- if (elapsed <= REBAL_ESTIMATE_START_TIME) {
+ if (max_elapsed <= REBAL_ESTIMATE_START_TIME) {
cli_out ("The estimated time for rebalance to complete "
"will be unavailable for the first 10 "
"minutes.");