summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorKrishnan Parthasarathi <kparthas@redhat.com>2014-05-02 15:09:25 +0530
committerKaushal M <kaushal@redhat.com>2014-05-06 21:46:57 -0700
commit451246a58dbbc1ec777f379a6b779be374379abd (patch)
tree253bf0cb525bee785f20e2458011ec5f6e715856 /xlators
parentf9672386ac2e3da2dc5439eb0a3a53dfaa5181dd (diff)
glusterd: port network failure log messages to gf_msg API
Change-Id: I23df6d179e9d66a71721e9844a34c5b96586f90f BUG: 1075611 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/7462 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handler.c20
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-messages.h10
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-rebalance.c14
3 files changed, 33 insertions, 11 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index 22bae44cd0d..722ab983e40 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
@@ -51,6 +51,7 @@
#include "globals.h"
#include "glusterd-syncop.h"
+#include "glusterd-messages.h"
#ifdef HAVE_BD_XLATOR
#include <lvm2app.h>
@@ -4119,8 +4120,10 @@ __glusterd_brick_rpc_notify (struct rpc_clnt *rpc, void *mydata,
case RPC_CLNT_DISCONNECT:
if (glusterd_is_brick_started (brickinfo))
- gf_log (this->name, GF_LOG_INFO, "Disconnected from "
- "%s:%s", brickinfo->hostname, brickinfo->path);
+ gf_msg (this->name, GF_LOG_INFO, 0,
+ GD_MSG_BRICK_DISCONNECTED,
+ "Brick %s:%s has disconnected from glusterd.",
+ brickinfo->hostname, brickinfo->path);
glusterd_set_brick_status (brickinfo, GF_BRICK_STOPPED);
break;
@@ -4175,9 +4178,9 @@ __glusterd_nodesvc_rpc_notify (struct rpc_clnt *rpc, void *mydata,
case RPC_CLNT_DISCONNECT:
if (glusterd_is_nodesvc_online (server)) {
- gf_log (this->name, GF_LOG_DEBUG,
- "got RPC_CLNT_DISCONNECT");
- (void) glusterd_nodesvc_set_online_status (server, _gf_false);
+ gf_msg (this->name, GF_LOG_INFO, 0, GD_MSG_NODE_DISCONNECTED,
+ "%s has disconnected from glusterd.", server);
+ (void) glusterd_nodesvc_set_online_status (server, _gf_false);
}
break;
@@ -4280,8 +4283,11 @@ __glusterd_peer_rpc_notify (struct rpc_clnt *rpc, void *mydata,
case RPC_CLNT_DISCONNECT:
{
rpc_clnt_unset_connected (&rpc->conn);
- gf_log (this->name, GF_LOG_DEBUG, "got RPC_CLNT_DISCONNECT %d",
- peerinfo->state.state);
+ gf_msg (this->name, GF_LOG_INFO, 0,
+ GD_MSG_PEER_DISCONNECTED,
+ "Peer %s, in %s state, has disconnected from glusterd.",
+ uuid_utoa (peerinfo->uuid),
+ glusterd_friend_sm_state_name_get (peerinfo->state.state));
if (peerinfo->connected) {
if (conf->op_version < GD_OP_VERSION_4) {
diff --git a/xlators/mgmt/glusterd/src/glusterd-messages.h b/xlators/mgmt/glusterd/src/glusterd-messages.h
index bfe73a0f3a4..54fd7e2cf7b 100644
--- a/xlators/mgmt/glusterd/src/glusterd-messages.h
+++ b/xlators/mgmt/glusterd/src/glusterd-messages.h
@@ -41,7 +41,7 @@
*/
#define GLUSTERD_COMP_BASE GLFS_MSGID_GLUSTERD
-#define GLFS_NUM_MESSAGES 3
+#define GLFS_NUM_MESSAGES 7
#define GLFS_MSGID_END (GLUSTERD_COMP_BASE + GLFS_NUM_MESSAGES + 1)
/* Messaged with message IDs */
#define glfs_msg_start_x GLFS_COMP_BASE, "Invalid: Start of messages"
@@ -53,6 +53,14 @@
#define GD_MSG_SERVER_QUORUM_MET_STARTING_BRICKS (GLUSTERD_COMP_BASE + 3)
+#define GD_MSG_PEER_DISCONNECTED (GLUSTERD_COMP_BASE + 4)
+
+#define GD_MSG_BRICK_DISCONNECTED (GLUSTERD_COMP_BASE + 5)
+
+#define GD_MSG_NODE_DISCONNECTED (GLUSTERD_COMP_BASE + 6)
+
+#define GD_MSG_REBALANCE_DISCONNECTED (GLUSTERD_COMP_BASE + 7)
+
/*------------*/
#define glfs_msg_end_x GLFS_MSGID_END, "Invalid: End of messages"
diff --git a/xlators/mgmt/glusterd/src/glusterd-rebalance.c b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
index 4186946c183..763ceb74912 100644
--- a/xlators/mgmt/glusterd/src/glusterd-rebalance.c
+++ b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
@@ -32,6 +32,7 @@
#include "glusterd-store.h"
#include "run.h"
#include "glusterd-volgen.h"
+#include "glusterd-messages.h"
#include "syscall.h"
#include "cli1-xdr.h"
@@ -95,8 +96,13 @@ __glusterd_defrag_notify (struct rpc_clnt *rpc, void *mydata,
int ret = 0;
char pidfile[PATH_MAX];
glusterd_conf_t *priv = NULL;
+ xlator_t *this = NULL;
- priv = THIS->private;
+ this = THIS;
+ if (!this)
+ return 0;
+
+ priv = this->private;
if (!priv)
return 0;
@@ -160,8 +166,10 @@ __glusterd_defrag_notify (struct rpc_clnt *rpc, void *mydata,
volinfo->rebal.defrag_status);
GF_FREE (defrag);
- gf_log ("", GF_LOG_DEBUG, "%s got RPC_CLNT_DISCONNECT",
- rpc->conn.name);
+ gf_msg (this->name, GF_LOG_INFO, 0,
+ GD_MSG_REBALANCE_DISCONNECTED,
+ "Rebalance process for volume %s has disconnected.",
+ volinfo->volname);
break;
}
case RPC_CLNT_DESTROY: