|
|
cb8e9e |
From d7f00db9f94b1e68f0a7e0fbd4e30a69a1fd04d2 Mon Sep 17 00:00:00 2001
|
|
|
cb8e9e |
From: Nandaja Varma <nandaja.varma@gmail.com>
|
|
|
cb8e9e |
Date: Tue, 17 Mar 2015 18:03:36 +0530
|
|
|
cb8e9e |
Subject: [PATCH 089/101] handler, messages/glusterd: Porting to new logging framework
|
|
|
cb8e9e |
|
|
|
cb8e9e |
cherry-picked from commit cdda561c0a1f4c8050f664a444fe8b88d17e3b10
|
|
|
cb8e9e |
>Change-Id: If67230445678dd895d69f18c9982c3f0fda62dbd
|
|
|
cb8e9e |
>BUG: 1194640
|
|
|
cb8e9e |
>Signed-off-by: Nandaja Varma <nandaja.varma@gmail.com>
|
|
|
cb8e9e |
>Reviewed-on: http://review.gluster.org/9910
|
|
|
cb8e9e |
>Tested-by: NetBSD Build System <jenkins@build.gluster.org>
|
|
|
cb8e9e |
>Tested-by: Gluster Build System <jenkins@build.gluster.com>
|
|
|
cb8e9e |
>Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
|
|
cb8e9e |
|
|
|
cb8e9e |
Change-Id: If67230445678dd895d69f18c9982c3f0fda62dbd
|
|
|
cb8e9e |
BUG: 1231771
|
|
|
cb8e9e |
Signed-off-by: Nandaja Varma <nvarma@redhat.com>
|
|
|
cb8e9e |
Reviewed-on: https://code.engineering.redhat.com/gerrit/50894
|
|
|
cb8e9e |
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
|
|
cb8e9e |
Tested-by: Atin Mukherjee <amukherj@redhat.com>
|
|
|
cb8e9e |
---
|
|
|
cb8e9e |
xlators/mgmt/glusterd/src/glusterd-handler.c | 495 +++++++++++++-------
|
|
|
cb8e9e |
xlators/mgmt/glusterd/src/glusterd-replace-brick.c | 149 ++++---
|
|
|
cb8e9e |
2 files changed, 428 insertions(+), 216 deletions(-)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
|
|
|
cb8e9e |
index 9c922e3..683b402 100644
|
|
|
cb8e9e |
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
|
|
|
cb8e9e |
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
|
|
|
cb8e9e |
@@ -123,7 +123,9 @@ glusterd_handle_friend_req (rpcsvc_request_t *req, uuid_t uuid,
|
|
|
cb8e9e |
(GD_FRIEND_EVENT_RCVD_FRIEND_REQ, &event);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "event generation failed: %d", ret);
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_EVENT_NEW_GET_FAIL,
|
|
|
cb8e9e |
+ "event generation failed: %d", ret);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -133,7 +135,8 @@ glusterd_handle_friend_req (rpcsvc_request_t *req, uuid_t uuid,
|
|
|
cb8e9e |
ctx = GF_CALLOC (1, sizeof (*ctx), gf_gld_mt_friend_req_ctx_t);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!ctx) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "Unable to allocate memory");
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, ENOMEM,
|
|
|
cb8e9e |
+ GD_MSG_NO_MEMORY, "Unable to allocate memory");
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -163,7 +166,9 @@ glusterd_handle_friend_req (rpcsvc_request_t *req, uuid_t uuid,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = glusterd_friend_sm_inject_event (event);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_ERROR, "Unable to inject event %d, "
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_EVENT_INJECT_FAIL,
|
|
|
cb8e9e |
+ "Unable to inject event %d, "
|
|
|
cb8e9e |
"ret = %d", event->event, ret);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -213,7 +218,8 @@ glusterd_handle_unfriend_req (rpcsvc_request_t *req, uuid_t uuid,
|
|
|
cb8e9e |
peerinfo = glusterd_peerinfo_find (uuid, hostname);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (peerinfo == NULL) {
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_CRITICAL,
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_CRITICAL, 0,
|
|
|
cb8e9e |
+ GD_MSG_REQ_FROM_UNKNOWN_PEER,
|
|
|
cb8e9e |
"Received remove-friend from unknown peer %s",
|
|
|
cb8e9e |
hostname);
|
|
|
cb8e9e |
ret = glusterd_xfer_friend_remove_resp (req, hostname,
|
|
|
cb8e9e |
@@ -225,7 +231,9 @@ glusterd_handle_unfriend_req (rpcsvc_request_t *req, uuid_t uuid,
|
|
|
cb8e9e |
(GD_FRIEND_EVENT_RCVD_REMOVE_FRIEND, &event);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "event generation failed: %d", ret);
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_EVENT_NEW_GET_FAIL,
|
|
|
cb8e9e |
+ "event generation failed: %d", ret);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -235,7 +243,8 @@ glusterd_handle_unfriend_req (rpcsvc_request_t *req, uuid_t uuid,
|
|
|
cb8e9e |
ctx = GF_CALLOC (1, sizeof (*ctx), gf_gld_mt_friend_req_ctx_t);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!ctx) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "Unable to allocate memory");
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, ENOMEM,
|
|
|
cb8e9e |
+ GD_MSG_NO_MEMORY, "Unable to allocate memory");
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -250,7 +259,8 @@ glusterd_handle_unfriend_req (rpcsvc_request_t *req, uuid_t uuid,
|
|
|
cb8e9e |
ret = glusterd_friend_sm_inject_event (event);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_ERROR, "Unable to inject event %d, "
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_EVENT_INJECT_FAIL, "Unable to inject event %d, "
|
|
|
cb8e9e |
"ret = %d", event->event, ret);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -652,7 +662,8 @@ glusterd_op_txn_begin (rpcsvc_request_t *req, glusterd_op_t op, void *ctx,
|
|
|
cb8e9e |
* op state machine. */
|
|
|
cb8e9e |
ret = glusterd_generate_txn_id (dict, &txn_id);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_TRANS_IDGEN_FAIL,
|
|
|
cb8e9e |
"Failed to generate transaction id");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -662,7 +673,8 @@ glusterd_op_txn_begin (rpcsvc_request_t *req, glusterd_op_t op, void *ctx,
|
|
|
cb8e9e |
* is the originator node for a command. */
|
|
|
cb8e9e |
ret = glusterd_set_originator_uuid (dict);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_UUID_SET_FAIL,
|
|
|
cb8e9e |
"Failed to set originator_uuid.");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -671,7 +683,8 @@ glusterd_op_txn_begin (rpcsvc_request_t *req, glusterd_op_t op, void *ctx,
|
|
|
cb8e9e |
if (priv->op_version < GD_OP_VERSION_RHS_3_0) {
|
|
|
cb8e9e |
ret = glusterd_lock (MY_UUID);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_GLUSTERD_LOCK_FAIL,
|
|
|
cb8e9e |
"Unable to acquire lock on localhost, ret: %d",
|
|
|
cb8e9e |
ret);
|
|
|
cb8e9e |
snprintf (err_str, err_len,
|
|
|
cb8e9e |
@@ -684,7 +697,7 @@ glusterd_op_txn_begin (rpcsvc_request_t *req, glusterd_op_t op, void *ctx,
|
|
|
cb8e9e |
* not be held */
|
|
|
cb8e9e |
ret = dict_get_str (dict, "volname", &tmp);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_INFO,
|
|
|
cb8e9e |
+ gf_log (this->name, GF_LOG_INFO,
|
|
|
cb8e9e |
"No Volume name present. "
|
|
|
cb8e9e |
"Locks not being held.");
|
|
|
cb8e9e |
goto local_locking_done;
|
|
|
cb8e9e |
@@ -700,7 +713,8 @@ glusterd_op_txn_begin (rpcsvc_request_t *req, glusterd_op_t op, void *ctx,
|
|
|
cb8e9e |
ret = glusterd_mgmt_v3_lock (volname, MY_UUID, &op_errno,
|
|
|
cb8e9e |
"vol");
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_MGMTV3_LOCK_GET_FAIL,
|
|
|
cb8e9e |
"Unable to acquire lock for %s", volname);
|
|
|
cb8e9e |
snprintf (err_str, err_len,
|
|
|
cb8e9e |
"Another transaction is in progress for %s. "
|
|
|
cb8e9e |
@@ -710,7 +724,7 @@ glusterd_op_txn_begin (rpcsvc_request_t *req, glusterd_op_t op, void *ctx,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
locked = 1;
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "Acquired lock on localhost");
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "Acquired lock on localhost");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
local_locking_done:
|
|
|
cb8e9e |
/* If no volname is given as a part of the command, locks will
|
|
|
cb8e9e |
@@ -727,7 +741,8 @@ local_locking_done:
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = glusterd_set_txn_opinfo (txn_id, &txn_op_info);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_TRANS_OPINFO_SET_FAIL,
|
|
|
cb8e9e |
"Unable to set transaction's opinfo");
|
|
|
cb8e9e |
if (ctx)
|
|
|
cb8e9e |
dict_unref (ctx);
|
|
|
cb8e9e |
@@ -736,7 +751,8 @@ local_locking_done:
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = glusterd_op_sm_inject_event (event_type, txn_id, ctx);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to acquire cluster"
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_EVENT_INJECT_FAIL, "Failed to acquire cluster"
|
|
|
cb8e9e |
" lock.");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -751,7 +767,8 @@ out:
|
|
|
cb8e9e |
ret = glusterd_mgmt_v3_unlock (volname, MY_UUID,
|
|
|
cb8e9e |
"vol");
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_MGMTV3_UNLOCK_FAIL,
|
|
|
cb8e9e |
"Unable to release lock for %s",
|
|
|
cb8e9e |
volname);
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
@@ -761,7 +778,7 @@ out:
|
|
|
cb8e9e |
if (volname)
|
|
|
cb8e9e |
GF_FREE (volname);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "Returning %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "Returning %d", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -789,20 +806,22 @@ __glusterd_handle_cluster_lock (rpcsvc_request_t *req)
|
|
|
cb8e9e |
ret = xdr_to_generic (req->msg[0], &lock_req,
|
|
|
cb8e9e |
(xdrproc_t)xdr_gd1_mgmt_cluster_lock_req);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to decode lock "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_REQ_DECODE_FAIL, "Failed to decode lock "
|
|
|
cb8e9e |
"request received from peer");
|
|
|
cb8e9e |
req->rpc_err = GARBAGE_ARGS;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "Received LOCK from uuid: %s",
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "Received LOCK from uuid: %s",
|
|
|
cb8e9e |
uuid_utoa (lock_req.uuid));
|
|
|
cb8e9e |
|
|
|
cb8e9e |
rcu_read_lock ();
|
|
|
cb8e9e |
ret = (glusterd_peerinfo_find_by_uuid (lock_req.uuid) == NULL);
|
|
|
cb8e9e |
rcu_read_unlock ();
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "%s doesn't "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ GD_MSG_PEER_NOT_FOUND, "%s doesn't "
|
|
|
cb8e9e |
"belong to the cluster. Ignoring request.",
|
|
|
cb8e9e |
uuid_utoa (lock_req.uuid));
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
@@ -822,7 +841,8 @@ __glusterd_handle_cluster_lock (rpcsvc_request_t *req)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
op_ctx = dict_new ();
|
|
|
cb8e9e |
if (!op_ctx) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, ENOMEM,
|
|
|
cb8e9e |
+ GD_MSG_DICT_CREATE_FAIL,
|
|
|
cb8e9e |
"Unable to set new dict");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -831,7 +851,8 @@ __glusterd_handle_cluster_lock (rpcsvc_request_t *req)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = glusterd_set_txn_opinfo (txn_id, &txn_op_info);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_TRANS_OPINFO_SET_FAIL,
|
|
|
cb8e9e |
"Unable to set transaction's opinfo");
|
|
|
cb8e9e |
dict_unref (txn_op_info.op_ctx);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -839,11 +860,12 @@ __glusterd_handle_cluster_lock (rpcsvc_request_t *req)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = glusterd_op_sm_inject_event (GD_OP_EVENT_LOCK, txn_id, ctx);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_EVENT_INJECT_FAIL,
|
|
|
cb8e9e |
"Failed to inject event GD_OP_EVENT_LOCK");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "Returning %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "Returning %d", ret);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
glusterd_friend_sm ();
|
|
|
cb8e9e |
glusterd_op_sm ();
|
|
|
cb8e9e |
@@ -875,7 +897,7 @@ glusterd_req_ctx_create (rpcsvc_request_t *rpc_req,
|
|
|
cb8e9e |
GF_ASSERT (this);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
gf_uuid_unparse (uuid, str);
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "Received op from uuid %s", str);
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "Received op from uuid %s", str);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
dict = dict_new ();
|
|
|
cb8e9e |
if (!dict)
|
|
|
cb8e9e |
@@ -890,7 +912,8 @@ glusterd_req_ctx_create (rpcsvc_request_t *rpc_req,
|
|
|
cb8e9e |
req_ctx->op = op;
|
|
|
cb8e9e |
ret = dict_unserialize (buf_val, buf_len, &dict);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_UNSERIALIZE_FAIL,
|
|
|
cb8e9e |
"failed to unserialize the dictionary");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -931,7 +954,8 @@ __glusterd_handle_stage_op (rpcsvc_request_t *req)
|
|
|
cb8e9e |
ret = xdr_to_generic (req->msg[0], &op_req,
|
|
|
cb8e9e |
(xdrproc_t)xdr_gd1_mgmt_stage_op_req);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to decode stage "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_REQ_DECODE_FAIL, "Failed to decode stage "
|
|
|
cb8e9e |
"request received from peer");
|
|
|
cb8e9e |
req->rpc_err = GARBAGE_ARGS;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -941,19 +965,21 @@ __glusterd_handle_stage_op (rpcsvc_request_t *req)
|
|
|
cb8e9e |
op_req.buf.buf_val, op_req.buf.buf_len,
|
|
|
cb8e9e |
gf_gld_mt_op_stage_ctx_t, &req_ctx);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to create req_ctx");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_REQ_CTX_CREATE_FAIL, "Failed to create req_ctx");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_bin (req_ctx->dict, "transaction_id", (void **)&txn_id);
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "transaction ID = %s",
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "transaction ID = %s",
|
|
|
cb8e9e |
uuid_utoa (*txn_id));
|
|
|
cb8e9e |
|
|
|
cb8e9e |
rcu_read_lock ();
|
|
|
cb8e9e |
ret = (glusterd_peerinfo_find_by_uuid (op_req.uuid) == NULL);
|
|
|
cb8e9e |
rcu_read_unlock ();
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "%s doesn't "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ GD_MSG_PEER_NOT_FOUND, "%s doesn't "
|
|
|
cb8e9e |
"belong to the cluster. Ignoring request.",
|
|
|
cb8e9e |
uuid_utoa (op_req.uuid));
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
@@ -965,7 +991,7 @@ __glusterd_handle_stage_op (rpcsvc_request_t *req)
|
|
|
cb8e9e |
* phase where the transaction opinfos are created, won't be called. */
|
|
|
cb8e9e |
ret = glusterd_get_txn_opinfo (txn_id, &txn_op_info);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0,
|
|
|
cb8e9e |
"No transaction's opinfo set");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
state.state = GD_OP_STATE_LOCKED;
|
|
|
cb8e9e |
@@ -974,7 +1000,8 @@ __glusterd_handle_stage_op (rpcsvc_request_t *req)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = glusterd_set_txn_opinfo (txn_id, &txn_op_info);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_TRANS_OPINFO_SET_FAIL,
|
|
|
cb8e9e |
"Unable to set transaction's opinfo");
|
|
|
cb8e9e |
dict_unref (req_ctx->dict);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -984,7 +1011,8 @@ __glusterd_handle_stage_op (rpcsvc_request_t *req)
|
|
|
cb8e9e |
ret = glusterd_op_sm_inject_event (GD_OP_EVENT_STAGE_OP,
|
|
|
cb8e9e |
txn_id, req_ctx);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_EVENT_INJECT_FAIL,
|
|
|
cb8e9e |
"Failed to inject event GD_OP_EVENT_STAGE_OP");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -1022,7 +1050,8 @@ __glusterd_handle_commit_op (rpcsvc_request_t *req)
|
|
|
cb8e9e |
ret = xdr_to_generic (req->msg[0], &op_req,
|
|
|
cb8e9e |
(xdrproc_t)xdr_gd1_mgmt_commit_op_req);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to decode commit "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_REQ_DECODE_FAIL, "Failed to decode commit "
|
|
|
cb8e9e |
"request received from peer");
|
|
|
cb8e9e |
req->rpc_err = GARBAGE_ARGS;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -1032,7 +1061,8 @@ __glusterd_handle_commit_op (rpcsvc_request_t *req)
|
|
|
cb8e9e |
ret = (glusterd_peerinfo_find_by_uuid (op_req.uuid) == NULL);
|
|
|
cb8e9e |
rcu_read_unlock ();
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "%s doesn't "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ GD_MSG_PEER_NOT_FOUND, "%s doesn't "
|
|
|
cb8e9e |
"belong to the cluster. Ignoring request.",
|
|
|
cb8e9e |
uuid_utoa (op_req.uuid));
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
@@ -1048,7 +1078,7 @@ __glusterd_handle_commit_op (rpcsvc_request_t *req)
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_bin (req_ctx->dict, "transaction_id", (void **)&txn_id);
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "transaction ID = %s",
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "transaction ID = %s",
|
|
|
cb8e9e |
uuid_utoa (*txn_id));
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = glusterd_op_sm_inject_event (GD_OP_EVENT_COMMIT_OP,
|
|
|
cb8e9e |
@@ -1087,7 +1117,8 @@ __glusterd_handle_cli_probe (rpcsvc_request_t *req)
|
|
|
cb8e9e |
ret = xdr_to_generic (req->msg[0], &cli_req, (xdrproc_t)xdr_gf_cli_req);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
//failed to decode msg;
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "xdr decoding error");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_REQ_DECODE_FAIL, "xdr decoding error");
|
|
|
cb8e9e |
req->rpc_err = GARBAGE_ARGS;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -1098,7 +1129,8 @@ __glusterd_handle_cli_probe (rpcsvc_request_t *req)
|
|
|
cb8e9e |
ret = dict_unserialize (cli_req.dict.dict_val,
|
|
|
cb8e9e |
cli_req.dict.dict_len, &dict);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_UNSERIALIZE_FAIL, "Failed to "
|
|
|
cb8e9e |
"unserialize req-buffer to dictionary");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -1106,13 +1138,16 @@ __glusterd_handle_cli_probe (rpcsvc_request_t *req)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_str (dict, "hostname", &hostname);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to get hostname");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_HOSTNAME_NOTFOUND_IN_DICT,
|
|
|
cb8e9e |
+ "Failed to get hostname");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_int32 (dict, "port", &port);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to get port");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_PORT_NOTFOUND_IN_DICT, "Failed to get port");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -1132,7 +1167,7 @@ __glusterd_handle_cli_probe (rpcsvc_request_t *req)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (dict_get_str(this->options,"transport.socket.bind-address",
|
|
|
cb8e9e |
&bind_name) == 0) {
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug ("glusterd", 0,
|
|
|
cb8e9e |
"only checking probe address vs. bind address");
|
|
|
cb8e9e |
ret = gf_is_same_address (bind_name, hostname);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -1154,7 +1189,7 @@ __glusterd_handle_cli_probe (rpcsvc_request_t *req)
|
|
|
cb8e9e |
rcu_read_unlock ();
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_DEBUG, "Probe host %s port %d "
|
|
|
cb8e9e |
+ gf_msg_debug ("glusterd", 0, "Probe host %s port %d "
|
|
|
cb8e9e |
"already a peer", hostname, port);
|
|
|
cb8e9e |
glusterd_xfer_cli_probe_resp (req, 0, GF_PROBE_FRIEND, NULL,
|
|
|
cb8e9e |
hostname, port, dict);
|
|
|
cb8e9e |
@@ -1218,6 +1253,9 @@ __glusterd_handle_cli_deprobe (rpcsvc_request_t *req)
|
|
|
cb8e9e |
(xdrproc_t)xdr_gf_cli_req);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
//failed to decode msg;
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_REQ_DECODE_FAIL, "Failed to decode "
|
|
|
cb8e9e |
+ "request received from cli");
|
|
|
cb8e9e |
req->rpc_err = GARBAGE_ARGS;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -1228,7 +1266,8 @@ __glusterd_handle_cli_deprobe (rpcsvc_request_t *req)
|
|
|
cb8e9e |
ret = dict_unserialize (cli_req.dict.dict_val,
|
|
|
cb8e9e |
cli_req.dict.dict_len, &dict);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_UNSERIALIZE_FAIL, "Failed to "
|
|
|
cb8e9e |
"unserialize req-buffer to dictionary");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -1238,18 +1277,22 @@ __glusterd_handle_cli_deprobe (rpcsvc_request_t *req)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_str (dict, "hostname", &hostname);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to get hostname");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_HOSTNAME_NOTFOUND_IN_DICT,
|
|
|
cb8e9e |
+ "Failed to get hostname");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_int32 (dict, "port", &port);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to get port");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_PORT_NOTFOUND_IN_DICT, "Failed to get port");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = dict_get_int32 (dict, "flags", &flags);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to get flags");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_FLAGS_NOTFOUND_IN_DICT, "Failed to get flags");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -1342,6 +1385,9 @@ __glusterd_handle_cli_list_friends (rpcsvc_request_t *req)
|
|
|
cb8e9e |
(xdrproc_t)xdr_gf1_cli_peer_list_req);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
//failed to decode msg;
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_REQ_DECODE_FAIL, "Failed to decode "
|
|
|
cb8e9e |
+ "request received from cli");
|
|
|
cb8e9e |
req->rpc_err = GARBAGE_ARGS;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -1356,7 +1402,8 @@ __glusterd_handle_cli_list_friends (rpcsvc_request_t *req)
|
|
|
cb8e9e |
cli_req.dict.dict_len,
|
|
|
cb8e9e |
&dict);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_UNSERIALIZE_FAIL,
|
|
|
cb8e9e |
"failed to "
|
|
|
cb8e9e |
"unserialize req-buffer to dictionary");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -1397,6 +1444,9 @@ __glusterd_handle_cli_get_volume (rpcsvc_request_t *req)
|
|
|
cb8e9e |
ret = xdr_to_generic (req->msg[0], &cli_req, (xdrproc_t)xdr_gf_cli_req);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
//failed to decode msg;
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_REQ_DECODE_FAIL, "Failed to decode "
|
|
|
cb8e9e |
+ "request received from cli");
|
|
|
cb8e9e |
req->rpc_err = GARBAGE_ARGS;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -1411,7 +1461,8 @@ __glusterd_handle_cli_get_volume (rpcsvc_request_t *req)
|
|
|
cb8e9e |
cli_req.dict.dict_len,
|
|
|
cb8e9e |
&dict);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_UNSERIALIZE_FAIL,
|
|
|
cb8e9e |
"failed to "
|
|
|
cb8e9e |
"unserialize req-buffer to dictionary");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -1422,7 +1473,8 @@ __glusterd_handle_cli_get_volume (rpcsvc_request_t *req)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_int32 (dict, "flags", &flags);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_ERROR, "failed to get flags");
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_FLAGS_NOTFOUND_IN_DICT, "failed to get flags");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -1466,11 +1518,14 @@ __glusterd_handle_cli_uuid_reset (rpcsvc_request_t *req)
|
|
|
cb8e9e |
ret = xdr_to_generic (req->msg[0], &cli_req, (xdrproc_t)xdr_gf_cli_req);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
//failed to decode msg;
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_REQ_DECODE_FAIL, "Failed to decode "
|
|
|
cb8e9e |
+ "request received from cli");
|
|
|
cb8e9e |
req->rpc_err = GARBAGE_ARGS;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_DEBUG, "Received uuid reset req");
|
|
|
cb8e9e |
+ gf_msg_debug ("glusterd", 0, "Received uuid reset req");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (cli_req.dict.dict_len) {
|
|
|
cb8e9e |
/* Unserialize the dictionary */
|
|
|
cb8e9e |
@@ -1480,7 +1535,8 @@ __glusterd_handle_cli_uuid_reset (rpcsvc_request_t *req)
|
|
|
cb8e9e |
cli_req.dict.dict_len,
|
|
|
cb8e9e |
&dict);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_UNSERIALIZE_FAIL,
|
|
|
cb8e9e |
"failed to "
|
|
|
cb8e9e |
"unserialize req-buffer to dictionary");
|
|
|
cb8e9e |
snprintf (msg_str, sizeof (msg_str), "Unable to decode "
|
|
|
cb8e9e |
@@ -1500,7 +1556,8 @@ __glusterd_handle_cli_uuid_reset (rpcsvc_request_t *req)
|
|
|
cb8e9e |
snprintf (msg_str, sizeof (msg_str), "volumes are already "
|
|
|
cb8e9e |
"present in the cluster. Resetting uuid is not "
|
|
|
cb8e9e |
"allowed");
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "%s", msg_str);
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ GD_MSG_VOLS_ALREADY_PRESENT, "%s", msg_str);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -1509,7 +1566,8 @@ __glusterd_handle_cli_uuid_reset (rpcsvc_request_t *req)
|
|
|
cb8e9e |
snprintf (msg_str, sizeof (msg_str),"trusted storage pool "
|
|
|
cb8e9e |
"has been already formed. Please detach this peer "
|
|
|
cb8e9e |
"from the pool and reset its uuid.");
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "%s", msg_str);
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ GD_MSG_TSP_ALREADY_FORMED, "%s", msg_str);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -1519,7 +1577,8 @@ __glusterd_handle_cli_uuid_reset (rpcsvc_request_t *req)
|
|
|
cb8e9e |
if (!gf_uuid_compare (uuid, MY_UUID)) {
|
|
|
cb8e9e |
snprintf (msg_str, sizeof (msg_str), "old uuid and the new uuid"
|
|
|
cb8e9e |
" are same. Try gluster peer reset again");
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "%s", msg_str);
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_UUIDS_SAME_RETRY, "%s", msg_str);
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -1570,11 +1629,14 @@ __glusterd_handle_cli_uuid_get (rpcsvc_request_t *req)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = xdr_to_generic (req->msg[0], &cli_req, (xdrproc_t)xdr_gf_cli_req);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_REQ_DECODE_FAIL, "Failed to decode "
|
|
|
cb8e9e |
+ "request received from cli");
|
|
|
cb8e9e |
req->rpc_err = GARBAGE_ARGS;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_DEBUG, "Received uuid get req");
|
|
|
cb8e9e |
+ gf_msg_debug ("glusterd", 0, "Received uuid get req");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (cli_req.dict.dict_len) {
|
|
|
cb8e9e |
dict = dict_new ();
|
|
|
cb8e9e |
@@ -1587,7 +1649,8 @@ __glusterd_handle_cli_uuid_get (rpcsvc_request_t *req)
|
|
|
cb8e9e |
cli_req.dict.dict_len,
|
|
|
cb8e9e |
&dict);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_UNSERIALIZE_FAIL,
|
|
|
cb8e9e |
"failed to "
|
|
|
cb8e9e |
"unserialize req-buffer to dictionary");
|
|
|
cb8e9e |
snprintf (msg_str, sizeof (msg_str), "Unable to decode "
|
|
|
cb8e9e |
@@ -1609,7 +1672,8 @@ __glusterd_handle_cli_uuid_get (rpcsvc_request_t *req)
|
|
|
cb8e9e |
uuid_utoa_r (MY_UUID, uuid_str);
|
|
|
cb8e9e |
ret = dict_set_str (rsp_dict, "uuid", uuid_str);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to set uuid in "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_SET_FAILED, "Failed to set uuid in "
|
|
|
cb8e9e |
"dictionary.");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -1617,7 +1681,9 @@ __glusterd_handle_cli_uuid_get (rpcsvc_request_t *req)
|
|
|
cb8e9e |
ret = dict_allocate_and_serialize (rsp_dict, &rsp.dict.dict_val,
|
|
|
cb8e9e |
&rsp.dict.dict_len);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to serialize "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_SERL_LENGTH_GET_FAIL,
|
|
|
cb8e9e |
+ "Failed to serialize "
|
|
|
cb8e9e |
"dictionary.");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -1747,7 +1813,8 @@ __glusterd_handle_ganesha_cmd (rpcsvc_request_t *req)
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
snprintf (err_str, sizeof (err_str), "Failed to decode "
|
|
|
cb8e9e |
"request received from cli");
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "%s", err_str);
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_REQ_DECODE_FAIL, "%s", err_str);
|
|
|
cb8e9e |
req->rpc_err = GARBAGE_ARGS;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -1764,7 +1831,8 @@ __glusterd_handle_ganesha_cmd (rpcsvc_request_t *req)
|
|
|
cb8e9e |
cli_req.dict.dict_len,
|
|
|
cb8e9e |
&dict);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_UNSERIALIZE_FAIL,
|
|
|
cb8e9e |
"failed to "
|
|
|
cb8e9e |
"unserialize req-buffer to dictionary");
|
|
|
cb8e9e |
snprintf (err_str, sizeof (err_str), "Unable to decode "
|
|
|
cb8e9e |
@@ -1820,7 +1888,8 @@ __glusterd_handle_reset_volume (rpcsvc_request_t *req)
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
snprintf (err_str, sizeof (err_str), "Failed to decode request "
|
|
|
cb8e9e |
"received from cli");
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "%s", err_str);
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_REQ_DECODE_FAIL, "%s", err_str);
|
|
|
cb8e9e |
req->rpc_err = GARBAGE_ARGS;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -1833,8 +1902,9 @@ __glusterd_handle_reset_volume (rpcsvc_request_t *req)
|
|
|
cb8e9e |
cli_req.dict.dict_len,
|
|
|
cb8e9e |
&dict);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "failed to "
|
|
|
cb8e9e |
- "unserialize req-buffer to dictionary");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_UNSERIALIZE_FAIL, "failed to "
|
|
|
cb8e9e |
+ "unserialize req-buffer to dictionary");
|
|
|
cb8e9e |
snprintf (err_str, sizeof (err_str), "Unable to decode "
|
|
|
cb8e9e |
"the command");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -1847,10 +1917,11 @@ __glusterd_handle_reset_volume (rpcsvc_request_t *req)
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
snprintf (err_str, sizeof (err_str), "Failed to get volume "
|
|
|
cb8e9e |
"name");
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "%s", err_str);
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_VOLNAME_NOTFOUND_IN_DICT, "%s", err_str);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "Received volume reset request for "
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "Received volume reset request for "
|
|
|
cb8e9e |
"volume %s", volname);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = glusterd_op_begin_synctask (req, GD_OP_RESET_VOLUME, dict);
|
|
|
cb8e9e |
@@ -1898,7 +1969,8 @@ __glusterd_handle_set_volume (rpcsvc_request_t *req)
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
snprintf (err_str, sizeof (err_str), "Failed to decode "
|
|
|
cb8e9e |
"request received from cli");
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "%s", err_str);
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_REQ_DECODE_FAIL, "%s", err_str);
|
|
|
cb8e9e |
req->rpc_err = GARBAGE_ARGS;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -1911,7 +1983,8 @@ __glusterd_handle_set_volume (rpcsvc_request_t *req)
|
|
|
cb8e9e |
cli_req.dict.dict_len,
|
|
|
cb8e9e |
&dict);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, errno,
|
|
|
cb8e9e |
+ GD_MSG_DICT_UNSERIALIZE_FAIL,
|
|
|
cb8e9e |
"failed to "
|
|
|
cb8e9e |
"unserialize req-buffer to dictionary");
|
|
|
cb8e9e |
snprintf (err_str, sizeof (err_str), "Unable to decode "
|
|
|
cb8e9e |
@@ -1926,7 +1999,8 @@ __glusterd_handle_set_volume (rpcsvc_request_t *req)
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
snprintf (err_str, sizeof (err_str), "Failed to get volume "
|
|
|
cb8e9e |
"name while handling volume set command");
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "%s", err_str);
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED, "%s", err_str);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -1941,7 +2015,8 @@ __glusterd_handle_set_volume (rpcsvc_request_t *req)
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
snprintf (err_str, sizeof (err_str), "Failed to get key while"
|
|
|
cb8e9e |
" handling volume set for %s", volname);
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "%s", err_str);
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED, "%s", err_str);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -1949,10 +2024,11 @@ __glusterd_handle_set_volume (rpcsvc_request_t *req)
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
snprintf (err_str, sizeof (err_str), "Failed to get value while"
|
|
|
cb8e9e |
" handling volume set for %s", volname);
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "%s", err_str);
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED, "%s", err_str);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "Received volume set request for "
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "Received volume set request for "
|
|
|
cb8e9e |
"volume %s", volname);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = glusterd_op_begin_synctask (req, GD_OP_SET_VOLUME, dict);
|
|
|
cb8e9e |
@@ -2000,6 +2076,9 @@ __glusterd_handle_sync_volume (rpcsvc_request_t *req)
|
|
|
cb8e9e |
ret = xdr_to_generic (req->msg[0], &cli_req, (xdrproc_t)xdr_gf_cli_req);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
//failed to decode msg;
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_REQ_DECODE_FAIL, "%s", "Failed to decode "
|
|
|
cb8e9e |
+ "request received from cli");
|
|
|
cb8e9e |
req->rpc_err = GARBAGE_ARGS;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -2012,7 +2091,8 @@ __glusterd_handle_sync_volume (rpcsvc_request_t *req)
|
|
|
cb8e9e |
cli_req.dict.dict_len,
|
|
|
cb8e9e |
&dict);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_UNSERIALIZE_FAIL,
|
|
|
cb8e9e |
"failed to "
|
|
|
cb8e9e |
"unserialize req-buffer to dictionary");
|
|
|
cb8e9e |
snprintf (msg, sizeof (msg), "Unable to decode the "
|
|
|
cb8e9e |
@@ -2026,7 +2106,8 @@ __glusterd_handle_sync_volume (rpcsvc_request_t *req)
|
|
|
cb8e9e |
ret = dict_get_str (dict, "hostname", &hostname);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
snprintf (msg, sizeof (msg), "Failed to get hostname");
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "%s", msg);
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_HOSTNAME_NOTFOUND_IN_DICT, "%s", msg);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -2036,7 +2117,8 @@ __glusterd_handle_sync_volume (rpcsvc_request_t *req)
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
snprintf (msg, sizeof (msg), "Failed to get volume name"
|
|
|
cb8e9e |
" or flags");
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "%s", msg);
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_FLAGS_NOTFOUND_IN_DICT, "%s", msg);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -2048,7 +2130,8 @@ __glusterd_handle_sync_volume (rpcsvc_request_t *req)
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
snprintf (msg, sizeof (msg), "sync from localhost"
|
|
|
cb8e9e |
" not allowed");
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "%s", msg);
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_SYNC_FROM_LOCALHOST_UNALLOWED, "%s", msg);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -2096,7 +2179,7 @@ glusterd_fsm_log_send_resp (rpcsvc_request_t *req, int op_ret,
|
|
|
cb8e9e |
(xdrproc_t)xdr_gf1_cli_fsm_log_rsp);
|
|
|
cb8e9e |
GF_FREE (rsp.fsm_log.fsm_log_val);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_DEBUG, "Responded, ret: %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug ("glusterd", 0, "Responded, ret: %d", ret);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
return 0;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -2119,6 +2202,9 @@ __glusterd_handle_fsm_log (rpcsvc_request_t *req)
|
|
|
cb8e9e |
(xdrproc_t)xdr_gf1_cli_fsm_log_req);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
//failed to decode msg;
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_REQ_DECODE_FAIL, "Failed to decode "
|
|
|
cb8e9e |
+ "request received from client.");
|
|
|
cb8e9e |
req->rpc_err = GARBAGE_ARGS;
|
|
|
cb8e9e |
snprintf (msg, sizeof (msg), "Garbage request");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -2182,7 +2268,7 @@ glusterd_op_lock_send_resp (rpcsvc_request_t *req, int32_t status)
|
|
|
cb8e9e |
ret = glusterd_submit_reply (req, &rsp, NULL, 0, NULL,
|
|
|
cb8e9e |
(xdrproc_t)xdr_gd1_mgmt_cluster_lock_rsp);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_DEBUG, "Responded to lock, ret: %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug (THIS->name, 0, "Responded to lock, ret: %d", ret);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
return 0;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -2201,7 +2287,7 @@ glusterd_op_unlock_send_resp (rpcsvc_request_t *req, int32_t status)
|
|
|
cb8e9e |
ret = glusterd_submit_reply (req, &rsp, NULL, 0, NULL,
|
|
|
cb8e9e |
(xdrproc_t)xdr_gd1_mgmt_cluster_unlock_rsp);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_DEBUG, "Responded to unlock, ret: %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug (THIS->name, 0, "Responded to unlock, ret: %d", ret);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -2225,7 +2311,7 @@ glusterd_op_mgmt_v3_lock_send_resp (rpcsvc_request_t *req, uuid_t *txn_id,
|
|
|
cb8e9e |
ret = glusterd_submit_reply (req, &rsp, NULL, 0, NULL,
|
|
|
cb8e9e |
(xdrproc_t)xdr_gd1_mgmt_v3_lock_rsp);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_DEBUG, "Responded to mgmt_v3 lock, ret: %d",
|
|
|
cb8e9e |
+ gf_msg_debug (THIS->name, 0, "Responded to mgmt_v3 lock, ret: %d",
|
|
|
cb8e9e |
ret);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
@@ -2250,7 +2336,7 @@ glusterd_op_mgmt_v3_unlock_send_resp (rpcsvc_request_t *req, uuid_t *txn_id,
|
|
|
cb8e9e |
ret = glusterd_submit_reply (req, &rsp, NULL, 0, NULL,
|
|
|
cb8e9e |
(xdrproc_t)xdr_gd1_mgmt_v3_unlock_rsp);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_DEBUG, "Responded to mgmt_v3 unlock, ret: %d",
|
|
|
cb8e9e |
+ gf_msg_debug (THIS->name, 0, "Responded to mgmt_v3 unlock, ret: %d",
|
|
|
cb8e9e |
ret);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
@@ -2277,21 +2363,23 @@ __glusterd_handle_cluster_unlock (rpcsvc_request_t *req)
|
|
|
cb8e9e |
ret = xdr_to_generic (req->msg[0], &unlock_req,
|
|
|
cb8e9e |
(xdrproc_t)xdr_gd1_mgmt_cluster_unlock_req);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to decode unlock "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_REQ_DECODE_FAIL, "Failed to decode unlock "
|
|
|
cb8e9e |
"request received from peer");
|
|
|
cb8e9e |
req->rpc_err = GARBAGE_ARGS;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0,
|
|
|
cb8e9e |
"Received UNLOCK from uuid: %s", uuid_utoa (unlock_req.uuid));
|
|
|
cb8e9e |
|
|
|
cb8e9e |
rcu_read_lock ();
|
|
|
cb8e9e |
ret = (glusterd_peerinfo_find_by_uuid (unlock_req.uuid) == NULL);
|
|
|
cb8e9e |
rcu_read_unlock ();
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "%s doesn't "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ GD_MSG_PEER_NOT_FOUND, "%s doesn't "
|
|
|
cb8e9e |
"belong to the cluster. Ignoring request.",
|
|
|
cb8e9e |
uuid_utoa (unlock_req.uuid));
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
@@ -2302,6 +2390,8 @@ __glusterd_handle_cluster_unlock (rpcsvc_request_t *req)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!ctx) {
|
|
|
cb8e9e |
//respond here
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, ENOMEM,
|
|
|
cb8e9e |
+ GD_MSG_NO_MEMORY, "No memory.");
|
|
|
cb8e9e |
return -1;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
gf_uuid_copy (ctx->uuid, unlock_req.uuid);
|
|
|
cb8e9e |
@@ -2348,7 +2438,8 @@ glusterd_op_stage_send_resp (rpcsvc_request_t *req,
|
|
|
cb8e9e |
ret = dict_allocate_and_serialize (rsp_dict, &rsp.dict.dict_val,
|
|
|
cb8e9e |
&rsp.dict.dict_len);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_SERL_LENGTH_GET_FAIL,
|
|
|
cb8e9e |
"failed to get serialized length of dict");
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -2356,7 +2447,7 @@ glusterd_op_stage_send_resp (rpcsvc_request_t *req,
|
|
|
cb8e9e |
ret = glusterd_submit_reply (req, &rsp, NULL, 0, NULL,
|
|
|
cb8e9e |
(xdrproc_t)xdr_gd1_mgmt_stage_op_rsp);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "Responded to stage, ret: %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "Responded to stage, ret: %d", ret);
|
|
|
cb8e9e |
GF_FREE (rsp.dict.dict_val);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
@@ -2387,7 +2478,8 @@ glusterd_op_commit_send_resp (rpcsvc_request_t *req,
|
|
|
cb8e9e |
ret = dict_allocate_and_serialize (rsp_dict, &rsp.dict.dict_val,
|
|
|
cb8e9e |
&rsp.dict.dict_len);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_SERL_LENGTH_GET_FAIL,
|
|
|
cb8e9e |
"failed to get serialized length of dict");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -2397,7 +2489,7 @@ glusterd_op_commit_send_resp (rpcsvc_request_t *req,
|
|
|
cb8e9e |
ret = glusterd_submit_reply (req, &rsp, NULL, 0, NULL,
|
|
|
cb8e9e |
(xdrproc_t)xdr_gd1_mgmt_commit_op_rsp);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "Responded to commit, ret: %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "Responded to commit, ret: %d", ret);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
GF_FREE (rsp.dict.dict_val);
|
|
|
cb8e9e |
@@ -2416,6 +2508,9 @@ __glusterd_handle_incoming_friend_req (rpcsvc_request_t *req)
|
|
|
cb8e9e |
(xdrproc_t)xdr_gd1_mgmt_friend_req);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
//failed to decode msg;
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_REQ_DECODE_FAIL, "Failed to decode "
|
|
|
cb8e9e |
+ "request received from friend");
|
|
|
cb8e9e |
req->rpc_err = GARBAGE_ARGS;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -2462,6 +2557,9 @@ __glusterd_handle_incoming_unfriend_req (rpcsvc_request_t *req)
|
|
|
cb8e9e |
(xdrproc_t)xdr_gd1_mgmt_friend_req);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
//failed to decode msg;
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_REQ_DECODE_FAIL, "Failed to decode "
|
|
|
cb8e9e |
+ "request received.");
|
|
|
cb8e9e |
req->rpc_err = GARBAGE_ARGS;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -2472,7 +2570,9 @@ __glusterd_handle_incoming_unfriend_req (rpcsvc_request_t *req)
|
|
|
cb8e9e |
ret = glusterd_remote_hostname_get (req, remote_hostname,
|
|
|
cb8e9e |
sizeof (remote_hostname));
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "Unable to get the remote hostname");
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_HOSTNAME_RESOLVE_FAIL,
|
|
|
cb8e9e |
+ "Unable to get the remote hostname");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = glusterd_handle_unfriend_req (req, friend_req.uuid,
|
|
|
cb8e9e |
@@ -2511,7 +2611,7 @@ glusterd_handle_friend_update_delete (dict_t *dict)
|
|
|
cb8e9e |
ret = glusterd_friend_remove (NULL, hostname);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG, "Returning %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug ("glusterd", 0, "Returning %d", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -2526,7 +2626,8 @@ glusterd_peer_hostname_update (glusterd_peerinfo_t *peerinfo,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = gd_add_address_to_peer (peerinfo, hostname);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_HOSTNAME_ADD_TO_PEERLIST_FAIL,
|
|
|
cb8e9e |
"Couldn't add address to the peer info");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -2534,7 +2635,7 @@ glusterd_peer_hostname_update (glusterd_peerinfo_t *peerinfo,
|
|
|
cb8e9e |
if (store_update)
|
|
|
cb8e9e |
ret = glusterd_store_peerinfo (peerinfo);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG, "Returning %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug (THIS->name, 0, "Returning %d", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -2567,6 +2668,9 @@ __glusterd_handle_friend_update (rpcsvc_request_t *req)
|
|
|
cb8e9e |
(xdrproc_t)xdr_gd1_mgmt_friend_update);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
//failed to decode msg;
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_REQ_DECODE_FAIL, "Failed to decode "
|
|
|
cb8e9e |
+ "request received");
|
|
|
cb8e9e |
req->rpc_err = GARBAGE_ARGS;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -2578,7 +2682,9 @@ __glusterd_handle_friend_update (rpcsvc_request_t *req)
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
rcu_read_unlock ();
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_CRITICAL, "Received friend update request "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_CRITICAL, 0,
|
|
|
cb8e9e |
+ GD_MSG_REQ_FROM_UNKNOWN_PEER,
|
|
|
cb8e9e |
+ "Received friend update request "
|
|
|
cb8e9e |
"from unknown peer %s", uuid_utoa (friend_req.uuid));
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -2594,7 +2700,8 @@ __glusterd_handle_friend_update (rpcsvc_request_t *req)
|
|
|
cb8e9e |
friend_req.friends.friends_len,
|
|
|
cb8e9e |
&dict);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_UNSERIALIZE_FAIL,
|
|
|
cb8e9e |
"failed to "
|
|
|
cb8e9e |
"unserialize req-buffer to dictionary");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -2644,7 +2751,8 @@ __glusterd_handle_friend_update (rpcsvc_request_t *req)
|
|
|
cb8e9e |
peerinfo = gd_peerinfo_from_dict (dict, key);
|
|
|
cb8e9e |
if (peerinfo == NULL) {
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_PEERINFO_CREATE_FAIL,
|
|
|
cb8e9e |
"Could not create peerinfo from dict "
|
|
|
cb8e9e |
"for prefix %s", key);
|
|
|
cb8e9e |
goto unlock;
|
|
|
cb8e9e |
@@ -2665,7 +2773,9 @@ __glusterd_handle_friend_update (rpcsvc_request_t *req)
|
|
|
cb8e9e |
ret = gd_update_peerinfo_from_dict (peerinfo, dict,
|
|
|
cb8e9e |
key);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_PEER_INFO_UPDATE_FAIL,
|
|
|
cb8e9e |
+ "Failed to "
|
|
|
cb8e9e |
"update peer %s", peerinfo->hostname);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -2725,6 +2835,9 @@ __glusterd_handle_probe_query (rpcsvc_request_t *req)
|
|
|
cb8e9e |
(xdrproc_t)xdr_gd1_mgmt_probe_req);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
//failed to decode msg;
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_REQ_DECODE_FAIL, "Failed to decode probe "
|
|
|
cb8e9e |
+ "request");
|
|
|
cb8e9e |
req->rpc_err = GARBAGE_ARGS;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -2744,7 +2857,8 @@ __glusterd_handle_probe_query (rpcsvc_request_t *req)
|
|
|
cb8e9e |
* sending the error.
|
|
|
cb8e9e |
*/
|
|
|
cb8e9e |
if (!gf_uuid_compare (probe_req.uuid, MY_UUID)) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_ERROR, "Peer uuid %s is same as "
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_UUIDS_SAME_RETRY, "Peer uuid %s is same as "
|
|
|
cb8e9e |
"local uuid. Please check the uuid of both the peers "
|
|
|
cb8e9e |
"from %s/%s", uuid_utoa (probe_req.uuid),
|
|
|
cb8e9e |
GLUSTERD_DEFAULT_WORKDIR, GLUSTERD_INFO_FILE);
|
|
|
cb8e9e |
@@ -2757,7 +2871,9 @@ __glusterd_handle_probe_query (rpcsvc_request_t *req)
|
|
|
cb8e9e |
ret = glusterd_remote_hostname_get (req, remote_hostname,
|
|
|
cb8e9e |
sizeof (remote_hostname));
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "Unable to get the remote hostname");
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_HOSTNAME_RESOLVE_FAIL,
|
|
|
cb8e9e |
+ "Unable to get the remote hostname");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -2774,7 +2890,9 @@ __glusterd_handle_probe_query (rpcsvc_request_t *req)
|
|
|
cb8e9e |
GD_FRIEND_STATE_PROBE_RCVD,
|
|
|
cb8e9e |
NULL, &peerinfo, 0, &args);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "Failed to add peer %s",
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_PEER_ADD_FAIL,
|
|
|
cb8e9e |
+ "Failed to add peer %s",
|
|
|
cb8e9e |
remote_hostname);
|
|
|
cb8e9e |
rsp.op_errno = GF_PROBE_ADD_FAILED;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -2828,6 +2946,9 @@ __glusterd_handle_cli_profile_volume (rpcsvc_request_t *req)
|
|
|
cb8e9e |
ret = xdr_to_generic (req->msg[0], &cli_req, (xdrproc_t)xdr_gf_cli_req);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
//failed to decode msg;
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_REQ_DECODE_FAIL, "Failed to decode "
|
|
|
cb8e9e |
+ "request received from cli");
|
|
|
cb8e9e |
req->rpc_err = GARBAGE_ARGS;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -2844,7 +2965,8 @@ __glusterd_handle_cli_profile_volume (rpcsvc_request_t *req)
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
snprintf (err_str, sizeof (err_str), "Unable to get volume "
|
|
|
cb8e9e |
"name");
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "%s", err_str);
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_VOLNAME_NOTFOUND_IN_DICT, "%s", err_str);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -2853,7 +2975,8 @@ __glusterd_handle_cli_profile_volume (rpcsvc_request_t *req)
|
|
|
cb8e9e |
ret = dict_get_int32 (dict, "op", &op);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
snprintf (err_str, sizeof (err_str), "Unable to get operation");
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "%s", err_str);
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED, "%s", err_str);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -2873,7 +2996,7 @@ out:
|
|
|
cb8e9e |
dict, err_str);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "Returning %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "Returning %d", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -2932,6 +3055,9 @@ __glusterd_handle_mount (rpcsvc_request_t *req)
|
|
|
cb8e9e |
(xdrproc_t)xdr_gf1_cli_mount_req);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
//failed to decode msg;
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_REQ_DECODE_FAIL, "Failed to decode mount "
|
|
|
cb8e9e |
+ "request received");
|
|
|
cb8e9e |
req->rpc_err = GARBAGE_ARGS;
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
@@ -2948,7 +3074,8 @@ __glusterd_handle_mount (rpcsvc_request_t *req)
|
|
|
cb8e9e |
mnt_req.dict.dict_len,
|
|
|
cb8e9e |
&dict);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_UNSERIALIZE_FAIL,
|
|
|
cb8e9e |
"failed to "
|
|
|
cb8e9e |
"unserialize req-buffer to dictionary");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
@@ -3013,6 +3140,9 @@ __glusterd_handle_umount (rpcsvc_request_t *req)
|
|
|
cb8e9e |
(xdrproc_t)xdr_gf1_cli_umount_req);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
//failed to decode msg;
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_REQ_DECODE_FAIL, "Failed to decode umount"
|
|
|
cb8e9e |
+ "request");
|
|
|
cb8e9e |
req->rpc_err = GARBAGE_ARGS;
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -3106,15 +3236,15 @@ glusterd_friend_remove (uuid_t uuid, char *hostname)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = glusterd_friend_remove_cleanup_vols (peerinfo->uuid);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_WARNING, "Volumes cleanup failed");
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ GD_MSG_VOL_CLEANUP_FAIL, "Volumes cleanup failed");
|
|
|
cb8e9e |
rcu_read_unlock ();
|
|
|
cb8e9e |
/* Giving up the critical section here as glusterd_peerinfo_cleanup must
|
|
|
cb8e9e |
* be called from outside a critical section
|
|
|
cb8e9e |
*/
|
|
|
cb8e9e |
ret = glusterd_peerinfo_cleanup (peerinfo);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG, "returning %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug (THIS->name, 0, "returning %d", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -3150,7 +3280,7 @@ out:
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "returning %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "returning %d", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -3204,7 +3334,8 @@ glusterd_transport_inet_options_build (dict_t **options, const char *hostname,
|
|
|
cb8e9e |
*/
|
|
|
cb8e9e |
ret = dict_set_int32 (dict, "frame-timeout", 600);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_SET_FAILED,
|
|
|
cb8e9e |
"Failed to set frame-timeout");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -3217,7 +3348,7 @@ glusterd_transport_inet_options_build (dict_t **options, const char *hostname,
|
|
|
cb8e9e |
time, timeout);
|
|
|
cb8e9e |
*options = dict;
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_DEBUG, "Returning %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug ("glusterd", 0, "Returning %d", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -3271,7 +3402,9 @@ glusterd_friend_rpc_create (xlator_t *this, glusterd_peerinfo_t *peerinfo,
|
|
|
cb8e9e |
ret = glusterd_rpc_create (&peerinfo->rpc, options,
|
|
|
cb8e9e |
glusterd_peer_rpc_notify, peerctx);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "failed to create rpc for"
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_RPC_CREATE_FAIL,
|
|
|
cb8e9e |
+ "failed to create rpc for"
|
|
|
cb8e9e |
" peer %s", peerinfo->hostname);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -3325,7 +3458,8 @@ glusterd_friend_add (const char *hoststr, int port,
|
|
|
cb8e9e |
ret = glusterd_friend_rpc_create (this, *friend, args);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
else {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_PEERINFO_CREATE_FAIL,
|
|
|
cb8e9e |
"Failed to store peerinfo");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -3378,7 +3512,8 @@ glusterd_friend_add_from_peerinfo (glusterd_peerinfo_t *friend,
|
|
|
cb8e9e |
ret = glusterd_friend_rpc_create (this, friend, args);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
else {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_PEERINFO_CREATE_FAIL,
|
|
|
cb8e9e |
"Failed to store peerinfo");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -3446,7 +3581,7 @@ glusterd_probe_begin (rpcsvc_request_t *req, const char *hoststr, int port,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
rcu_read_unlock ();
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG, "returning %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug ("glusterd", 0, "returning %d", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -3488,8 +3623,9 @@ glusterd_deprobe_begin (rpcsvc_request_t *req, const char *hoststr, int port,
|
|
|
cb8e9e |
(GD_FRIEND_EVENT_INIT_REMOVE_FRIEND, &event);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_ERROR,
|
|
|
cb8e9e |
- "Unable to get new event");
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_EVENT_NEW_GET_FAIL,
|
|
|
cb8e9e |
+ "Unable to get new event");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -3512,7 +3648,8 @@ glusterd_deprobe_begin (rpcsvc_request_t *req, const char *hoststr, int port,
|
|
|
cb8e9e |
ret = glusterd_friend_sm_inject_event (event);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_ERROR, "Unable to inject event %d, "
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_EVENT_INJECT_FAIL, "Unable to inject event %d, "
|
|
|
cb8e9e |
"ret = %d", event->event, ret);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -3695,7 +3832,8 @@ glusterd_xfer_cli_probe_resp (rpcsvc_request_t *req, int32_t op_ret,
|
|
|
cb8e9e |
if (dict) {
|
|
|
cb8e9e |
ret = dict_get_str (dict, "cmd-str", &cmd_str);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to get "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_CMDSTR_NOTFOUND_IN_DICT, "Failed to get "
|
|
|
cb8e9e |
"command string");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -3713,7 +3851,7 @@ glusterd_xfer_cli_probe_resp (rpcsvc_request_t *req, int32_t op_ret,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (dict)
|
|
|
cb8e9e |
dict_unref (dict);
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "Responded to CLI, ret: %d",ret);
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "Responded to CLI, ret: %d", ret);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -3790,7 +3928,8 @@ glusterd_xfer_cli_deprobe_resp (rpcsvc_request_t *req, int32_t op_ret,
|
|
|
cb8e9e |
if (dict) {
|
|
|
cb8e9e |
ret = dict_get_str (dict, "cmd-str", &cmd_str);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_ERROR, "Failed to get "
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_CMDSTR_NOTFOUND_IN_DICT, "Failed to get "
|
|
|
cb8e9e |
"command string");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -3806,7 +3945,7 @@ glusterd_xfer_cli_deprobe_resp (rpcsvc_request_t *req, int32_t op_ret,
|
|
|
cb8e9e |
ret = glusterd_submit_reply (req, &rsp, NULL, 0, NULL,
|
|
|
cb8e9e |
(xdrproc_t)xdr_gf_cli_rsp);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_DEBUG, "Responded to CLI, ret: %d",ret);
|
|
|
cb8e9e |
+ gf_msg_debug (THIS->name, 0, "Responded to CLI, ret: %d", ret);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -3828,7 +3967,8 @@ glusterd_list_friends (rpcsvc_request_t *req, dict_t *dict, int32_t flags)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
friends = dict_new ();
|
|
|
cb8e9e |
if (!friends) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_WARNING, "Out of Memory");
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_ERROR, ENOMEM,
|
|
|
cb8e9e |
+ GD_MSG_NO_MEMORY, "Out of Memory");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -3910,7 +4050,8 @@ glusterd_get_volumes (rpcsvc_request_t *req, dict_t *dict, int32_t flags)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
volumes = dict_new ();
|
|
|
cb8e9e |
if (!volumes) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_WARNING, "Out of Memory");
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, ENOMEM,
|
|
|
cb8e9e |
+ GD_MSG_NO_MEMORY, "Out of Memory");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -4023,6 +4164,9 @@ __glusterd_handle_status_volume (rpcsvc_request_t *req)
|
|
|
cb8e9e |
ret = xdr_to_generic (req->msg[0], &cli_req, (xdrproc_t)xdr_gf_cli_req);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
//failed to decode msg;
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_REQ_DECODE_FAIL, "Failed to decode "
|
|
|
cb8e9e |
+ "request received from cli");
|
|
|
cb8e9e |
req->rpc_err = GARBAGE_ARGS;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -4034,7 +4178,8 @@ __glusterd_handle_status_volume (rpcsvc_request_t *req)
|
|
|
cb8e9e |
ret = dict_unserialize (cli_req.dict.dict_val,
|
|
|
cb8e9e |
cli_req.dict.dict_len, &dict);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "failed to "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_UNSERIALIZE_FAIL, "failed to "
|
|
|
cb8e9e |
"unserialize buffer");
|
|
|
cb8e9e |
snprintf (err_str, sizeof (err_str), "Unable to decode "
|
|
|
cb8e9e |
"the command");
|
|
|
cb8e9e |
@@ -4052,7 +4197,8 @@ __glusterd_handle_status_volume (rpcsvc_request_t *req)
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
snprintf (err_str, sizeof (err_str), "Unable to get "
|
|
|
cb8e9e |
"volume name");
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "%s", err_str);
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_VOL_NOT_FOUND, "%s", err_str);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
gf_log (this->name, GF_LOG_INFO,
|
|
|
cb8e9e |
@@ -4139,6 +4285,9 @@ __glusterd_handle_cli_clearlocks_volume (rpcsvc_request_t *req)
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
ret = xdr_to_generic (req->msg[0], &cli_req, (xdrproc_t)xdr_gf_cli_req);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_REQ_DECODE_FAIL, "Failed to decode "
|
|
|
cb8e9e |
+ "request received from cli");
|
|
|
cb8e9e |
req->rpc_err = GARBAGE_ARGS;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -4150,7 +4299,8 @@ __glusterd_handle_cli_clearlocks_volume (rpcsvc_request_t *req)
|
|
|
cb8e9e |
cli_req.dict.dict_len,
|
|
|
cb8e9e |
&dict);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_UNSERIALIZE_FAIL,
|
|
|
cb8e9e |
"failed to unserialize req-buffer to"
|
|
|
cb8e9e |
" dictionary");
|
|
|
cb8e9e |
snprintf (err_str, sizeof (err_str), "unable to decode "
|
|
|
cb8e9e |
@@ -4160,7 +4310,8 @@ __glusterd_handle_cli_clearlocks_volume (rpcsvc_request_t *req)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
} else {
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Empty cli request.");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_CLI_REQ_EMPTY, "Empty cli request.");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -4168,7 +4319,8 @@ __glusterd_handle_cli_clearlocks_volume (rpcsvc_request_t *req)
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
snprintf (err_str, sizeof (err_str), "Unable to get volume "
|
|
|
cb8e9e |
"name");
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "%s", err_str);
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_VOLNAME_NOTFOUND_IN_DICT, "%s", err_str);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -4218,7 +4370,8 @@ get_volinfo_from_brickid (char *brickid, glusterd_volinfo_t **volinfo)
|
|
|
cb8e9e |
volid_str = brickid_dup;
|
|
|
cb8e9e |
brick = strchr (brickid_dup, ':');
|
|
|
cb8e9e |
if (!brick) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_BRICK_NOT_FOUND,
|
|
|
cb8e9e |
"Invalid brickid");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -4231,7 +4384,8 @@ get_volinfo_from_brickid (char *brickid, glusterd_volinfo_t **volinfo)
|
|
|
cb8e9e |
/* Check if it is a snapshot volume */
|
|
|
cb8e9e |
ret = glusterd_snap_volinfo_find_by_volume_id (volid, volinfo);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ GD_MSG_VOLINFO_GET_FAIL,
|
|
|
cb8e9e |
"Failed to find volinfo");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -4258,6 +4412,9 @@ __glusterd_handle_barrier (rpcsvc_request_t *req)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = xdr_to_generic (req->msg[0], &cli_req, (xdrproc_t)xdr_gf_cli_req);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_REQ_DECODE_FAIL, "Failed to decode "
|
|
|
cb8e9e |
+ "request received from cli");
|
|
|
cb8e9e |
req->rpc_err = GARBAGE_ARGS;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -4275,14 +4432,17 @@ __glusterd_handle_barrier (rpcsvc_request_t *req)
|
|
|
cb8e9e |
ret = dict_unserialize (cli_req.dict.dict_val, cli_req.dict.dict_len,
|
|
|
cb8e9e |
&dict);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to unserialize "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_UNSERIALIZE_FAIL, "Failed to unserialize "
|
|
|
cb8e9e |
"request dictionary.");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_str (dict, "volname", &volname);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Volname not present in "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_VOLNAME_NOTFOUND_IN_DICT,
|
|
|
cb8e9e |
+ "Volname not present in "
|
|
|
cb8e9e |
"dict");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -4337,7 +4497,8 @@ glusterd_get_volume_opts (rpcsvc_request_t *req, dict_t *dict)
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
snprintf (err_str, sizeof (err_str), "Failed to get volume "
|
|
|
cb8e9e |
"name while handling get volume option command");
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "%s", err_str);
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_VOLNAME_NOTFOUND_IN_DICT, "%s", err_str);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -4345,17 +4506,19 @@ glusterd_get_volume_opts (rpcsvc_request_t *req, dict_t *dict)
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
snprintf (err_str, sizeof (err_str), "Failed to get key "
|
|
|
cb8e9e |
"while handling get volume option for %s", volname);
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "%s", err_str);
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED, "%s", err_str);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "Received get volume opt request for "
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "Received get volume opt request for "
|
|
|
cb8e9e |
"volume %s", volname);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = glusterd_volinfo_find (volname, &volinfo);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
snprintf (err_str, sizeof(err_str),
|
|
|
cb8e9e |
FMTSTR_CHECK_VOL_EXISTS, volname);
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, FMTSTR_CHECK_VOL_EXISTS,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_VOL_NOT_FOUND, FMTSTR_CHECK_VOL_EXISTS,
|
|
|
cb8e9e |
volname);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -4364,7 +4527,8 @@ glusterd_get_volume_opts (rpcsvc_request_t *req, dict_t *dict)
|
|
|
cb8e9e |
if (!exists) {
|
|
|
cb8e9e |
snprintf (err_str, sizeof (err_str), "Option "
|
|
|
cb8e9e |
"with name: %s does not exist", key);
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "%s",
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ GD_MSG_UNKNOWN_KEY, "%s",
|
|
|
cb8e9e |
err_str);
|
|
|
cb8e9e |
if (key_fixed)
|
|
|
cb8e9e |
snprintf (err_str + ret,
|
|
|
cb8e9e |
@@ -4382,7 +4546,8 @@ glusterd_get_volume_opts (rpcsvc_request_t *req, dict_t *dict)
|
|
|
cb8e9e |
sprintf (dict_key, "key%d", count);
|
|
|
cb8e9e |
ret = dict_set_str(dict, dict_key, key);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_SET_FAILED, "Failed to "
|
|
|
cb8e9e |
"set %s in dictionary", key);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -4390,7 +4555,8 @@ glusterd_get_volume_opts (rpcsvc_request_t *req, dict_t *dict)
|
|
|
cb8e9e |
sprintf (op_version_buff, "%d", priv->op_version);
|
|
|
cb8e9e |
ret = dict_set_str (dict, dict_key, op_version_buff);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_SET_FAILED, "Failed to "
|
|
|
cb8e9e |
"set value for key %s in dictionary",
|
|
|
cb8e9e |
key);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -4400,7 +4566,8 @@ glusterd_get_volume_opts (rpcsvc_request_t *req, dict_t *dict)
|
|
|
cb8e9e |
sprintf (dict_key, "key%d", count);
|
|
|
cb8e9e |
ret = dict_set_str(dict, dict_key, key);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_SET_FAILED, "Failed to "
|
|
|
cb8e9e |
"set %s in dictionary", key);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -4411,7 +4578,8 @@ glusterd_get_volume_opts (rpcsvc_request_t *req, dict_t *dict)
|
|
|
cb8e9e |
else
|
|
|
cb8e9e |
ret = dict_set_str(dict, dict_key,"Disabled");
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_SET_FAILED, "Failed to "
|
|
|
cb8e9e |
"set value for key %s in dictionary",
|
|
|
cb8e9e |
key);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -4421,7 +4589,8 @@ glusterd_get_volume_opts (rpcsvc_request_t *req, dict_t *dict)
|
|
|
cb8e9e |
sprintf (dict_key, "key%d", count);
|
|
|
cb8e9e |
ret = dict_set_str(dict, dict_key, key);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_SET_FAILED, "Failed to "
|
|
|
cb8e9e |
"set %s in dictionary", key);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -4438,7 +4607,8 @@ glusterd_get_volume_opts (rpcsvc_request_t *req, dict_t *dict)
|
|
|
cb8e9e |
ret = dict_set_str(dict, dict_key,"none");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_SET_FAILED, "Failed to "
|
|
|
cb8e9e |
"set value for key %s in dictionary",
|
|
|
cb8e9e |
key);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -4463,7 +4633,8 @@ glusterd_get_volume_opts (rpcsvc_request_t *req, dict_t *dict)
|
|
|
cb8e9e |
*/
|
|
|
cb8e9e |
ret = dict_set_int32 (dict, "count", 1);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to set count "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, errno,
|
|
|
cb8e9e |
+ GD_MSG_DICT_SET_FAILED, "Failed to set count "
|
|
|
cb8e9e |
"value in the dictionary");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -4517,7 +4688,8 @@ __glusterd_handle_get_vol_opt (rpcsvc_request_t *req)
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
snprintf (err_str, sizeof (err_str), "Failed to decode "
|
|
|
cb8e9e |
"request received from cli");
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "%s", err_str);
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_REQ_DECODE_FAIL, "%s", err_str);
|
|
|
cb8e9e |
req->rpc_err = GARBAGE_ARGS;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -4530,7 +4702,8 @@ __glusterd_handle_get_vol_opt (rpcsvc_request_t *req)
|
|
|
cb8e9e |
cli_req.dict.dict_len,
|
|
|
cb8e9e |
&dict);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_UNSERIALIZE_FAIL,
|
|
|
cb8e9e |
"failed to "
|
|
|
cb8e9e |
"unserialize req-buffer to dictionary");
|
|
|
cb8e9e |
snprintf (err_str, sizeof (err_str), "Unable to decode "
|
|
|
cb8e9e |
@@ -4635,7 +4808,8 @@ __glusterd_brick_rpc_notify (struct rpc_clnt *rpc, void *mydata,
|
|
|
cb8e9e |
brickinfo->path);
|
|
|
cb8e9e |
ret = get_volinfo_from_brickid (brickid, &volinfo);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_VOLINFO_GET_FAIL,
|
|
|
cb8e9e |
"Failed to get volinfo from "
|
|
|
cb8e9e |
"brickid(%s)", brickid);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -4644,7 +4818,8 @@ __glusterd_brick_rpc_notify (struct rpc_clnt *rpc, void *mydata,
|
|
|
cb8e9e |
ret = glusterd_brick_stop (volinfo, brickinfo,
|
|
|
cb8e9e |
_gf_false);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_BRICK_STOP_FAIL,
|
|
|
cb8e9e |
"Unable to stop %s:%s",
|
|
|
cb8e9e |
brickinfo->hostname, brickinfo->path);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -4652,7 +4827,7 @@ __glusterd_brick_rpc_notify (struct rpc_clnt *rpc, void *mydata,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
break;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "Connected to %s:%s",
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "Connected to %s:%s",
|
|
|
cb8e9e |
brickinfo->hostname, brickinfo->path);
|
|
|
cb8e9e |
glusterd_set_brick_status (brickinfo, GF_BRICK_STARTED);
|
|
|
cb8e9e |
ret = default_notify (this, GF_EVENT_CHILD_UP, NULL);
|
|
|
cb8e9e |
@@ -4674,7 +4849,7 @@ __glusterd_brick_rpc_notify (struct rpc_clnt *rpc, void *mydata,
|
|
|
cb8e9e |
mydata = NULL;
|
|
|
cb8e9e |
break;
|
|
|
cb8e9e |
default:
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_TRACE,
|
|
|
cb8e9e |
+ gf_msg_trace (this->name, 0,
|
|
|
cb8e9e |
"got some other RPC event %d", event);
|
|
|
cb8e9e |
break;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -4706,7 +4881,7 @@ glusterd_friend_remove_notify (glusterd_peerctx_t *peerctx)
|
|
|
cb8e9e |
rcu_read_lock ();
|
|
|
cb8e9e |
peerinfo = glusterd_peerinfo_find_by_generation (peerctx->peerinfo_gen);
|
|
|
cb8e9e |
if (!peerinfo) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_DEBUG, "Could not find peer %s(%s). "
|
|
|
cb8e9e |
+ gf_msg_debug (THIS->name, 0, "Could not find peer %s(%s). "
|
|
|
cb8e9e |
"Peer could have been deleted.", peerctx->peername,
|
|
|
cb8e9e |
uuid_utoa (peerctx->peerid));
|
|
|
cb8e9e |
ret = 0;
|
|
|
cb8e9e |
@@ -4721,7 +4896,8 @@ glusterd_friend_remove_notify (glusterd_peerctx_t *peerctx)
|
|
|
cb8e9e |
&new_event);
|
|
|
cb8e9e |
if (!ret) {
|
|
|
cb8e9e |
if (!req) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ GD_MSG_EVENT_NEW_GET_FAIL,
|
|
|
cb8e9e |
"Unable to find the request for responding "
|
|
|
cb8e9e |
"to User (%s)", peerinfo->hostname);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -4736,7 +4912,8 @@ glusterd_friend_remove_notify (glusterd_peerctx_t *peerctx)
|
|
|
cb8e9e |
ret = glusterd_friend_sm_inject_event (new_event);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
} else {
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_EVENT_INJECT_FAIL,
|
|
|
cb8e9e |
"Unable to create event for removing peer %s",
|
|
|
cb8e9e |
peerinfo->hostname);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -4780,7 +4957,8 @@ __glusterd_peer_rpc_notify (struct rpc_clnt *rpc, void *mydata,
|
|
|
cb8e9e |
/* Peerinfo should be available at this point. Not finding it
|
|
|
cb8e9e |
* means that something terrible has happened
|
|
|
cb8e9e |
*/
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_CRITICAL, "Could not find peer "
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_CRITICAL, ENOENT,
|
|
|
cb8e9e |
+ GD_MSG_PEER_NOT_FOUND, "Could not find peer "
|
|
|
cb8e9e |
"%s(%s)", peerctx->peername, uuid_utoa (peerctx->peerid));
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -4790,7 +4968,7 @@ __glusterd_peer_rpc_notify (struct rpc_clnt *rpc, void *mydata,
|
|
|
cb8e9e |
case RPC_CLNT_CONNECT:
|
|
|
cb8e9e |
{
|
|
|
cb8e9e |
rpc_clnt_set_connected (&rpc->conn);
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "got RPC_CLNT_CONNECT");
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "got RPC_CLNT_CONNECT");
|
|
|
cb8e9e |
peerinfo->connected = 1;
|
|
|
cb8e9e |
peerinfo->quorum_action = _gf_true;
|
|
|
cb8e9e |
peerinfo->generation = uatomic_add_return
|
|
|
cb8e9e |
@@ -4799,7 +4977,9 @@ __glusterd_peer_rpc_notify (struct rpc_clnt *rpc, void *mydata,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = glusterd_peer_dump_version (this, rpc, peerctx);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "glusterd handshake failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_HANDSHAKE_FAILED,
|
|
|
cb8e9e |
+ "glusterd handshake failed");
|
|
|
cb8e9e |
break;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -4828,8 +5008,9 @@ __glusterd_peer_rpc_notify (struct rpc_clnt *rpc, void *mydata,
|
|
|
cb8e9e |
peerinfo->uuid,
|
|
|
cb8e9e |
"vol");
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (this->name,
|
|
|
cb8e9e |
- GF_LOG_TRACE,
|
|
|
cb8e9e |
+ gf_msg (this->name,
|
|
|
cb8e9e |
+ GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ GD_MSG_MGMTV3_UNLOCK_FAIL,
|
|
|
cb8e9e |
"Lock not released "
|
|
|
cb8e9e |
"for %s",
|
|
|
cb8e9e |
volinfo->volname);
|
|
|
cb8e9e |
@@ -4859,7 +5040,7 @@ __glusterd_peer_rpc_notify (struct rpc_clnt *rpc, void *mydata,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
default:
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_TRACE,
|
|
|
cb8e9e |
+ gf_msg_trace (this->name, 0,
|
|
|
cb8e9e |
"got some other RPC event %d", event);
|
|
|
cb8e9e |
ret = 0;
|
|
|
cb8e9e |
break;
|
|
|
cb8e9e |
diff --git a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
|
|
|
cb8e9e |
index 9806556..db9b36c 100644
|
|
|
cb8e9e |
--- a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
|
|
|
cb8e9e |
+++ b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
|
|
|
cb8e9e |
@@ -25,6 +25,7 @@
|
|
|
cb8e9e |
#include "glusterd-svc-helper.h"
|
|
|
cb8e9e |
#include "glusterd-nfs-svc.h"
|
|
|
cb8e9e |
#include "glusterd-volgen.h"
|
|
|
cb8e9e |
+#include "glusterd-messages.h"
|
|
|
cb8e9e |
#include "run.h"
|
|
|
cb8e9e |
#include "syscall.h"
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -58,6 +59,9 @@ __glusterd_handle_replace_brick (rpcsvc_request_t *req)
|
|
|
cb8e9e |
ret = xdr_to_generic (req->msg[0], &cli_req, (xdrproc_t)xdr_gf_cli_req);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
//failed to decode msg;
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_REQ_DECODE_FAIL, "Failed to decode "
|
|
|
cb8e9e |
+ "request received from cli");
|
|
|
cb8e9e |
req->rpc_err = GARBAGE_ARGS;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -72,7 +76,8 @@ __glusterd_handle_replace_brick (rpcsvc_request_t *req)
|
|
|
cb8e9e |
cli_req.dict.dict_len,
|
|
|
cb8e9e |
&dict);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_UNSERIALIZE_FAIL,
|
|
|
cb8e9e |
"failed to "
|
|
|
cb8e9e |
"unserialize req-buffer to dictionary");
|
|
|
cb8e9e |
snprintf (msg, sizeof (msg), "Unable to decode the "
|
|
|
cb8e9e |
@@ -84,13 +89,14 @@ __glusterd_handle_replace_brick (rpcsvc_request_t *req)
|
|
|
cb8e9e |
ret = dict_get_str (dict, "volname", &volname);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
snprintf (msg, sizeof (msg), "Could not get volume name");
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "%s", msg);
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED, "%s", msg);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_int32 (dict, "operation", &op);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0,
|
|
|
cb8e9e |
"dict_get on operation failed");
|
|
|
cb8e9e |
snprintf (msg, sizeof (msg), "Could not get operation");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -100,21 +106,23 @@ __glusterd_handle_replace_brick (rpcsvc_request_t *req)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
snprintf (msg, sizeof (msg), "Failed to get src brick");
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "%s", msg);
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED, "%s", msg);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0,
|
|
|
cb8e9e |
"src brick=%s", src_brick);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_str (dict, "dst-brick", &dst_brick);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
snprintf (msg, sizeof (msg), "Failed to get dest brick");
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "%s", msg);
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED, "%s", msg);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "dst brick=%s", dst_brick);
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "dst brick=%s", dst_brick);
|
|
|
cb8e9e |
gf_log (this->name, GF_LOG_INFO, "Received replace brick commit-force "
|
|
|
cb8e9e |
"request operation");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -198,31 +206,34 @@ glusterd_op_stage_replace_brick (dict_t *dict, char **op_errstr,
|
|
|
cb8e9e |
ret = dict_get_str (dict, "src-brick", &src_brick);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Unable to get src brick");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED, "Unable to get src brick");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "src brick=%s", src_brick);
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "src brick=%s", src_brick);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_str (dict, "dst-brick", &dst_brick);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Unable to get dest brick");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED, "Unable to get dest brick");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "dst brick=%s", dst_brick);
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "dst brick=%s", dst_brick);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_str (dict, "volname", &volname);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Unable to get volume name");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED, "Unable to get volume name");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_str (dict, "operation", &replace_op);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0,
|
|
|
cb8e9e |
"dict get on replace-brick operation failed");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -255,7 +266,8 @@ glusterd_op_stage_replace_brick (dict_t *dict, char **op_errstr,
|
|
|
cb8e9e |
!glusterd_is_valid_volfpath (volname, dst_brick)) {
|
|
|
cb8e9e |
snprintf (msg, sizeof (msg), "brick path %s is too "
|
|
|
cb8e9e |
"long.", dst_brick);
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "%s", msg);
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_BRKPATH_TOO_LONG, "%s", msg);
|
|
|
cb8e9e |
*op_errstr = gf_strdup (msg);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
@@ -273,7 +285,8 @@ glusterd_op_stage_replace_brick (dict_t *dict, char **op_errstr,
|
|
|
cb8e9e |
if (glusterd_is_defrag_on(volinfo)) {
|
|
|
cb8e9e |
snprintf (msg, sizeof(msg), "Volume name %s rebalance is in "
|
|
|
cb8e9e |
"progress. Please retry after completion", volname);
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "%s", msg);
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_OIP_RETRY_LATER, "%s", msg);
|
|
|
cb8e9e |
*op_errstr = gf_strdup (msg);
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -299,7 +312,8 @@ glusterd_op_stage_replace_brick (dict_t *dict, char **op_errstr,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (ctx) {
|
|
|
cb8e9e |
if (!glusterd_is_fuse_available ()) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Unable to open /dev/"
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_RB_CMD_FAIL, "Unable to open /dev/"
|
|
|
cb8e9e |
"fuse (%s), replace-brick command failed",
|
|
|
cb8e9e |
strerror (errno));
|
|
|
cb8e9e |
snprintf (msg, sizeof(msg), "Fuse unavailable\n "
|
|
|
cb8e9e |
@@ -311,13 +325,13 @@ glusterd_op_stage_replace_brick (dict_t *dict, char **op_errstr,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (gf_is_local_addr (src_brickinfo->hostname)) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0,
|
|
|
cb8e9e |
"I AM THE SOURCE HOST");
|
|
|
cb8e9e |
if (src_brickinfo->port && rsp_dict) {
|
|
|
cb8e9e |
ret = dict_set_int32 (rsp_dict, "src-brick-port",
|
|
|
cb8e9e |
src_brickinfo->port);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug ("", 0,
|
|
|
cb8e9e |
"Could not set src-brick-port=%d",
|
|
|
cb8e9e |
src_brickinfo->port);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -331,14 +345,16 @@ glusterd_op_stage_replace_brick (dict_t *dict, char **op_errstr,
|
|
|
cb8e9e |
dup_dstbrick = gf_strdup (dst_brick);
|
|
|
cb8e9e |
if (!dup_dstbrick) {
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Memory allocation failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, ENOMEM,
|
|
|
cb8e9e |
+ GD_MSG_NO_MEMORY, "Memory allocation failed");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
host = strtok_r (dup_dstbrick, ":", &savetok);
|
|
|
cb8e9e |
path = strtok_r (NULL, ":", &savetok);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!host || !path) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_BAD_FORMAT,
|
|
|
cb8e9e |
"dst brick %s is not of form <HOSTNAME>:<export-dir>",
|
|
|
cb8e9e |
dst_brick);
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
@@ -370,7 +386,8 @@ glusterd_op_stage_replace_brick (dict_t *dict, char **op_errstr,
|
|
|
cb8e9e |
*op_errstr = gf_strdup ("Incorrect source or "
|
|
|
cb8e9e |
"destination brick");
|
|
|
cb8e9e |
if (*op_errstr)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "%s", *op_errstr);
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ GD_MSG_BRICK_NOT_FOUND, "%s", *op_errstr);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -418,7 +435,8 @@ glusterd_op_stage_replace_brick (dict_t *dict, char **op_errstr,
|
|
|
cb8e9e |
dst_brickinfo->hostname,
|
|
|
cb8e9e |
dst_brickinfo->mount_dir);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_BRICK_MOUNTDIR_GET_FAIL,
|
|
|
cb8e9e |
"Failed to get brick mount_dir");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -426,14 +444,16 @@ glusterd_op_stage_replace_brick (dict_t *dict, char **op_errstr,
|
|
|
cb8e9e |
ret = dict_set_dynstr_with_alloc (rsp_dict, "brick1.mount_dir",
|
|
|
cb8e9e |
dst_brickinfo->mount_dir);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_SET_FAILED,
|
|
|
cb8e9e |
"Failed to set brick1.mount_dir");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_set_int32 (rsp_dict, "brick_count", 1);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_SET_FAILED,
|
|
|
cb8e9e |
"Failed to set local_brick_count");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -443,7 +463,7 @@ glusterd_op_stage_replace_brick (dict_t *dict, char **op_errstr,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
GF_FREE (dup_dstbrick);
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "Returning %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "Returning %d", ret);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -547,7 +567,6 @@ rb_update_dstbrick_port (glusterd_brickinfo_t *dst_brickinfo, dict_t *rsp_dict,
|
|
|
cb8e9e |
if (!dict_ret)
|
|
|
cb8e9e |
dst_brickinfo->port = dst_port;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (gf_is_local_addr (dst_brickinfo->hostname)) {
|
|
|
cb8e9e |
gf_log ("", GF_LOG_INFO,
|
|
|
cb8e9e |
"adding dst-brick port no");
|
|
|
cb8e9e |
@@ -621,7 +640,8 @@ glusterd_op_perform_replace_brick (glusterd_volinfo_t *volinfo,
|
|
|
cb8e9e |
if (conf->op_version >= GD_OP_VERSION_RHS_3_0) {
|
|
|
cb8e9e |
ret = dict_get_str (dict, "brick1.mount_dir", &brick_mount_dir);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, errno,
|
|
|
cb8e9e |
+ GD_MSG_BRICK_MOUNTDIR_GET_FAIL,
|
|
|
cb8e9e |
"brick1.mount_dir not present");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -678,43 +698,47 @@ glusterd_op_replace_brick (dict_t *dict, dict_t *rsp_dict)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_str (dict, "src-brick", &src_brick);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Unable to get src brick");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED, "Unable to get src brick");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "src brick=%s", src_brick);
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "src brick=%s", src_brick);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_str (dict, "dst-brick", &dst_brick);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Unable to get dst brick");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED, "Unable to get dst brick");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "dst brick=%s", dst_brick);
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "dst brick=%s", dst_brick);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_str (dict, "volname", &volname);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Unable to get volume name");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED, "Unable to get volume name");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_str (dict, "operation", &replace_op);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0,
|
|
|
cb8e9e |
"dict_get on operation failed");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = glusterd_volinfo_find (volname, &volinfo);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Unable to allocate memory");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, ENOMEM,
|
|
|
cb8e9e |
+ GD_MSG_NO_MEMORY, "Unable to allocate memory");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = glusterd_volume_brickinfo_get_by_brick (src_brick, volinfo,
|
|
|
cb8e9e |
&src_brickinfo);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0,
|
|
|
cb8e9e |
"Unable to get src-brickinfo");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -722,14 +746,15 @@ glusterd_op_replace_brick (dict_t *dict, dict_t *rsp_dict)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = glusterd_get_rb_dst_brickinfo (volinfo, &dst_brickinfo);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Unable to get "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_RB_BRICKINFO_GET_FAIL, "Unable to get "
|
|
|
cb8e9e |
"replace brick destination brickinfo");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = glusterd_resolve_brick (dst_brickinfo);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0,
|
|
|
cb8e9e |
"Unable to resolve dst-brickinfo");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -743,7 +768,8 @@ glusterd_op_replace_brick (dict_t *dict, dict_t *rsp_dict)
|
|
|
cb8e9e |
if (is_origin_glusterd (dict)) {
|
|
|
cb8e9e |
ctx = glusterd_op_get_ctx();
|
|
|
cb8e9e |
if (!ctx) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_OPCTX_GET_FAIL, "Failed to "
|
|
|
cb8e9e |
"get op_ctx");
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -763,7 +789,8 @@ glusterd_op_replace_brick (dict_t *dict, dict_t *rsp_dict)
|
|
|
cb8e9e |
gf_log (this->name, GF_LOG_DEBUG, "I AM THE DESTINATION HOST");
|
|
|
cb8e9e |
ret = rb_kill_destination_brick (volinfo, dst_brickinfo);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_CRITICAL,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_CRITICAL, 0,
|
|
|
cb8e9e |
+ GD_MSG_BRK_CLEANUP_FAIL,
|
|
|
cb8e9e |
"Unable to cleanup dst brick");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -778,7 +805,8 @@ glusterd_op_replace_brick (dict_t *dict, dict_t *rsp_dict)
|
|
|
cb8e9e |
ret = glusterd_op_perform_replace_brick (volinfo, src_brick,
|
|
|
cb8e9e |
dst_brick, dict);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_CRITICAL, "Unable to add dst-brick: "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_CRITICAL, 0,
|
|
|
cb8e9e |
+ GD_MSG_BRICK_ADD_FAIL, "Unable to add dst-brick: "
|
|
|
cb8e9e |
"%s to volume: %s", dst_brick, volinfo->volname);
|
|
|
cb8e9e |
(void) glusterd_svcs_manager (volinfo);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -788,7 +816,8 @@ glusterd_op_replace_brick (dict_t *dict, dict_t *rsp_dict)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = glusterd_svcs_manager (volinfo);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_CRITICAL,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_CRITICAL, 0,
|
|
|
cb8e9e |
+ GD_MSG_NFS_VOL_FILE_GEN_FAIL,
|
|
|
cb8e9e |
"Failed to generate nfs volume file");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -802,7 +831,8 @@ glusterd_op_replace_brick (dict_t *dict, dict_t *rsp_dict)
|
|
|
cb8e9e |
ret = glusterd_store_volinfo (volinfo,
|
|
|
cb8e9e |
GLUSTERD_VOLINFO_VER_AC_INCREMENT);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Couldn't store"
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_RBOP_STATE_STORE_FAIL, "Couldn't store"
|
|
|
cb8e9e |
" replace brick operation's state");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -838,73 +868,74 @@ glusterd_do_replace_brick (void *data)
|
|
|
cb8e9e |
if (priv->timer) {
|
|
|
cb8e9e |
gf_timer_call_cancel (THIS->ctx, priv->timer);
|
|
|
cb8e9e |
priv->timer = NULL;
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug ("", 0,
|
|
|
cb8e9e |
"Cancelling timer thread");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0,
|
|
|
cb8e9e |
"Replace brick operation detected");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_bin (dict, "transaction_id", (void **)&txn_id);
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "transaction ID = %s",
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "transaction ID = %s",
|
|
|
cb8e9e |
uuid_utoa (*txn_id));
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_str (dict, "src-brick", &src_brick);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "Unable to get src brick");
|
|
|
cb8e9e |
+ gf_msg ("", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED, "Unable to get src brick");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0,
|
|
|
cb8e9e |
"src brick=%s", src_brick);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_str (dict, "dst-brick", &dst_brick);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "Unable to get dst brick");
|
|
|
cb8e9e |
+ gf_msg ("", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED, "Unable to get dst brick");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0,
|
|
|
cb8e9e |
"dst brick=%s", dst_brick);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = glusterd_volinfo_find (volname, &volinfo);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Unable to find volinfo");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ GD_MSG_VOLINFO_GET_FAIL, "Unable to find volinfo");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = glusterd_volume_brickinfo_get_by_brick (src_brick, volinfo,
|
|
|
cb8e9e |
&src_brickinfo);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "Unable to get "
|
|
|
cb8e9e |
- "src-brickinfo");
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "Unable to get src-brickinfo");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = glusterd_get_rb_dst_brickinfo (volinfo, &dst_brickinfo);
|
|
|
cb8e9e |
if (!dst_brickinfo) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "Unable to get "
|
|
|
cb8e9e |
- "dst-brickinfo");
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "Unable to get dst-brickinfo");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = glusterd_resolve_brick (dst_brickinfo);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "Unable to resolve "
|
|
|
cb8e9e |
- "dst-brickinfo");
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "Unable to resolve dst-brickinfo");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_int32 (dict, "src-brick-port", &src_port);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Unable to get "
|
|
|
cb8e9e |
- "src-brick port");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED, "Unable to get src-brick port");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_int32 (dict, "dst-brick-port", &dst_port);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Unable to get dst-brick port");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, errno,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED, "Unable to get dst-brick port");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
dst_brickinfo->port = dst_port;
|
|
|
cb8e9e |
--
|
|
|
cb8e9e |
1.7.1
|
|
|
cb8e9e |
|