cb8e9e
From 32b0df844e96cfff95ef2c1c7366b6b521070f24 Mon Sep 17 00:00:00 2001
cb8e9e
From: Atin Mukherjee <amukherj@redhat.com>
cb8e9e
Date: Thu, 16 Apr 2015 17:54:24 +0530
cb8e9e
Subject: [PATCH 272/279] glusterd: log improvement in glusterd_peer_rpc_notify
cb8e9e
cb8e9e
Backport of http://review.gluster.org/#/c/11886/
cb8e9e
cb8e9e
If ping time out is enabled glusterd can receive a disconnect event from a peer
cb8e9e
which has been already deleted resulting into a critical log printed. This patch
cb8e9e
ensures that critical message is logged only when its a connect event.
cb8e9e
cb8e9e
Change-Id: I67d9aa3f60195e08af7dfc8a42683422aaf90a00
cb8e9e
BUG: 1246946
cb8e9e
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
cb8e9e
Reviewed-on: http://review.gluster.org/10272
cb8e9e
Tested-by: Gluster Build System <jenkins@build.gluster.com>
cb8e9e
Reviewed-by: Gaurav Kumar Garg <ggarg@redhat.com>
cb8e9e
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
cb8e9e
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
cb8e9e
Reviewed-on: https://code.engineering.redhat.com/gerrit/55047
cb8e9e
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
cb8e9e
---
cb8e9e
 xlators/mgmt/glusterd/src/glusterd-handler.c |   13 +++++++++----
cb8e9e
 1 files changed, 9 insertions(+), 4 deletions(-)
cb8e9e
cb8e9e
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
cb8e9e
index ed5d6ff..c2bfcf5 100644
cb8e9e
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
cb8e9e
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
cb8e9e
@@ -5011,12 +5011,17 @@ __glusterd_peer_rpc_notify (struct rpc_clnt *rpc, void *mydata,
cb8e9e
 
cb8e9e
         peerinfo = glusterd_peerinfo_find_by_generation (peerctx->peerinfo_gen);
cb8e9e
         if (!peerinfo) {
cb8e9e
-                /* Peerinfo should be available at this point. Not finding it
cb8e9e
-                 * means that something terrible has happened
cb8e9e
+                /* Peerinfo should be available at this point if its a connect
cb8e9e
+                 * event. Not finding it means that something terrible has
cb8e9e
+                 * happened. For non-connect event we might end up having a null
cb8e9e
+                 * peerinfo, so log at debug level.
cb8e9e
                  */
cb8e9e
-                gf_msg (THIS->name, GF_LOG_CRITICAL, ENOENT,
cb8e9e
+                gf_msg (THIS->name, (RPC_CLNT_CONNECT == event) ?
cb8e9e
+                        GF_LOG_CRITICAL : GF_LOG_DEBUG, ENOENT,
cb8e9e
                         GD_MSG_PEER_NOT_FOUND, "Could not find peer "
cb8e9e
-                        "%s(%s)", peerctx->peername, uuid_utoa (peerctx->peerid));
cb8e9e
+                        "%s(%s)", peerctx->peername,
cb8e9e
+                        uuid_utoa (peerctx->peerid));
cb8e9e
+
cb8e9e
                 ret = -1;
cb8e9e
                 goto out;
cb8e9e
         }
cb8e9e
-- 
cb8e9e
1.7.1
cb8e9e