summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-handler.c
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2015-04-16 17:54:24 +0530
committerAtin Mukherjee <amukherj@redhat.com>2015-08-17 00:23:24 -0700
commita40f9b42390d1143c2bf6dc710414c11ceb6cc22 (patch)
treebf7305e653a079654f040cf4944f10e8644bb7eb /xlators/mgmt/glusterd/src/glusterd-handler.c
parentcfefaaed76c72fd2ee142217b4de55a2c7518ba7 (diff)
glusterd: log improvement in glusterd_peer_rpc_notify
Backport of http://review.gluster.org/#/c/10272/ If ping time out is enabled glusterd can receive a disconnect event from a peer which has been already deleted resulting into a critical log printed. This patch ensures that critical message is logged only when its a connect event. Change-Id: I67d9aa3f60195e08af7dfc8a42683422aaf90a00 BUG: 1252680 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/10272 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Gaurav Kumar Garg <ggarg@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/11886 Reviewed-by: Anand Nekkunti <anekkunt@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-handler.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handler.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index 3768a875af7..7b23f6cfc45 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
@@ -5011,12 +5011,17 @@ __glusterd_peer_rpc_notify (struct rpc_clnt *rpc, void *mydata,
peerinfo = glusterd_peerinfo_find_by_generation (peerctx->peerinfo_gen);
if (!peerinfo) {
- /* Peerinfo should be available at this point. Not finding it
- * means that something terrible has happened
+ /* Peerinfo should be available at this point if its a connect
+ * event. Not finding it means that something terrible has
+ * happened. For non-connect event we might end up having a null
+ * peerinfo, so log at debug level.
*/
- gf_msg (THIS->name, GF_LOG_CRITICAL, ENOENT,
+ gf_msg (THIS->name, (RPC_CLNT_CONNECT == event) ?
+ GF_LOG_CRITICAL : GF_LOG_DEBUG, ENOENT,
GD_MSG_PEER_NOT_FOUND, "Could not find peer "
- "%s(%s)", peerctx->peername, uuid_utoa (peerctx->peerid));
+ "%s(%s)", peerctx->peername,
+ uuid_utoa (peerctx->peerid));
+
ret = -1;
goto out;
}