summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorshishir gowda <shishirng@gluster.com>2012-05-24 12:51:32 +0530
committerAnand Avati <avati@redhat.com>2012-05-24 18:07:33 -0700
commit5b13919fa5ae449c7b796f9de3454bb9f0f886a3 (patch)
tree8b8191eaaddff7acf4cb2700df767f3282cf2c47 /xlators
parent6af14c76f45754b190e74c824f73227190382ed3 (diff)
glusterd/remove-brick: Reset decommission stats on all nodes
Decommissioning is started only on nodes where the bricks which are being decommissioned are present. The stats were reset only when decommission was started. Hence stale stats were being shown on nodes where the bricks were not present. BUG: 822778 Change-Id: I2d839f877d4e040b463bebde5ba753b7265ab633 Signed-off-by: shishir gowda <shishirng@gluster.com> Reviewed-on: http://review.gluster.com/3425 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-brick-ops.c2
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-rebalance.c7
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c14
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.h2
4 files changed, 19 insertions, 6 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
index 120fd5027e2..55554fe6ee4 100644
--- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
@@ -1010,6 +1010,8 @@ glusterd_op_perform_remove_brick (glusterd_volinfo_t *volinfo, char *brick,
if (ret)
goto out;
+ glusterd_volinfo_reset_defrag_stats (volinfo);
+
if (!uuid_compare (brickinfo->uuid, priv->uuid)) {
/* Only if the brick is in this glusterd, do the rebalance */
if (need_migrate)
diff --git a/xlators/mgmt/glusterd/src/glusterd-rebalance.c b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
index 20142a1cc4b..e4384c8e9d4 100644
--- a/xlators/mgmt/glusterd/src/glusterd-rebalance.c
+++ b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
@@ -253,12 +253,7 @@ glusterd_handle_defrag_start (glusterd_volinfo_t *volinfo, char *op_errstr,
volinfo->defrag_status = GF_DEFRAG_STATUS_STARTED;
- volinfo->rebalance_files = 0;
- volinfo->rebalance_data = 0;
- volinfo->lookedup_files = 0;
- volinfo->rebalance_failures = 0;
- volinfo->rebalance_time = 0;
-
+ glusterd_volinfo_reset_defrag_stats (volinfo);
volinfo->defrag_cmd = cmd;
glusterd_store_perform_node_state_store (volinfo);
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index cd11d0a4595..2ee55b7c111 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -5397,6 +5397,20 @@ glusterd_restart_rebalance (glusterd_conf_t *conf)
return ret;
}
+
+void
+glusterd_volinfo_reset_defrag_stats (glusterd_volinfo_t *volinfo)
+{
+ GF_ASSERT (volinfo);
+
+ volinfo->rebalance_files = 0;
+ volinfo->rebalance_data = 0;
+ volinfo->lookedup_files = 0;
+ volinfo->rebalance_failures = 0;
+ volinfo->rebalance_time = 0;
+
+}
+
/* Return hostname for given uuid if it exists
* else return NULL
*/
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.h b/xlators/mgmt/glusterd/src/glusterd-utils.h
index c1b2ee9aea9..0297d9a22eb 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.h
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.h
@@ -442,4 +442,6 @@ glusterd_defrag_volume_status_update (glusterd_volinfo_t *volinfo,
int
glusterd_check_files_identical (char *filename1, char *filename2,
gf_boolean_t *identical);
+void
+glusterd_volinfo_reset_defrag_stats (glusterd_volinfo_t *volinfo);
#endif