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