cb8e9e
From 758ff1daa0aa29ddc144cd008b3c19e5eccc4269 Mon Sep 17 00:00:00 2001
cb8e9e
From: Atin Mukherjee <amukherj@redhat.com>
cb8e9e
Date: Fri, 3 Jul 2015 11:34:20 +0530
cb8e9e
Subject: [PATCH 248/279] glusterd: Do not log failure if glusterd_get_txn_opinfo fails in gluster volume status
cb8e9e
cb8e9e
Backport of http://review.gluster.org/#/c/11520/
cb8e9e
cb8e9e
The first RPC call of gluster volume status fetches the list of the volume names
cb8e9e
from GlusterD and during that time since no volume name is set in the dictionary
cb8e9e
gluserd_get_txn_opinfo fails resulting into a failure log which is annoying to
cb8e9e
the user considering this command is triggered frequently.
cb8e9e
cb8e9e
Fix is to have callers log it depending on the need
cb8e9e
cb8e9e
Change-Id: Ib60a56725208182175513c505c61bcb28148b2d0
cb8e9e
BUG: 1134288
cb8e9e
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
cb8e9e
Reviewed-on: http://review.gluster.org/11520
cb8e9e
Tested-by: Gluster Build System <jenkins@build.gluster.com>
cb8e9e
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
cb8e9e
Reviewed-by: Kaushal M <kaushal@redhat.com>
cb8e9e
Reviewed-on: https://code.engineering.redhat.com/gerrit/55037
cb8e9e
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
cb8e9e
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
cb8e9e
---
cb8e9e
 xlators/mgmt/glusterd/src/glusterd-op-sm.c |   23 +++++++++++------------
cb8e9e
 xlators/mgmt/glusterd/src/glusterd-utils.c |    7 ++++---
cb8e9e
 2 files changed, 15 insertions(+), 15 deletions(-)
cb8e9e
cb8e9e
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
cb8e9e
index dbdaec0..5e916eb 100644
cb8e9e
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
cb8e9e
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
cb8e9e
@@ -245,14 +245,8 @@ glusterd_get_txn_opinfo (uuid_t *txn_id, glusterd_op_info_t  *opinfo)
cb8e9e
         ret = dict_get_bin(priv->glusterd_txn_opinfo,
cb8e9e
                            uuid_utoa (*txn_id),
cb8e9e
                            (void **) &opinfo_obj);
cb8e9e
-        if (ret) {
cb8e9e
-                gf_msg_callingfn (this->name, GF_LOG_ERROR, errno,
cb8e9e
-                        GD_MSG_DICT_GET_FAILED,
cb8e9e
-                        "Unable to get transaction opinfo "
cb8e9e
-                        "for transaction ID : %s",
cb8e9e
-                        uuid_utoa (*txn_id));
cb8e9e
+        if (ret)
cb8e9e
                 goto out;
cb8e9e
-        }
cb8e9e
 
cb8e9e
         (*opinfo) = opinfo_obj->opinfo;
cb8e9e
 
cb8e9e
@@ -348,9 +342,11 @@ glusterd_clear_txn_opinfo (uuid_t *txn_id)
cb8e9e
 
cb8e9e
         ret = glusterd_get_txn_opinfo (txn_id, &txn_op_info);
cb8e9e
         if (ret) {
cb8e9e
-                gf_msg (this->name, GF_LOG_ERROR, 0,
cb8e9e
+                gf_msg_callingfn (this->name, GF_LOG_ERROR, 0,
cb8e9e
                         GD_MSG_TRANS_OPINFO_GET_FAIL,
cb8e9e
-                        "Transaction opinfo not found");
cb8e9e
+                        "Unable to get transaction opinfo "
cb8e9e
+                        "for transaction ID : %s",
cb8e9e
+                        uuid_utoa (*txn_id));
cb8e9e
                 goto out;
cb8e9e
         }
cb8e9e
 
cb8e9e
@@ -7262,9 +7258,12 @@ glusterd_op_sm ()
cb8e9e
                         ret = glusterd_get_txn_opinfo (&event->txn_id,
cb8e9e
                                                        &txn_op_info);
cb8e9e
                         if (ret) {
cb8e9e
-                                gf_msg (this->name, GF_LOG_ERROR, 0,
cb8e9e
-                                        GD_MSG_TRANS_OPINFO_GET_FAIL,
cb8e9e
-                                        "Unable to get transaction's opinfo");
cb8e9e
+                                gf_msg_callingfn (this->name, GF_LOG_ERROR, 0,
cb8e9e
+                                                  GD_MSG_TRANS_OPINFO_GET_FAIL,
cb8e9e
+                                                  "Unable to get transaction "
cb8e9e
+                                                  "opinfo for transaction ID :"
cb8e9e
+                                                  "%s",
cb8e9e
+                                                  uuid_utoa (event->txn_id));
cb8e9e
                                 glusterd_destroy_op_event_ctx (event);
cb8e9e
                                 GF_FREE (event);
cb8e9e
                                 continue;
cb8e9e
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
cb8e9e
index 5b9d5e3..1af9902 100644
cb8e9e
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
cb8e9e
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
cb8e9e
@@ -8261,10 +8261,11 @@ glusterd_volume_heal_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict)
cb8e9e
 
cb8e9e
         ret = glusterd_get_txn_opinfo (txn_id, &txn_op_info);
cb8e9e
         if (ret) {
cb8e9e
-                gf_msg (THIS->name, GF_LOG_ERROR, 0,
cb8e9e
+                gf_msg_callingfn (THIS->name, GF_LOG_ERROR, 0,
cb8e9e
                         GD_MSG_TRANS_OPINFO_GET_FAIL,
cb8e9e
-                        "Failed to get txn_op_info "
cb8e9e
-                        "for txn_id = %s", uuid_utoa (*txn_id));
cb8e9e
+                        "Unable to get transaction opinfo "
cb8e9e
+                        "for transaction ID : %s",
cb8e9e
+                        uuid_utoa (*txn_id));
cb8e9e
                 goto out;
cb8e9e
         }
cb8e9e
 
cb8e9e
-- 
cb8e9e
1.7.1
cb8e9e