From 5cf7c80a44b56ca6064affc94ae8061809d56227 Mon Sep 17 00:00:00 2001
From: Atin Mukherjee <amukherj@redhat.com>
Date: Tue, 25 Apr 2017 18:26:10 +0530
Subject: [PATCH 404/406] glusterd: populate volinfo->rebal.time_left
While cherrypicking http://review.gluster.org/15893 for the rebalance
estimation RFE, there was one small piece of code got missed out, this
could be due to a manual mistake of resolving merge conflicts or the way
git merge behaved which I am not sure.
Label: DOWNSTREAM ONLY
Change-Id: I91b52250c8ae2fedc8402516587d6b54c6012b90
BUG: 1380598
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/104300
Reviewed-by: Nithya Balachandran <nbalacha@redhat.com>
---
xlators/mgmt/glusterd/src/glusterd-utils.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 100c6fd..e9a5183 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -8262,6 +8262,10 @@ glusterd_defrag_volume_status_update (glusterd_volinfo_t *volinfo,
gf_msg_trace (this->name, 0,
"failed to get run-time");
+ ret2 = dict_get_uint64 (rsp_dict, "time-left", &time_left);
+ if (ret2)
+ gf_msg_trace (this->name, 0, "failed to get time left");
+
if (files)
volinfo->rebal.rebalance_files = files;
if (size)
@@ -8276,10 +8280,8 @@ glusterd_defrag_volume_status_update (glusterd_volinfo_t *volinfo,
volinfo->rebal.skipped_files = skipped;
if (run_time)
volinfo->rebal.rebalance_time = run_time;
- ret2 = dict_get_uint64 (rsp_dict, "time-left", &time_left);
- if (ret2)
- gf_msg_trace (this->name, 0,
- "failed to get time left");
+ if (!ret2)
+ volinfo->rebal.time_left = time_left;
if (promoted)
volinfo->tier_info.promoted = promoted;
--
1.8.3.1