From 905b3d26a794510892f6a9b51139bc9cfd947c02 Mon Sep 17 00:00:00 2001 From: hari gowtham Date: Tue, 24 Nov 2015 10:31:35 +0530 Subject: glusterd:Removing error message in glusterd log during upgrade when one of the gluster node is upgraded to 3.7 from a lower version and a mixed cluster is formed, tier related error messages are displayed in the glusterd log which are removed Change-Id: I8d0fc43ce049990a6a52306317ea1298a0a91390 BUG: 1282461 Signed-off-by: hari gowtham Reviewed-on: http://review.gluster.org/12587 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Atin Mukherjee --- xlators/mgmt/glusterd/src/glusterd-utils.c | 49 +++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 11 deletions(-) (limited to 'xlators') diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index b068d40ff1a..461a6047dff 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -8105,6 +8105,8 @@ glusterd_volume_status_copy_to_op_ctx_dict (dict_t *aggr, dict_t *rsp_dict) dict_t *ctx_dict = NULL; char key[PATH_MAX] = {0,}; char *volname = NULL; + glusterd_volinfo_t *volinfo = NULL; + GF_ASSERT (rsp_dict); @@ -8197,27 +8199,52 @@ glusterd_volume_status_copy_to_op_ctx_dict (dict_t *aggr, dict_t *rsp_dict) goto out; } - ret = dict_get_int32 (rsp_dict, "hot_brick_count", &hot_brick_count); + ret = dict_get_str (ctx_dict, "volname", &volname); if (ret) { - gf_msg (THIS->name, GF_LOG_ERROR, errno, - GD_MSG_DICT_GET_FAILED, - "Failed to get hot brick count from rsp_dict"); + gf_msg (THIS->name, GF_LOG_ERROR, 0, + GD_MSG_DICT_SET_FAILED, + "Failed to get volname"); goto out; } - ret = dict_set_int32 (ctx_dict, "hot_brick_count", hot_brick_count); + ret = glusterd_volinfo_find (volname, &volinfo); if (ret) { - gf_msg (THIS->name, GF_LOG_ERROR, errno, - GD_MSG_DICT_SET_FAILED, - "Failed to update hot_brick_count"); + gf_msg (THIS->name, GF_LOG_ERROR, 0, + GD_MSG_VOLINFO_GET_FAIL, + "Failed to get volinfo for volume: %s", + volname); goto out; } - ret = dict_get_int32 (rsp_dict, "type", &type); + + if (volinfo->type == GF_CLUSTER_TYPE_TIER) { + ret = dict_get_int32 (rsp_dict, "hot_brick_count", + &hot_brick_count); + if (ret) { + gf_msg (THIS->name, GF_LOG_ERROR, errno, + GD_MSG_DICT_GET_FAILED, + "Failed to get hot brick count from rsp_dict"); + goto out; + } + + + ret = dict_get_int32 (rsp_dict, "type", &type); + if (ret) { + gf_msg (THIS->name, GF_LOG_ERROR, errno, + GD_MSG_DICT_GET_FAILED, + "Failed to get type from rsp_dict"); + goto out; + } + + + } + + ret = dict_set_int32 (ctx_dict, "hot_brick_count", + hot_brick_count); if (ret) { gf_msg (THIS->name, GF_LOG_ERROR, errno, - GD_MSG_DICT_GET_FAILED, - "Failed to get type from rsp_dict"); + GD_MSG_DICT_SET_FAILED, + "Failed to update hot_brick_count"); goto out; } -- cgit