summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
diff options
context:
space:
mode:
authorshishir gowda <shishirng@gluster.com>2012-04-12 15:32:05 +0530
committerVijay Bellur <vijay@gluster.com>2012-04-13 00:52:09 -0700
commitb19a7fee17ddedfc6692deb5a8dc8df927a2cf7b (patch)
tree0f26493da3e1da1f9ee9cab5308504bf02083cc3 /xlators/mgmt
parentbada6aeb2cabd12a11b0fe17bb01e9f2045b013d (diff)
dht/rebalance: Display migration failure count
Change-Id: Ib2f8be2c98eae1b4df5d2090c1f1eec8ab264a35 BUG: 811923 Signed-off-by: shishir gowda <shishirng@gluster.com> Reviewed-on: http://review.gluster.com/3135 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c15
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-rebalance.c1
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-rpc-ops.c14
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.h2
4 files changed, 32 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index 1825065a4b4..6d646c111f2 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -3187,6 +3187,7 @@ glusterd_defrag_volume_node_rsp (dict_t *req_dict, dict_t *rsp_dict,
char buf[1024] = {0,};
char *node_str = NULL;
glusterd_conf_t *priv = NULL;
+ uint64_t failures = 0;
priv = THIS->private;
GF_ASSERT (req_dict);
@@ -3224,12 +3225,19 @@ glusterd_defrag_volume_node_rsp (dict_t *req_dict, dict_t *rsp_dict,
gf_log (THIS->name, GF_LOG_TRACE,
"failed to get status");
+ ret = dict_get_uint64 (rsp_dict, "failures", &failures);
+ if (ret)
+ gf_log (THIS->name, GF_LOG_TRACE,
+ "failed to get failure count");
+
if (files)
volinfo->rebalance_files = files;
if (size)
volinfo->rebalance_data = size;
if (lookup)
volinfo->lookedup_files = lookup;
+ if (failures)
+ volinfo->rebalance_failures = failures;
if (!op_ctx) {
dict_copy (rsp_dict, op_ctx);
@@ -3283,6 +3291,13 @@ populate:
gf_log (THIS->name, GF_LOG_ERROR,
"failed to set status");
+ memset (key, 0 , 256);
+ snprintf (key, 256, "failures-%d", i);
+ ret = dict_set_uint64 (op_ctx, key, volinfo->rebalance_failures);
+ if (ret)
+ gf_log (THIS->name, GF_LOG_ERROR,
+ "failed to set failure count");
+
out:
return ret;
}
diff --git a/xlators/mgmt/glusterd/src/glusterd-rebalance.c b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
index e3c4c47411f..fddf6699f9e 100644
--- a/xlators/mgmt/glusterd/src/glusterd-rebalance.c
+++ b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
@@ -290,6 +290,7 @@ glusterd_handle_defrag_start (glusterd_volinfo_t *volinfo, char *op_errstr,
volinfo->rebalance_files = 0;
volinfo->rebalance_data = 0;
volinfo->lookedup_files = 0;
+ volinfo->rebalance_failures = 0;
volinfo->defrag_cmd = cmd;
glusterd_store_volinfo (volinfo, GLUSTERD_VOLINFO_VER_AC_INCREMENT);
diff --git a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
index 14bcf8b9904..ddc4d1f492d 100644
--- a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
@@ -1208,6 +1208,20 @@ glusterd_volume_rebalance_use_rsp_dict (dict_t *rsp_dict)
"failed to set node-uuid");
}
}
+
+ memset (key, 0, 256);
+ snprintf (key, 256, "failures-%d", index);
+ ret = dict_get_uint64 (rsp_dict, key, &value);
+ if (!ret) {
+ memset (key, 0, 256);
+ snprintf (key, 256, "failures-%d", i);
+ ret = dict_set_uint64 (ctx_dict, key, value);
+ if (ret) {
+ gf_log (THIS->name, GF_LOG_DEBUG,
+ "failed to set failure count");
+ }
+ }
+
ret = 0;
out:
diff --git a/xlators/mgmt/glusterd/src/glusterd.h b/xlators/mgmt/glusterd/src/glusterd.h
index 8169562d78b..1b958d105d6 100644
--- a/xlators/mgmt/glusterd/src/glusterd.h
+++ b/xlators/mgmt/glusterd/src/glusterd.h
@@ -166,6 +166,7 @@ struct glusterd_defrag_info_ {
uint64_t total_files;
uint64_t total_data;
uint64_t num_files_lookedup;
+ uint64_t total_failures;
gf_lock_t lock;
int cmd;
pthread_t th;
@@ -226,6 +227,7 @@ struct glusterd_volinfo_ {
uint64_t lookedup_files;
glusterd_defrag_info_t *defrag;
gf_cli_defrag_type defrag_cmd;
+ uint64_t rebalance_failures;
/* Replace brick status */
gf_rb_status_t rb_status;