From aa80be0501a6893564b0dd40611cc91ad553ca6c Mon Sep 17 00:00:00 2001 From: Atin Mukherjee Date: Fri, 3 Jul 2015 11:34:20 +0530 Subject: glusterd: Do not log failure if glusterd_get_txn_opinfo fails in gluster volume status The first RPC call of gluster volume status fetches the list of the volume names from GlusterD and during that time since no volume name is set in the dictionary gluserd_get_txn_opinfo fails resulting into a failure log which is annoying to the user considering this command is triggered frequently. Fix is to have callers log it depending on the need Change-Id: Ib60a56725208182175513c505c61bcb28148b2d0 BUG: 1238936 Signed-off-by: Atin Mukherjee Reviewed-on: http://review.gluster.org/11520 Tested-by: Gluster Build System Tested-by: NetBSD Build System Reviewed-by: Kaushal M --- xlators/mgmt/glusterd/src/glusterd-op-sm.c | 23 +++++++++++------------ xlators/mgmt/glusterd/src/glusterd-utils.c | 7 ++++--- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index 68cffefdc94..40c48817c88 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -240,14 +240,8 @@ glusterd_get_txn_opinfo (uuid_t *txn_id, glusterd_op_info_t *opinfo) ret = dict_get_bin(priv->glusterd_txn_opinfo, uuid_utoa (*txn_id), (void **) &opinfo_obj); - if (ret) { - gf_msg_callingfn (this->name, GF_LOG_ERROR, errno, - GD_MSG_DICT_GET_FAILED, - "Unable to get transaction opinfo " - "for transaction ID : %s", - uuid_utoa (*txn_id)); + if (ret) goto out; - } (*opinfo) = opinfo_obj->opinfo; @@ -343,9 +337,11 @@ glusterd_clear_txn_opinfo (uuid_t *txn_id) ret = glusterd_get_txn_opinfo (txn_id, &txn_op_info); if (ret) { - gf_msg (this->name, GF_LOG_ERROR, 0, + gf_msg_callingfn (this->name, GF_LOG_ERROR, 0, GD_MSG_TRANS_OPINFO_GET_FAIL, - "Transaction opinfo not found"); + "Unable to get transaction opinfo " + "for transaction ID : %s", + uuid_utoa (*txn_id)); goto out; } @@ -7307,9 +7303,12 @@ glusterd_op_sm () ret = glusterd_get_txn_opinfo (&event->txn_id, &txn_op_info); if (ret) { - gf_msg (this->name, GF_LOG_ERROR, 0, - GD_MSG_TRANS_OPINFO_GET_FAIL, - "Unable to get transaction's opinfo"); + gf_msg_callingfn (this->name, GF_LOG_ERROR, 0, + GD_MSG_TRANS_OPINFO_GET_FAIL, + "Unable to get transaction " + "opinfo for transaction ID :" + "%s", + uuid_utoa (event->txn_id)); glusterd_destroy_op_event_ctx (event); GF_FREE (event); continue; diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 9d525a66132..dc800a1a520 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -8276,10 +8276,11 @@ glusterd_volume_heal_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict) ret = glusterd_get_txn_opinfo (txn_id, &txn_op_info); if (ret) { - gf_msg (THIS->name, GF_LOG_ERROR, 0, + gf_msg_callingfn (THIS->name, GF_LOG_ERROR, 0, GD_MSG_TRANS_OPINFO_GET_FAIL, - "Failed to get txn_op_info " - "for txn_id = %s", uuid_utoa (*txn_id)); + "Unable to get transaction opinfo " + "for transaction ID : %s", + uuid_utoa (*txn_id)); goto out; } -- cgit