summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2016-07-04 17:25:57 +0530
committerJeff Darcy <jdarcy@redhat.com>2016-07-18 03:53:50 -0700
commit24310c41a6ce7a218dca8ca8545ba4d82834497f (patch)
treec813f81cd9a2e8f3e35f58d4e47ad02d18e4a8a3 /xlators/mgmt
parentc80ec19ebf31053e675c20e7a00f8c40e28575f8 (diff)
feature/bitrot: Show whether scrub is in progress/idle
Backport of http://review.gluster.org/14864/ Bitrot scrub status shows whether the scrub is paused or active. It doesn't show whether the scrubber is actually scrubbing or waiting in the timer wheel for the next schedule. This patch shows this status with "In Progress" and "Idle" respectively. Change-Id: I995d8553d1ff166503ae1e7b46282fc3ba961f0b BUG: 1355639 Signed-off-by: Kotresh HR <khiremat@redhat.com> (cherry picked from commit f4757d256e3e00132ef204c01ed61f78f705ad6b) Reviewed-on: http://review.gluster.org/14901 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 80477d49c26..65ca0e83b09 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -8687,6 +8687,7 @@ glusterd_volume_bitrot_scrub_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict)
glusterd_volinfo_t *volinfo = NULL;
int src_count = 0;
int dst_count = 0;
+ int8_t scrub_running = 0;
this = THIS;
GF_ASSERT (this);
@@ -8736,6 +8737,19 @@ glusterd_volume_bitrot_scrub_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict)
}
memset (key, 0, 256);
+ snprintf (key, 256, "scrub-running-%d", src_count);
+ ret = dict_get_int8 (rsp_dict, key, &scrub_running);
+ if (!ret) {
+ memset (key, 0, 256);
+ snprintf (key, 256, "scrub-running-%d", src_count+dst_count);
+ ret = dict_set_int8 (aggr, key, scrub_running);
+ if (ret) {
+ gf_msg_debug (this->name, 0, "Failed to set "
+ "scrub-running value");
+ }
+ }
+
+ memset (key, 0, 256);
snprintf (key, 256, "scrubbed-files-%d", src_count);
ret = dict_get_uint64 (rsp_dict, key, &value);
if (!ret) {
@@ -8906,6 +8920,7 @@ glusterd_bitrot_volume_node_rsp (dict_t *aggr, dict_t *rsp_dict)
xlator_t *this = NULL;
glusterd_conf_t *priv = NULL;
glusterd_volinfo_t *volinfo = NULL;
+ int8_t scrub_running = 0;
this = THIS;
GF_ASSERT (this);
@@ -9015,6 +9030,17 @@ glusterd_bitrot_volume_node_rsp (dict_t *aggr, dict_t *rsp_dict)
}
}
+ ret = dict_get_int8 (rsp_dict, "scrub-running", &scrub_running);
+ if (!ret) {
+ memset (key, 0, 256);
+ snprintf (key, 256, "scrub-running-%d", i);
+ ret = dict_set_uint64 (aggr, key, scrub_running);
+ if (ret) {
+ gf_msg_debug (this->name, 0, "Failed to set "
+ "scrub-running value");
+ }
+ }
+
ret = dict_get_uint64 (rsp_dict, "scrubbed-files", &value);
if (!ret) {
memset (key, 0, 256);