|
|
cb8e9e |
From 5d89662a0e5d5d30498122ee70720928a812a5dd Mon Sep 17 00:00:00 2001
|
|
|
cb8e9e |
From: Nandaja Varma <nandaja.varma@gmail.com>
|
|
|
cb8e9e |
Date: Mon, 23 Mar 2015 11:36:37 +0530
|
|
|
cb8e9e |
Subject: [PATCH 091/101] utils/glusterd: Porting to new logging framwork
|
|
|
cb8e9e |
|
|
|
cb8e9e |
cherry-pick of the commit 9863c8940936989d2ffb3c8ac28431d2b313384d
|
|
|
cb8e9e |
>Change-Id: Iacb30eb675693bcdb3ef9de8e7f43892c5d79f6d
|
|
|
cb8e9e |
>BUG: 1194640
|
|
|
cb8e9e |
>Signed-off-by: Nandaja Varma <nandaja.varma@gmail.com>
|
|
|
cb8e9e |
>Reviewed-on: http://review.gluster.org/9967
|
|
|
cb8e9e |
>Tested-by: NetBSD Build System <jenkins@build.gluster.org>
|
|
|
cb8e9e |
>Reviewed-by: Poornima G <pgurusid@redhat.com>
|
|
|
cb8e9e |
>Tested-by: Gluster Build System <jenkins@build.gluster.com>
|
|
|
cb8e9e |
>Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
|
|
|
cb8e9e |
>Reviewed-by: Kaushal M <kaushal@redhat.com>
|
|
|
cb8e9e |
|
|
|
cb8e9e |
Change-Id: Iacb30eb675693bcdb3ef9de8e7f43892c5d79f6d
|
|
|
cb8e9e |
BUG: 1231771
|
|
|
cb8e9e |
Signed-off-by: Nandaja Varma <nandaja.varma@gmail.com>
|
|
|
cb8e9e |
Reviewed-on: https://code.engineering.redhat.com/gerrit/50891
|
|
|
cb8e9e |
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
|
|
cb8e9e |
Tested-by: Atin Mukherjee <amukherj@redhat.com>
|
|
|
cb8e9e |
---
|
|
|
cb8e9e |
xlators/mgmt/glusterd/src/glusterd-messages.h | 90 +++-
|
|
|
cb8e9e |
xlators/mgmt/glusterd/src/glusterd-peer-utils.c | 76 ++-
|
|
|
cb8e9e |
xlators/mgmt/glusterd/src/glusterd-utils.c | 844 +++++++++++++++--------
|
|
|
cb8e9e |
3 files changed, 686 insertions(+), 324 deletions(-)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
diff --git a/xlators/mgmt/glusterd/src/glusterd-messages.h b/xlators/mgmt/glusterd/src/glusterd-messages.h
|
|
|
cb8e9e |
index f66b8db..16002bc 100644
|
|
|
cb8e9e |
--- a/xlators/mgmt/glusterd/src/glusterd-messages.h
|
|
|
cb8e9e |
+++ b/xlators/mgmt/glusterd/src/glusterd-messages.h
|
|
|
cb8e9e |
@@ -45,7 +45,7 @@
|
|
|
cb8e9e |
*/
|
|
|
cb8e9e |
|
|
|
cb8e9e |
#define GLUSTERD_COMP_BASE GLFS_MSGID_GLUSTERD
|
|
|
cb8e9e |
-#define GLFS_NUM_MESSAGES 447
|
|
|
cb8e9e |
+#define GLFS_NUM_MESSAGES 458
|
|
|
cb8e9e |
#define GLFS_MSGID_END (GLUSTERD_COMP_BASE + GLFS_NUM_MESSAGES + 1)
|
|
|
cb8e9e |
/* Messaged with message IDs */
|
|
|
cb8e9e |
#define glfs_msg_start_x GLFS_COMP_BASE, "Invalid: Start of messages"
|
|
|
cb8e9e |
@@ -3626,6 +3626,94 @@
|
|
|
cb8e9e |
*/
|
|
|
cb8e9e |
#define GD_MSG_VOL_TYPE_CHANGING_INFO (GLUSTERD_COMP_BASE + 447)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+#define GD_MSG_BRKPATH_MNTPNT_MISMATCH (GLUSTERD_COMP_BASE + 448)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+#define GD_MSG_TASKS_COUNT_MISMATCH (GLUSTERD_COMP_BASE + 449)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+#define GD_MSG_WRONG_OPTS_SETTING (GLUSTERD_COMP_BASE + 450)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+#define GD_MSG_PATH_ALREADY_PART_OF_VOL (GLUSTERD_COMP_BASE + 451)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+#define GD_MSG_BRICK_VALIDATE_FAIL (GLUSTERD_COMP_BASE + 452)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+#define GD_MSG_READIN_FILE_FAILED (GLUSTERD_COMP_BASE + 453)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+#define GD_MSG_IMPORT_PRDICT_DICT (GLUSTERD_COMP_BASE + 454)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+#define GD_MSG_VOL_OPTS_IMPORT_FAIL (GLUSTERD_COMP_BASE + 455)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+#define GD_MSG_BRICK_IMPORT_FAIL (GLUSTERD_COMP_BASE + 456)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+#define GD_MSG_VOLINFO_IMPORT_FAIL (GLUSTERD_COMP_BASE + 457)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+#define GD_MSG_BRICK_ID_GEN_FAILED (GLUSTERD_COMP_BASE + 458)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
/*------------*/
|
|
|
cb8e9e |
#define glfs_msg_end_x GLFS_MSGID_END, "Invalid: End of messages"
|
|
|
cb8e9e |
|
|
|
cb8e9e |
diff --git a/xlators/mgmt/glusterd/src/glusterd-peer-utils.c b/xlators/mgmt/glusterd/src/glusterd-peer-utils.c
|
|
|
cb8e9e |
index 6df1dae..5ece68c 100644
|
|
|
cb8e9e |
--- a/xlators/mgmt/glusterd/src/glusterd-peer-utils.c
|
|
|
cb8e9e |
+++ b/xlators/mgmt/glusterd/src/glusterd-peer-utils.c
|
|
|
cb8e9e |
@@ -11,6 +11,7 @@
|
|
|
cb8e9e |
#include "glusterd-peer-utils.h"
|
|
|
cb8e9e |
#include "glusterd-store.h"
|
|
|
cb8e9e |
#include "glusterd-server-quorum.h"
|
|
|
cb8e9e |
+#include "glusterd-messages.h"
|
|
|
cb8e9e |
#include "common-utils.h"
|
|
|
cb8e9e |
|
|
|
cb8e9e |
void
|
|
|
cb8e9e |
@@ -32,7 +33,9 @@ glusterd_peerinfo_destroy (struct rcu_head *head)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = glusterd_store_delete_peerinfo (peerinfo);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_ERROR, "Deleting peer info failed");
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, errno,
|
|
|
cb8e9e |
+ GD_MSG_PEERINFO_DELETE_FAIL,
|
|
|
cb8e9e |
+ "Deleting peer info failed");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (peerinfo->hostname);
|
|
|
cb8e9e |
@@ -111,7 +114,8 @@ glusterd_peerinfo_find_by_hostname (const char *hoststr)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = getaddrinfo (hoststr, NULL, NULL, &addr);
|
|
|
cb8e9e |
if (ret != 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, ret,
|
|
|
cb8e9e |
+ GD_MSG_GETADDRINFO_FAIL,
|
|
|
cb8e9e |
"error in getaddrinfo: %s\n",
|
|
|
cb8e9e |
gai_strerror(ret));
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -126,7 +130,7 @@ glusterd_peerinfo_find_by_hostname (const char *hoststr)
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "Unable to find friend: %s", hoststr);
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "Unable to find friend: %s", hoststr);
|
|
|
cb8e9e |
if (addr)
|
|
|
cb8e9e |
freeaddrinfo (addr);
|
|
|
cb8e9e |
return NULL;
|
|
|
cb8e9e |
@@ -161,7 +165,7 @@ glusterd_hostname_to_uuid (char *hostname, uuid_t uuid)
|
|
|
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 |
@@ -191,7 +195,7 @@ glusterd_peerinfo_find_by_uuid (uuid_t uuid)
|
|
|
cb8e9e |
cds_list_for_each_entry_rcu (entry, &priv->peers, uuid_list) {
|
|
|
cb8e9e |
if (!gf_uuid_compare (entry->uuid, uuid)) {
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0,
|
|
|
cb8e9e |
"Friend found... state: %s",
|
|
|
cb8e9e |
glusterd_friend_sm_state_name_get (entry->state.state));
|
|
|
cb8e9e |
found = entry; /* Probably should be rcu_dereferenced */
|
|
|
cb8e9e |
@@ -201,7 +205,7 @@ glusterd_peerinfo_find_by_uuid (uuid_t uuid)
|
|
|
cb8e9e |
rcu_read_unlock ();
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!found)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0,
|
|
|
cb8e9e |
"Friend with uuid: %s, not found", uuid_utoa (uuid));
|
|
|
cb8e9e |
return found;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -226,7 +230,7 @@ glusterd_peerinfo_find (uuid_t uuid, const char *hostname)
|
|
|
cb8e9e |
if (peerinfo) {
|
|
|
cb8e9e |
return peerinfo;
|
|
|
cb8e9e |
} else {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0,
|
|
|
cb8e9e |
"Unable to find peer by uuid: %s",
|
|
|
cb8e9e |
uuid_utoa (uuid));
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -239,7 +243,7 @@ glusterd_peerinfo_find (uuid_t uuid, const char *hostname)
|
|
|
cb8e9e |
if (peerinfo) {
|
|
|
cb8e9e |
return peerinfo;
|
|
|
cb8e9e |
} else {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0,
|
|
|
cb8e9e |
"Unable to find hostname: %s", hostname);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -342,7 +346,7 @@ glusterd_chk_peers_connected_befriended (uuid_t skip_uuid)
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
rcu_read_unlock ();
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_DEBUG, "Returning %s",
|
|
|
cb8e9e |
+ gf_msg_debug (THIS->name, 0, "Returning %s",
|
|
|
cb8e9e |
(ret?"TRUE":"FALSE"));
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -413,7 +417,7 @@ glusterd_are_vol_all_peers_up (glusterd_volinfo_t *volinfo,
|
|
|
cb8e9e |
(peerinfo->state.state !=
|
|
|
cb8e9e |
GD_FRIEND_STATE_BEFRIENDED)) {
|
|
|
cb8e9e |
*down_peerstr = gf_strdup (peerinfo->hostname);
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG, "Peer %s is down. ",
|
|
|
cb8e9e |
+ gf_msg_debug (THIS->name, 0, "Peer %s is down. ",
|
|
|
cb8e9e |
peerinfo->hostname);
|
|
|
cb8e9e |
rcu_read_unlock ();
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -424,7 +428,7 @@ glusterd_are_vol_all_peers_up (glusterd_volinfo_t *volinfo,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = _gf_true;
|
|
|
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 |
@@ -451,7 +455,7 @@ glusterd_peer_hostname_new (const char *hostname,
|
|
|
cb8e9e |
ret = 0;
|
|
|
cb8e9e |
|
|
|
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 |
@@ -548,7 +552,8 @@ gd_add_friend_to_dict (glusterd_peerinfo_t *friend, dict_t *dict,
|
|
|
cb8e9e |
snprintf (key, sizeof (key), "%s.uuid", prefix);
|
|
|
cb8e9e |
ret = dict_set_dynstr_with_alloc (dict, key, uuid_utoa (friend->uuid));
|
|
|
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 key %s in dict", key);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -562,13 +567,16 @@ gd_add_friend_to_dict (glusterd_peerinfo_t *friend, dict_t *dict,
|
|
|
cb8e9e |
hostname_list);
|
|
|
cb8e9e |
if (!address) {
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Could not retrieve first "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_PEER_ADDRESS_GET_FAIL,
|
|
|
cb8e9e |
+ "Could not retrieve first "
|
|
|
cb8e9e |
"address for peer");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = dict_set_dynstr_with_alloc (dict, key, address->hostname);
|
|
|
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 key %s in dict", key);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -587,8 +595,9 @@ gd_add_friend_to_dict (glusterd_peerinfo_t *friend, dict_t *dict,
|
|
|
cb8e9e |
snprintf (key, sizeof (key), "%s.hostname%d", prefix, count);
|
|
|
cb8e9e |
ret = dict_set_dynstr_with_alloc (dict, key, address->hostname);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
- "Failed to set key %s in dict", key);
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_SET_FAILED,
|
|
|
cb8e9e |
+ "Failed to set key %s in dict", key);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
count++;
|
|
|
cb8e9e |
@@ -597,11 +606,12 @@ gd_add_friend_to_dict (glusterd_peerinfo_t *friend, dict_t *dict,
|
|
|
cb8e9e |
snprintf (key, sizeof (key), "%s.address-count", prefix);
|
|
|
cb8e9e |
ret = dict_set_int32 (dict, key, count);
|
|
|
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 key %s in dict", key);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
- gf_log (this ? this->name : "glusterd", GF_LOG_DEBUG, "Returning %d",
|
|
|
cb8e9e |
+ gf_msg_debug (this ? this->name : "glusterd", 0, "Returning %d",
|
|
|
cb8e9e |
ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -631,7 +641,7 @@ gd_peerinfo_find_from_hostname (const char *hoststr)
|
|
|
cb8e9e |
cds_list_for_each_entry_rcu (tmphost, &peer->hostnames,
|
|
|
cb8e9e |
hostname_list) {
|
|
|
cb8e9e |
if (!strncasecmp (tmphost->hostname, hoststr, 1024)) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0,
|
|
|
cb8e9e |
"Friend %s found.. state: %d",
|
|
|
cb8e9e |
tmphost->hostname, peer->state.state);
|
|
|
cb8e9e |
found = peer; /* Probably needs to be
|
|
|
cb8e9e |
@@ -688,7 +698,7 @@ gd_peerinfo_find_from_addrinfo (const struct addrinfo *addr)
|
|
|
cb8e9e |
/* Don't fail if getaddrinfo fails, continue
|
|
|
cb8e9e |
* onto the next address
|
|
|
cb8e9e |
*/
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_TRACE,
|
|
|
cb8e9e |
+ gf_msg_trace (this->name, 0,
|
|
|
cb8e9e |
"getaddrinfo for %s failed (%s)",
|
|
|
cb8e9e |
address->hostname, gai_strerror (ret));
|
|
|
cb8e9e |
ret = 0;
|
|
|
cb8e9e |
@@ -744,13 +754,15 @@ gd_update_peerinfo_from_dict (glusterd_peerinfo_t *peerinfo, dict_t *dict,
|
|
|
cb8e9e |
snprintf (key, sizeof (key), "%s.hostname", prefix);
|
|
|
cb8e9e |
ret = dict_get_str (dict, key, &hostname);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Key %s not present in "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED, "Key %s not present in "
|
|
|
cb8e9e |
"dictionary", key);
|
|
|
cb8e9e |
goto out;
|
|
|
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_ADD_ADDRESS_TO_PEER_FAIL,
|
|
|
cb8e9e |
"Could not add address to peer");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -768,7 +780,8 @@ gd_update_peerinfo_from_dict (glusterd_peerinfo_t *peerinfo, dict_t *dict,
|
|
|
cb8e9e |
snprintf (key, sizeof (key), "%s.address-count", prefix);
|
|
|
cb8e9e |
ret = dict_get_int32 (dict, key, &count);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Key %s not present in "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED, "Key %s not present in "
|
|
|
cb8e9e |
"dictionary", key);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -778,13 +791,15 @@ gd_update_peerinfo_from_dict (glusterd_peerinfo_t *peerinfo, dict_t *dict,
|
|
|
cb8e9e |
snprintf (key, sizeof (key), "%s.hostname%d",prefix, i);
|
|
|
cb8e9e |
ret = dict_get_str (dict, key, &hostname);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Key %s not present "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED, "Key %s not present "
|
|
|
cb8e9e |
"in dictionary", key);
|
|
|
cb8e9e |
goto out;
|
|
|
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_ADD_ADDRESS_TO_PEER_FAIL,
|
|
|
cb8e9e |
"Could not add address to peer");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -793,7 +808,7 @@ gd_update_peerinfo_from_dict (glusterd_peerinfo_t *peerinfo, dict_t *dict,
|
|
|
cb8e9e |
}
|
|
|
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 |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -825,7 +840,9 @@ gd_peerinfo_from_dict (dict_t *dict, const char *prefix)
|
|
|
cb8e9e |
0);
|
|
|
cb8e9e |
if (new_peer == NULL) {
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Could not create peerinfo "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_PEERINFO_CREATE_FAIL,
|
|
|
cb8e9e |
+ "Could not create peerinfo "
|
|
|
cb8e9e |
"object");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -833,7 +850,8 @@ gd_peerinfo_from_dict (dict_t *dict, const char *prefix)
|
|
|
cb8e9e |
snprintf (key, sizeof (key), "%s.uuid", prefix);
|
|
|
cb8e9e |
ret = dict_get_str (dict, key, &uuid_str);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Key %s not present in "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED, "Key %s not present in "
|
|
|
cb8e9e |
"dictionary", key);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
|
|
|
cb8e9e |
index 82b2e57..23a60d2 100644
|
|
|
cb8e9e |
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
|
|
|
cb8e9e |
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
|
|
|
cb8e9e |
@@ -158,7 +158,8 @@ glusterd_lock (uuid_t uuid)
|
|
|
cb8e9e |
glusterd_get_lock_owner (&owner);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!gf_uuid_is_null (owner)) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Unable to get lock"
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_GLUSTERD_LOCK_FAIL, "Unable to get lock"
|
|
|
cb8e9e |
" for uuid: %s, lock held by: %s",
|
|
|
cb8e9e |
uuid_utoa_r (uuid, new_owner_str),
|
|
|
cb8e9e |
uuid_utoa_r (owner, owner_str));
|
|
|
cb8e9e |
@@ -168,7 +169,7 @@ glusterd_lock (uuid_t uuid)
|
|
|
cb8e9e |
ret = glusterd_set_lock_owner (uuid);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "Cluster lock held by"
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "Cluster lock held by"
|
|
|
cb8e9e |
" %s", uuid_utoa (uuid));
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -194,23 +195,26 @@ glusterd_unlock (uuid_t uuid)
|
|
|
cb8e9e |
glusterd_get_lock_owner (&owner);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (gf_uuid_is_null (owner)) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Cluster lock not held!");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_GLUSTERD_LOCK_FAIL, "Cluster lock not held!");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = gf_uuid_compare (uuid, owner);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Cluster lock held by %s ,"
|
|
|
cb8e9e |
- "unlock req from %s!", uuid_utoa_r (owner ,owner_str)
|
|
|
cb8e9e |
- , uuid_utoa_r (uuid, new_owner_str));
|
|
|
cb8e9e |
- goto out;
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_GLUSTERD_LOCK_FAIL, "Cluster lock held by %s ,"
|
|
|
cb8e9e |
+ "unlock req from %s!", uuid_utoa_r (owner, owner_str),
|
|
|
cb8e9e |
+ uuid_utoa_r (uuid, new_owner_str));
|
|
|
cb8e9e |
+ goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = glusterd_unset_lock_owner (uuid);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Unable to clear cluster "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_GLUSTERD_UNLOCK_FAIL, "Unable to clear cluster "
|
|
|
cb8e9e |
"lock");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -340,7 +344,9 @@ glusterd_serialize_reply (rpcsvc_request_t *req, void *arg,
|
|
|
cb8e9e |
rsp_size = xdr_sizeof (xdrproc, arg);
|
|
|
cb8e9e |
iob = iobuf_get2 (req->svc->ctx->iobuf_pool, rsp_size);
|
|
|
cb8e9e |
if (!iob) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "Failed to get iobuf");
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, ENOMEM,
|
|
|
cb8e9e |
+ GD_MSG_NO_MEMORY,
|
|
|
cb8e9e |
+ "Failed to get iobuf");
|
|
|
cb8e9e |
goto ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -353,7 +359,8 @@ glusterd_serialize_reply (rpcsvc_request_t *req, void *arg,
|
|
|
cb8e9e |
*/
|
|
|
cb8e9e |
retlen = xdr_serialize_generic (*outmsg, arg, xdrproc);
|
|
|
cb8e9e |
if (retlen == -1) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "Failed to encode message");
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_ENCODE_FAIL, "Failed to encode message");
|
|
|
cb8e9e |
goto ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -385,7 +392,8 @@ glusterd_submit_reply (rpcsvc_request_t *req, void *arg,
|
|
|
cb8e9e |
if (!iobref) {
|
|
|
cb8e9e |
iobref = iobref_new ();
|
|
|
cb8e9e |
if (!iobref) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "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 |
@@ -394,7 +402,8 @@ glusterd_submit_reply (rpcsvc_request_t *req, void *arg,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
iob = glusterd_serialize_reply (req, arg, &rsp, xdrproc);
|
|
|
cb8e9e |
if (!iob) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "Failed to serialize reply");
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_SERIALIZE_MSG_FAIL, "Failed to serialize reply");
|
|
|
cb8e9e |
} else {
|
|
|
cb8e9e |
iobref_add (iobref, iob);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -407,7 +416,8 @@ glusterd_submit_reply (rpcsvc_request_t *req, void *arg,
|
|
|
cb8e9e |
* ref'ed the iob on receiving into the txlist.
|
|
|
cb8e9e |
*/
|
|
|
cb8e9e |
if (ret == -1) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "Reply submission failed");
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_REPLY_SUBMIT_FAIL, "Reply submission failed");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -516,7 +526,7 @@ glusterd_volinfo_new (glusterd_volinfo_t **volinfo)
|
|
|
cb8e9e |
ret = 0;
|
|
|
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 |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -545,7 +555,8 @@ glusterd_volinfo_dup (glusterd_volinfo_t *volinfo,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = glusterd_volinfo_new (&new_volinfo);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "not able to create the "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_VOLINFO_SET_FAIL, "not able to create the "
|
|
|
cb8e9e |
"duplicate volinfo for the volume %s",
|
|
|
cb8e9e |
volinfo->volname);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -613,7 +624,8 @@ glusterd_brickinfo_dup (glusterd_brickinfo_t *brickinfo,
|
|
|
cb8e9e |
strcpy (dup_brickinfo->mnt_opts, brickinfo->mnt_opts);
|
|
|
cb8e9e |
ret = gf_canonicalize_path (dup_brickinfo->path);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_ERROR, "Failed to canonicalize "
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_CANONICALIZE_FAIL, "Failed to canonicalize "
|
|
|
cb8e9e |
"brick path");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -739,7 +751,7 @@ glusterd_volume_brickinfos_delete (glusterd_volinfo_t *volinfo)
|
|
|
cb8e9e |
}
|
|
|
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 |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -783,7 +795,7 @@ glusterd_volinfo_delete (glusterd_volinfo_t *volinfo)
|
|
|
cb8e9e |
ret = 0;
|
|
|
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 |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -808,7 +820,7 @@ glusterd_brickinfo_new (glusterd_brickinfo_t **brickinfo)
|
|
|
cb8e9e |
ret = 0;
|
|
|
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 |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -825,7 +837,8 @@ glusterd_get_next_available_brickid (glusterd_volinfo_t *volinfo)
|
|
|
cb8e9e |
token = strrchr (brickinfo->brick_id, '-');
|
|
|
cb8e9e |
ret = gf_string2int32 (++token, &brickid);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_BRICK_ID_GEN_FAILED,
|
|
|
cb8e9e |
"Unable to generate brick ID");
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -848,7 +861,7 @@ glusterd_resolve_brick (glusterd_brickinfo_t *brickinfo)
|
|
|
cb8e9e |
GF_ASSERT (brickinfo);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = glusterd_hostname_to_uuid (brickinfo->hostname, brickinfo->uuid);
|
|
|
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 |
@@ -869,7 +882,8 @@ glusterd_get_brick_mount_dir (char *brickpath, char *hostname, char *mount_dir)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = glusterd_hostname_to_uuid (hostname, brick_uuid);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_HOSTNAME_TO_UUID_FAIL,
|
|
|
cb8e9e |
"Failed to convert hostname %s to uuid",
|
|
|
cb8e9e |
hostname);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -878,14 +892,16 @@ glusterd_get_brick_mount_dir (char *brickpath, char *hostname, char *mount_dir)
|
|
|
cb8e9e |
if (!gf_uuid_compare (brick_uuid, MY_UUID)) {
|
|
|
cb8e9e |
ret = glusterd_get_brick_root (brickpath, &mnt_pt);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ GD_MSG_BRICKPATH_ROOT_GET_FAIL,
|
|
|
cb8e9e |
"Could not get the root of the brick path %s",
|
|
|
cb8e9e |
brickpath);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (strncmp (brickpath, mnt_pt, strlen(mnt_pt))) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ GD_MSG_BRKPATH_MNTPNT_MISMATCH,
|
|
|
cb8e9e |
"brick: %s brick mount: %s",
|
|
|
cb8e9e |
brickpath, mnt_pt);
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
@@ -899,7 +915,7 @@ glusterd_get_brick_mount_dir (char *brickpath, char *hostname, char *mount_dir)
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_TRACE, "Returning %d", ret);
|
|
|
cb8e9e |
+ gf_msg_trace (this->name, 0, "Returning %d", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -961,7 +977,7 @@ out:
|
|
|
cb8e9e |
if (tmp_host)
|
|
|
cb8e9e |
GF_FREE (tmp_path);
|
|
|
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 |
@@ -1244,7 +1260,7 @@ glusterd_volume_brickinfo_get (uuid_t uuid, char *hostname, char *path,
|
|
|
cb8e9e |
continue;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (strcmp (brickiter->path, path) == 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, LOGSTR_FOUND_BRICK,
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, LOGSTR_FOUND_BRICK,
|
|
|
cb8e9e |
brickiter->hostname, brickiter->path,
|
|
|
cb8e9e |
volinfo->volname);
|
|
|
cb8e9e |
ret = 0;
|
|
|
cb8e9e |
@@ -1255,7 +1271,7 @@ glusterd_volume_brickinfo_get (uuid_t uuid, char *hostname, char *path,
|
|
|
cb8e9e |
}
|
|
|
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 |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -1279,7 +1295,7 @@ glusterd_volume_brickinfo_get_by_brick (char *brick,
|
|
|
cb8e9e |
brickinfo);
|
|
|
cb8e9e |
(void) glusterd_brickinfo_delete (tmp_brickinfo);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG, "Returning %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug ("", 0, "Returning %d", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -1319,7 +1335,7 @@ glusterd_volinfo_find_by_volume_id (uuid_t volume_id, glusterd_volinfo_t **volin
|
|
|
cb8e9e |
continue;
|
|
|
cb8e9e |
*volinfo = voliter;
|
|
|
cb8e9e |
ret = 0;
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "Volume %s found",
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "Volume %s found",
|
|
|
cb8e9e |
voliter->volname);
|
|
|
cb8e9e |
break;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -1343,7 +1359,7 @@ glusterd_volinfo_find (char *volname, glusterd_volinfo_t **volinfo)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
cds_list_for_each_entry (tmp_volinfo, &priv->volumes, vol_list) {
|
|
|
cb8e9e |
if (!strcmp (tmp_volinfo->volname, volname)) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "Volume %s found",
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "Volume %s found",
|
|
|
cb8e9e |
volname);
|
|
|
cb8e9e |
ret = 0;
|
|
|
cb8e9e |
*volinfo = tmp_volinfo;
|
|
|
cb8e9e |
@@ -1351,7 +1367,7 @@ glusterd_volinfo_find (char *volname, glusterd_volinfo_t **volinfo)
|
|
|
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 |
@@ -1370,14 +1386,14 @@ glusterd_service_stop (const char *service, char *pidfile, int sig,
|
|
|
cb8e9e |
gf_log (this->name, GF_LOG_INFO, "%s already stopped", service);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "Stopping gluster %s running in pid: "
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "Stopping gluster %s running in pid: "
|
|
|
cb8e9e |
"%d", service, pid);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = kill (pid, sig);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
switch (errno) {
|
|
|
cb8e9e |
case ESRCH:
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "%s is already stopped",
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "%s is already stopped",
|
|
|
cb8e9e |
service);
|
|
|
cb8e9e |
ret = 0;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -1490,7 +1506,7 @@ glusterd_brick_connect (glusterd_volinfo_t *volinfo,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG, "Returning %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug ("", 0, "Returning %d", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -1509,7 +1525,8 @@ _mk_rundir_p (glusterd_volinfo_t *volinfo)
|
|
|
cb8e9e |
snprintf (rundir, sizeof (rundir)-1, "%s/run", voldir);
|
|
|
cb8e9e |
ret = mkdir_p (rundir, 0777, _gf_true);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to create rundir");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, errno,
|
|
|
cb8e9e |
+ GD_MSG_CREATE_DIR_FAILED, "Failed to create rundir");
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -1676,7 +1693,8 @@ glusterd_volume_start_glusterfs (glusterd_volinfo_t *volinfo,
|
|
|
cb8e9e |
connect:
|
|
|
cb8e9e |
ret = glusterd_brick_connect (volinfo, brickinfo, socketpath);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_BRICK_DISCONNECTED,
|
|
|
cb8e9e |
"Failed to connect to brick %s:%s on %s",
|
|
|
cb8e9e |
brickinfo->hostname, brickinfo->path, socketpath);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -1827,7 +1845,8 @@ glusterd_readin_file (const char *filepath, int *line_count)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_ERROR, "%s", strerror (errno));
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_ERROR, errno,
|
|
|
cb8e9e |
+ GD_MSG_READIN_FILE_FAILED, "%s", strerror (errno));
|
|
|
cb8e9e |
if (fp)
|
|
|
cb8e9e |
fclose (fp);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -1899,7 +1918,8 @@ glusterd_volume_compute_cksum (glusterd_volinfo_t *volinfo, char *cksum_path,
|
|
|
cb8e9e |
fd = open (cksum_path, O_RDWR | O_APPEND | O_CREAT| O_TRUNC, 0600);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (-1 == fd) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Unable to open %s,"
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, errno,
|
|
|
cb8e9e |
+ GD_MSG_FILE_OP_FAILED, "Unable to open %s,"
|
|
|
cb8e9e |
" errno: %d", cksum_path, errno);
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -1911,7 +1931,8 @@ glusterd_volume_compute_cksum (glusterd_volinfo_t *volinfo, char *cksum_path,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
sort_fd = mkstemp (sort_filepath);
|
|
|
cb8e9e |
if (sort_fd < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Could not generate "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, errno,
|
|
|
cb8e9e |
+ GD_MSG_FILE_OP_FAILED, "Could not generate "
|
|
|
cb8e9e |
"temp file, reason: %s for volume: %s",
|
|
|
cb8e9e |
strerror (errno), volinfo->volname);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -1923,7 +1944,8 @@ glusterd_volume_compute_cksum (glusterd_volinfo_t *volinfo, char *cksum_path,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = glusterd_sort_and_redirect (filepath, sort_fd);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "sorting info file "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_FILE_OP_FAILED, "sorting info file "
|
|
|
cb8e9e |
"failed");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -1937,7 +1959,8 @@ glusterd_volume_compute_cksum (glusterd_volinfo_t *volinfo, char *cksum_path,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = get_checksum_for_path (cksum_path_final, &cksum);
|
|
|
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_CKSUM_GET_FAIL, "unable to get "
|
|
|
cb8e9e |
"checksum for path: %s", cksum_path_final);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -1961,7 +1984,7 @@ out:
|
|
|
cb8e9e |
close (fd);
|
|
|
cb8e9e |
if (unlink_sortfile)
|
|
|
cb8e9e |
unlink (sort_filepath);
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "Returning with %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "Returning with %d", ret);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -1999,7 +2022,8 @@ int glusterd_compute_cksum (glusterd_volinfo_t *volinfo,
|
|
|
cb8e9e |
ret = glusterd_volume_compute_cksum (volinfo, cksum_path, filepath,
|
|
|
cb8e9e |
is_quota_conf, &cs);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to compute checksum "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_CKSUM_COMPUTE_FAIL, "Failed to compute checksum "
|
|
|
cb8e9e |
"for volume %s", volinfo->volname);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -2026,13 +2050,16 @@ _add_dict_to_prdict (dict_t *this, char *key, data_t *value, void *data)
|
|
|
cb8e9e |
ctx->key_name, ctx->opt_count);
|
|
|
cb8e9e |
ret = dict_set_str (ctx->dict, optkey, key);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "option add for %s%d %s",
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_SET_FAILED, "option add for %s%d %s",
|
|
|
cb8e9e |
ctx->key_name, ctx->opt_count, key);
|
|
|
cb8e9e |
snprintf (optkey, sizeof (optkey), "%s.%s%d", ctx->prefix,
|
|
|
cb8e9e |
ctx->val_name, ctx->opt_count);
|
|
|
cb8e9e |
ret = dict_set_str (ctx->dict, optkey, value->data);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "option add for %s%d %s",
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_SET_FAILED,
|
|
|
cb8e9e |
+ "option add for %s%d %s",
|
|
|
cb8e9e |
ctx->val_name, ctx->opt_count, value->data);
|
|
|
cb8e9e |
ctx->opt_count++;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -2406,7 +2433,7 @@ out:
|
|
|
cb8e9e |
GF_FREE (rebalance_id_str);
|
|
|
cb8e9e |
GF_FREE (rb_id_str);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "Returning with %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "Returning with %d", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -2450,7 +2477,8 @@ glusterd_vol_add_quota_conf_to_dict (glusterd_volinfo_t *volinfo, dict_t* load,
|
|
|
cb8e9e |
if (ret == 0) {
|
|
|
cb8e9e |
break;
|
|
|
cb8e9e |
} else if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_CRITICAL, "Quota "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_CRITICAL, 0,
|
|
|
cb8e9e |
+ GD_MSG_QUOTA_CONF_CORRUPT, "Quota "
|
|
|
cb8e9e |
"configuration store may be corrupt.");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -2547,7 +2575,7 @@ out:
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
dict_unref (dict);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_TRACE, "Returning %d", ret);
|
|
|
cb8e9e |
+ gf_msg_trace (this->name, 0, "Returning %d", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -2627,7 +2655,7 @@ glusterd_compare_friend_volume (dict_t *peer_data, int32_t count,
|
|
|
cb8e9e |
snprintf (key, sizeof (key), "volume%d.quota-version", count);
|
|
|
cb8e9e |
ret = dict_get_uint32 (peer_data, key, "a_version);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "quota-version key absent for"
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "quota-version key absent for"
|
|
|
cb8e9e |
" volume %s in peer %s's response", volinfo->volname,
|
|
|
cb8e9e |
hostname);
|
|
|
cb8e9e |
ret = 0;
|
|
|
cb8e9e |
@@ -2656,7 +2684,7 @@ glusterd_compare_friend_volume (dict_t *peer_data, int32_t count,
|
|
|
cb8e9e |
snprintf (key, sizeof (key), "volume%d.quota-cksum", count);
|
|
|
cb8e9e |
ret = dict_get_uint32 (peer_data, key, "a_cksum);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "quota checksum absent for "
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "quota checksum absent for "
|
|
|
cb8e9e |
"volume %s in peer %s's response", volinfo->volname,
|
|
|
cb8e9e |
hostname);
|
|
|
cb8e9e |
ret = 0;
|
|
|
cb8e9e |
@@ -2676,7 +2704,7 @@ glusterd_compare_friend_volume (dict_t *peer_data, int32_t count,
|
|
|
cb8e9e |
*status = GLUSTERD_VOL_COMP_SCS;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "Returning with ret: %d, status: %d",
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "Returning with ret: %d, status: %d",
|
|
|
cb8e9e |
ret, *status);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -2729,8 +2757,9 @@ import_prdict_dict (dict_t *peer_data, dict_t *dst_dict, char *key_prefix,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (msg[0])
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_ERROR, "%s", msg);
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG, "Returning with %d", ret);
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_IMPORT_PRDICT_DICT, "%s", msg);
|
|
|
cb8e9e |
+ gf_msg_debug ("", 0, "Returning with %d", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -2807,8 +2836,9 @@ glusterd_import_friend_volume_opts (dict_t *peer_data, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (msg[0])
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_ERROR, "%s", msg);
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG, "Returning with %d", ret);
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_VOL_OPTS_IMPORT_FAIL, "%s", msg);
|
|
|
cb8e9e |
+ gf_msg_debug ("", 0, "Returning with %d", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -2894,8 +2924,9 @@ glusterd_import_new_brick (dict_t *peer_data, int32_t vol_count,
|
|
|
cb8e9e |
*brickinfo = new_brickinfo;
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (msg[0])
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_ERROR, "%s", msg);
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG, "Returning with %d", ret);
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_BRICK_IMPORT_FAIL, "%s", msg);
|
|
|
cb8e9e |
+ gf_msg_debug ("", 0, "Returning with %d", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -2935,7 +2966,7 @@ glusterd_import_bricks (dict_t *peer_data, int32_t vol_count,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = 0;
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG, "Returning with %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug ("", 0, "Returning with %d", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -2982,14 +3013,14 @@ glusterd_import_quota_conf (dict_t *peer_data, int vol_idx,
|
|
|
cb8e9e |
key[sizeof(key)-1] = '\0';
|
|
|
cb8e9e |
ret = dict_get_uint32 (peer_data, key, &new_volinfo->quota_conf_cksum);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "Failed to get quota cksum");
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "Failed to get quota cksum");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
snprintf (key, sizeof (key)-1, "%s%d.quota-version", prefix, vol_idx);
|
|
|
cb8e9e |
key[sizeof(key)-1] = '\0';
|
|
|
cb8e9e |
ret = dict_get_uint32 (peer_data, key,
|
|
|
cb8e9e |
&new_volinfo->quota_conf_version);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "Failed to get quota "
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "Failed to get quota "
|
|
|
cb8e9e |
"version");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
snprintf (key, sizeof (key)-1, "%s%d.gfid-count", prefix, vol_idx);
|
|
|
cb8e9e |
@@ -3021,7 +3052,8 @@ glusterd_import_quota_conf (dict_t *peer_data, int vol_idx,
|
|
|
cb8e9e |
ret = glusterd_quota_conf_write_gfid (fd, gfid,
|
|
|
cb8e9e |
(char)gfid_type);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_CRITICAL, "Unable to write "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_CRITICAL, errno,
|
|
|
cb8e9e |
+ GD_MSG_QUOTA_CONF_WRITE_FAIL, "Unable to write "
|
|
|
cb8e9e |
"gfid %s into quota.conf for %s", gfid_str,
|
|
|
cb8e9e |
new_volinfo->volname);
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
@@ -3037,14 +3069,16 @@ out:
|
|
|
cb8e9e |
if (!ret) {
|
|
|
cb8e9e |
ret = glusterd_compute_cksum (new_volinfo, _gf_true);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_CKSUM_COMPUTE_FAIL,
|
|
|
cb8e9e |
"Failed to compute checksum");
|
|
|
cb8e9e |
goto clear_quota_conf;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = glusterd_store_save_quota_version_and_cksum (new_volinfo);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_QUOTA_CKSUM_VER_STORE_FAIL,
|
|
|
cb8e9e |
"Failed to save quota version and checksum");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -3092,7 +3126,7 @@ gd_import_friend_volume_rebal_dict (dict_t *dict, int count,
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (ret && volinfo->rebal.dict)
|
|
|
cb8e9e |
dict_unref (volinfo->rebal.dict);
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_DEBUG, "Returning with %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug (THIS->name, 0, "Returning with %d", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -3195,7 +3229,8 @@ glusterd_import_volinfo (dict_t *peer_data, int count,
|
|
|
cb8e9e |
snprintf (key, sizeof (key), "%s%d.stripe_count", prefix, count);
|
|
|
cb8e9e |
ret = dict_get_int32 (peer_data, key, &new_volinfo->stripe_count);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_INFO,
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_INFO, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED,
|
|
|
cb8e9e |
"peer is possibly old version");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
/* not having a 'replica_count' key is not a error
|
|
|
cb8e9e |
@@ -3204,7 +3239,8 @@ glusterd_import_volinfo (dict_t *peer_data, int count,
|
|
|
cb8e9e |
snprintf (key, sizeof (key), "%s%d.replica_count", prefix, count);
|
|
|
cb8e9e |
ret = dict_get_int32 (peer_data, key, &new_volinfo->replica_count);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_INFO,
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_INFO, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED,
|
|
|
cb8e9e |
"peer is possibly old version");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
/* not having a 'disperse_count' key is not a error
|
|
|
cb8e9e |
@@ -3213,7 +3249,8 @@ glusterd_import_volinfo (dict_t *peer_data, int count,
|
|
|
cb8e9e |
snprintf (key, sizeof (key), "%s%d.disperse_count", prefix, count);
|
|
|
cb8e9e |
ret = dict_get_int32 (peer_data, key, &new_volinfo->disperse_count);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_INFO,
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_INFO, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED,
|
|
|
cb8e9e |
"peer is possibly old version");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
/* not having a 'redundancy_count' key is not a error
|
|
|
cb8e9e |
@@ -3222,7 +3259,8 @@ glusterd_import_volinfo (dict_t *peer_data, int count,
|
|
|
cb8e9e |
snprintf (key, sizeof (key), "%s%d.redundancy_count", prefix, count);
|
|
|
cb8e9e |
ret = dict_get_int32 (peer_data, key, &new_volinfo->redundancy_count);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_INFO,
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_INFO, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED,
|
|
|
cb8e9e |
"peer is possibly old version");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
/* not having a 'dist_count' key is not a error
|
|
|
cb8e9e |
@@ -3231,7 +3269,8 @@ glusterd_import_volinfo (dict_t *peer_data, int count,
|
|
|
cb8e9e |
snprintf (key, sizeof (key), "%s%d.dist_count", prefix, count);
|
|
|
cb8e9e |
ret = dict_get_int32 (peer_data, key, &new_volinfo->dist_leaf_count);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_INFO,
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_INFO, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED,
|
|
|
cb8e9e |
"peer is possibly old version");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
/* not having a 'hot_brick_count' key is not a error
|
|
|
cb8e9e |
@@ -3418,7 +3457,9 @@ glusterd_import_volinfo (dict_t *peer_data, int count,
|
|
|
cb8e9e |
ret = gd_import_volume_snap_details (peer_data, new_volinfo, key,
|
|
|
cb8e9e |
volname);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_ERROR, "Failed to import snapshot "
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_SNAP_DETAILS_IMPORT_FAIL,
|
|
|
cb8e9e |
+ "Failed to import snapshot "
|
|
|
cb8e9e |
"details for volume %s", volname);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -3453,7 +3494,8 @@ glusterd_import_volinfo (dict_t *peer_data, int count,
|
|
|
cb8e9e |
} else if (((op_version == 0) && (client_op_version != 0)) ||
|
|
|
cb8e9e |
((op_version != 0) && (client_op_version == 0))) {
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED,
|
|
|
cb8e9e |
"Only one volume op-version found");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
} else {
|
|
|
cb8e9e |
@@ -3473,8 +3515,9 @@ glusterd_import_volinfo (dict_t *peer_data, int count,
|
|
|
cb8e9e |
*volinfo = new_volinfo;
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (msg[0])
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_ERROR, "%s", msg);
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG, "Returning with %d", ret);
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_VOLINFO_IMPORT_FAIL, "%s", msg);
|
|
|
cb8e9e |
+ gf_msg_debug ("", 0, "Returning with %d", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -3489,7 +3532,9 @@ glusterd_volume_disconnect_all_bricks (glusterd_volinfo_t *volinfo)
|
|
|
cb8e9e |
if (glusterd_is_brick_started (brickinfo)) {
|
|
|
cb8e9e |
ret = glusterd_brick_disconnect (brickinfo);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_ERROR, "Failed to "
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSD_BRICK_DISCONNECT_FAIL,
|
|
|
cb8e9e |
+ "Failed to "
|
|
|
cb8e9e |
"disconnect %s:%s", brickinfo->hostname,
|
|
|
cb8e9e |
brickinfo->path);
|
|
|
cb8e9e |
break;
|
|
|
cb8e9e |
@@ -3579,7 +3624,7 @@ glusterd_volinfo_stop_stale_bricks (glusterd_volinfo_t *new_volinfo,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = 0;
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG, "Returning with %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug ("", 0, "Returning with %d", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -3613,7 +3658,8 @@ glusterd_delete_stale_volume (glusterd_volinfo_t *stale_volinfo,
|
|
|
cb8e9e |
valid_volinfo->restored_from_snap))) {
|
|
|
cb8e9e |
ret = glusterd_lvm_snapshot_remove (NULL, stale_volinfo);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log(this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg(this->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ GD_MSG_SNAP_REMOVE_FAIL,
|
|
|
cb8e9e |
"Failed to remove lvm snapshot for "
|
|
|
cb8e9e |
"restored volume %s", stale_volinfo->volname);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -3733,14 +3779,15 @@ glusterd_import_friend_volume (dict_t *peer_data, size_t count)
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!new_volinfo) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0,
|
|
|
cb8e9e |
"Not importing snap volume");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = glusterd_snapdsvc_init (new_volinfo);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to initialize "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_SNAPD_INIT_FAIL, "Failed to initialize "
|
|
|
cb8e9e |
"snapdsvc for volume %s", new_volinfo->volname);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -3752,7 +3799,8 @@ glusterd_import_friend_volume (dict_t *peer_data, size_t count)
|
|
|
cb8e9e |
*/
|
|
|
cb8e9e |
ret = glusterd_snapdsvc_init (old_volinfo);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to initialize"
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_SNAPD_INIT_FAIL, "Failed to initialize"
|
|
|
cb8e9e |
" snapdsvc for old volume %s",
|
|
|
cb8e9e |
old_volinfo->volname);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -3784,7 +3832,7 @@ glusterd_import_friend_volume (dict_t *peer_data, size_t count)
|
|
|
cb8e9e |
glusterd_compare_volume_name);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG, "Returning with ret: %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug ("", 0, "Returning with ret: %d", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -3809,7 +3857,7 @@ glusterd_import_friend_volumes (dict_t *peer_data)
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG, "Returning with %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug ("", 0, "Returning with %d", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -3877,7 +3925,8 @@ glusterd_import_global_opts (dict_t *friend_data)
|
|
|
cb8e9e |
ret = import_prdict_dict (friend_data, import_options, "key", "val",
|
|
|
cb8e9e |
count, "global");
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to import"
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_GLOBAL_OPT_IMPORT_FAIL, "Failed to import"
|
|
|
cb8e9e |
" global options");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -3923,7 +3972,8 @@ glusterd_compare_friend_data (dict_t *peer_data, int32_t *status,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = glusterd_import_global_opts (peer_data);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Importing global "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_GLOBAL_OPT_IMPORT_FAIL, "Importing global "
|
|
|
cb8e9e |
"options failed");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -3957,7 +4007,7 @@ glusterd_compare_friend_data (dict_t *peer_data, int32_t *status,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0,
|
|
|
cb8e9e |
"Returning with ret: %d, status: %d", ret, *status);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -4057,7 +4107,8 @@ glusterd_unlink_file (char *sockfpath)
|
|
|
cb8e9e |
if (ENOENT == errno)
|
|
|
cb8e9e |
ret = 0;
|
|
|
cb8e9e |
else
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_ERROR, "Failed to remove %s"
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_ERROR, errno,
|
|
|
cb8e9e |
+ GD_MSG_FILE_OP_FAILED, "Failed to remove %s"
|
|
|
cb8e9e |
" error: %s", sockfpath, strerror (errno));
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -4070,32 +4121,44 @@ glusterd_nfs_pmap_deregister ()
|
|
|
cb8e9e |
if (pmap_unset (MOUNT_PROGRAM, MOUNTV3_VERSION))
|
|
|
cb8e9e |
gf_log ("", GF_LOG_INFO, "De-registered MOUNTV3 successfully");
|
|
|
cb8e9e |
else
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "De-register MOUNTV3 is unsuccessful");
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_PMAP_UNSET_FAIL,
|
|
|
cb8e9e |
+ "De-register MOUNTV3 is unsuccessful");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (pmap_unset (MOUNT_PROGRAM, MOUNTV1_VERSION))
|
|
|
cb8e9e |
gf_log ("", GF_LOG_INFO, "De-registered MOUNTV1 successfully");
|
|
|
cb8e9e |
else
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "De-register MOUNTV1 is unsuccessful");
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_PMAP_UNSET_FAIL,
|
|
|
cb8e9e |
+ "De-register MOUNTV1 is unsuccessful");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (pmap_unset (NFS_PROGRAM, NFSV3_VERSION))
|
|
|
cb8e9e |
gf_log ("", GF_LOG_INFO, "De-registered NFSV3 successfully");
|
|
|
cb8e9e |
else
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "De-register NFSV3 is unsuccessful");
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_PMAP_UNSET_FAIL,
|
|
|
cb8e9e |
+ "De-register NFSV3 is unsuccessful");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (pmap_unset (NLM_PROGRAM, NLMV4_VERSION))
|
|
|
cb8e9e |
gf_log ("", GF_LOG_INFO, "De-registered NLM v4 successfully");
|
|
|
cb8e9e |
else
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "De-registration of NLM v4 failed");
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_PMAP_UNSET_FAIL,
|
|
|
cb8e9e |
+ "De-registration of NLM v4 failed");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (pmap_unset (NLM_PROGRAM, NLMV1_VERSION))
|
|
|
cb8e9e |
gf_log ("", GF_LOG_INFO, "De-registered NLM v1 successfully");
|
|
|
cb8e9e |
else
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "De-registration of NLM v1 failed");
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_PMAP_UNSET_FAIL,
|
|
|
cb8e9e |
+ "De-registration of NLM v1 failed");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (pmap_unset (ACL_PROGRAM, ACLV3_VERSION))
|
|
|
cb8e9e |
gf_log ("", GF_LOG_INFO, "De-registered ACL v3 successfully");
|
|
|
cb8e9e |
else
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "De-registration of ACL v3 failed");
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_PMAP_UNSET_FAIL,
|
|
|
cb8e9e |
+ "De-registration of ACL v3 failed");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
int
|
|
|
cb8e9e |
@@ -4197,7 +4260,7 @@ glusterd_add_node_to_dict (char *server, dict_t *dict, int count,
|
|
|
cb8e9e |
|
|
|
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 |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -4316,7 +4379,7 @@ glusterd_volume_count_get (void)
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG, "Returning %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug ("", 0, "Returning %d", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -4366,7 +4429,9 @@ glusterd_brick_start (glusterd_volinfo_t *volinfo,
|
|
|
cb8e9e |
if (gf_uuid_is_null (brickinfo->uuid)) {
|
|
|
cb8e9e |
ret = glusterd_resolve_brick (brickinfo);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, FMTSTR_RESOLVE_BRICK,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_RESOLVE_BRICK_FAIL,
|
|
|
cb8e9e |
+ FMTSTR_RESOLVE_BRICK,
|
|
|
cb8e9e |
brickinfo->hostname, brickinfo->path);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -4378,13 +4443,15 @@ glusterd_brick_start (glusterd_volinfo_t *volinfo,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = glusterd_volume_start_glusterfs (volinfo, brickinfo, wait);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Unable to start brick %s:%s",
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_BRICK_DISCONNECTED,
|
|
|
cb8e9e |
+ "Unable to start brick %s:%s",
|
|
|
cb8e9e |
brickinfo->hostname, brickinfo->path);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
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 |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -4408,7 +4475,7 @@ glusterd_restart_bricks (glusterd_conf_t *conf)
|
|
|
cb8e9e |
start_svcs = _gf_true;
|
|
|
cb8e9e |
glusterd_svcs_manager (volinfo);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "starting the volume %s",
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "starting the volume %s",
|
|
|
cb8e9e |
volinfo->volname);
|
|
|
cb8e9e |
cds_list_for_each_entry (brickinfo, &volinfo->bricks,
|
|
|
cb8e9e |
brick_list) {
|
|
|
cb8e9e |
@@ -4425,7 +4492,7 @@ glusterd_restart_bricks (glusterd_conf_t *conf)
|
|
|
cb8e9e |
glusterd_svcs_manager (volinfo);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
start_svcs = _gf_true;
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "starting the snap "
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "starting the snap "
|
|
|
cb8e9e |
"volume %s", volinfo->volname);
|
|
|
cb8e9e |
cds_list_for_each_entry (brickinfo, &volinfo->bricks,
|
|
|
cb8e9e |
brick_list) {
|
|
|
cb8e9e |
@@ -4485,7 +4552,8 @@ _local_gsyncd_start (dict_t *this, char *key, data_t *value, void *data)
|
|
|
cb8e9e |
ret = glusterd_get_slave_info (slave, &slave_url, &slave_host,
|
|
|
cb8e9e |
&slave_vol, &op_errstr);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this1->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this1->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_SLAVEINFO_FETCH_ERROR,
|
|
|
cb8e9e |
"Unable to fetch slave details.");
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -4503,10 +4571,13 @@ _local_gsyncd_start (dict_t *this, char *key, data_t *value, void *data)
|
|
|
cb8e9e |
&is_template_in_use);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
if (!strstr(slave, "::"))
|
|
|
cb8e9e |
- gf_log (this1->name, GF_LOG_INFO,
|
|
|
cb8e9e |
+ gf_msg (this1->name, GF_LOG_INFO, 0,
|
|
|
cb8e9e |
+ GD_MSG_SLAVE_URL_INVALID,
|
|
|
cb8e9e |
"%s is not a valid slave url.", slave);
|
|
|
cb8e9e |
else
|
|
|
cb8e9e |
- gf_log (this1->name, GF_LOG_INFO, "Unable to get"
|
|
|
cb8e9e |
+ gf_msg (this1->name, GF_LOG_INFO, 0,
|
|
|
cb8e9e |
+ GD_MSG_GET_STATEFILE_NAME_FAILED,
|
|
|
cb8e9e |
+ "Unable to get"
|
|
|
cb8e9e |
" statefile's name");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -4514,7 +4585,8 @@ _local_gsyncd_start (dict_t *this, char *key, data_t *value, void *data)
|
|
|
cb8e9e |
/* If state-file entry is missing from the config file,
|
|
|
cb8e9e |
* do not start gsyncd on restart */
|
|
|
cb8e9e |
if (is_template_in_use) {
|
|
|
cb8e9e |
- gf_log (this1->name, GF_LOG_INFO,
|
|
|
cb8e9e |
+ gf_msg (this1->name, GF_LOG_INFO, 0,
|
|
|
cb8e9e |
+ GD_MSG_NO_STATEFILE_ENTRY,
|
|
|
cb8e9e |
"state-file entry is missing in config file."
|
|
|
cb8e9e |
"Not Restarting");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -4525,14 +4597,16 @@ _local_gsyncd_start (dict_t *this, char *key, data_t *value, void *data)
|
|
|
cb8e9e |
ret = gsync_status (volinfo->volname, slave, confpath,
|
|
|
cb8e9e |
&ret_status, &is_template_in_use);
|
|
|
cb8e9e |
if (ret == -1) {
|
|
|
cb8e9e |
- gf_log (this1->name, GF_LOG_INFO,
|
|
|
cb8e9e |
+ gf_msg (this1->name, GF_LOG_INFO, 0,
|
|
|
cb8e9e |
+ GD_MSG_GSYNC_VALIDATION_FAIL,
|
|
|
cb8e9e |
GEOREP" start option validation failed ");
|
|
|
cb8e9e |
ret = 0;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (is_template_in_use == _gf_true) {
|
|
|
cb8e9e |
- gf_log (this1->name, GF_LOG_INFO,
|
|
|
cb8e9e |
+ gf_msg (this1->name, GF_LOG_INFO, 0,
|
|
|
cb8e9e |
+ GD_MSG_PIDFILE_NOT_FOUND,
|
|
|
cb8e9e |
"pid-file entry is missing in config file."
|
|
|
cb8e9e |
"Not Restarting");
|
|
|
cb8e9e |
ret = 0;
|
|
|
cb8e9e |
@@ -4541,7 +4615,9 @@ _local_gsyncd_start (dict_t *this, char *key, data_t *value, void *data)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = glusterd_gsync_read_frm_status (statefile, buf, sizeof (buf));
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this1->name, GF_LOG_ERROR, "Unable to read the status");
|
|
|
cb8e9e |
+ gf_msg (this1->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_STAT_FILE_READ_FAILED,
|
|
|
cb8e9e |
+ "Unable to read the status");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -4580,7 +4656,9 @@ _local_gsyncd_start (dict_t *this, char *key, data_t *value, void *data)
|
|
|
cb8e9e |
ret = dict_set_dynstr_with_alloc (volinfo->gsync_active_slaves,
|
|
|
cb8e9e |
key1, "running");
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this1->name, GF_LOG_ERROR, "Unable to set key:%s"
|
|
|
cb8e9e |
+ gf_msg (this1->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_SET_FAILED,
|
|
|
cb8e9e |
+ "Unable to set key:%s"
|
|
|
cb8e9e |
" value:running in the dict", key1);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -4599,7 +4677,8 @@ out:
|
|
|
cb8e9e |
slave_host, slave_vol,
|
|
|
cb8e9e |
"Config Corrupted");
|
|
|
cb8e9e |
if (op_ret) {
|
|
|
cb8e9e |
- gf_log (this1->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this1->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_STATUSFILE_CREATE_FAILED,
|
|
|
cb8e9e |
"Unable to create status file"
|
|
|
cb8e9e |
". Error : %s", strerror (errno));
|
|
|
cb8e9e |
ret = op_ret;
|
|
|
cb8e9e |
@@ -4699,10 +4778,10 @@ glusterd_set_brick_status (glusterd_brickinfo_t *brickinfo,
|
|
|
cb8e9e |
GF_ASSERT (brickinfo);
|
|
|
cb8e9e |
brickinfo->status = status;
|
|
|
cb8e9e |
if (GF_BRICK_STARTED == status) {
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_DEBUG, "Setting brick %s:%s status "
|
|
|
cb8e9e |
+ gf_msg_debug ("glusterd", 0, "Setting brick %s:%s status "
|
|
|
cb8e9e |
"to started", brickinfo->hostname, brickinfo->path);
|
|
|
cb8e9e |
} else {
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_DEBUG, "Setting brick %s:%s status "
|
|
|
cb8e9e |
+ gf_msg_debug ("glusterd", 0, "Setting brick %s:%s status "
|
|
|
cb8e9e |
"to stopped", brickinfo->hostname, brickinfo->path);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -4758,7 +4837,8 @@ glusterd_get_brick_root (char *path, char **mount_point)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
*ptr = '\0';
|
|
|
cb8e9e |
if (stat (mnt_pt, &buf)) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_ERROR, "error in "
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_ERROR, errno,
|
|
|
cb8e9e |
+ GD_MSG_FILE_OP_FAILED, "error in "
|
|
|
cb8e9e |
"stat: %s", strerror (errno));
|
|
|
cb8e9e |
goto err;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -4771,7 +4851,8 @@ glusterd_get_brick_root (char *path, char **mount_point)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (ptr == mnt_pt) {
|
|
|
cb8e9e |
if (stat ("/", &buf)) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_ERROR, "error in "
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_ERROR, errno,
|
|
|
cb8e9e |
+ GD_MSG_FILE_OP_FAILED, "error in "
|
|
|
cb8e9e |
"stat: %s", strerror (errno));
|
|
|
cb8e9e |
goto err;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -4883,7 +4964,9 @@ glusterd_add_inode_size_to_dict (dict_t *dict, int count)
|
|
|
cb8e9e |
runner_add_arg (&runner, fs->fs_tool_arg);
|
|
|
cb8e9e |
runner_add_arg (&runner, device);
|
|
|
cb8e9e |
} else {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_ERROR, "could not find %s to get"
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_INODE_SIZE_GET_FAIL,
|
|
|
cb8e9e |
+ "could not find %s to get"
|
|
|
cb8e9e |
"inode size for %s (%s): %s package missing?",
|
|
|
cb8e9e |
fs->fs_tool_name, device, fs_name, fs->fs_tool_pkg);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -4891,8 +4974,9 @@ glusterd_add_inode_size_to_dict (dict_t *dict, int count)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = runner_start (&runner);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_ERROR, "failed to execute "
|
|
|
cb8e9e |
- "\"%s\": %s", fs->fs_tool_name, strerror (errno));
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_ERROR, errno,
|
|
|
cb8e9e |
+ GD_MSG_CMD_EXEC_FAIL, "failed to execute "
|
|
|
cb8e9e |
+ "\"%s\"", fs->fs_tool_name);
|
|
|
cb8e9e |
/*
|
|
|
cb8e9e |
* Runner_start might return an error after the child has
|
|
|
cb8e9e |
* been forked, e.g. if the program isn't there. In that
|
|
|
cb8e9e |
@@ -4921,7 +5005,8 @@ glusterd_add_inode_size_to_dict (dict_t *dict, int count)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = runner_end (&runner);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_ERROR, errno,
|
|
|
cb8e9e |
+ GD_MSG_CMD_EXEC_FAIL,
|
|
|
cb8e9e |
"%s exited with non-zero exit status",
|
|
|
cb8e9e |
fs->fs_tool_name);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -4929,7 +5014,8 @@ glusterd_add_inode_size_to_dict (dict_t *dict, int count)
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
if (!cur_word) {
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_INODE_SIZE_GET_FAIL,
|
|
|
cb8e9e |
"Unable to retrieve inode size using %s",
|
|
|
cb8e9e |
fs->fs_tool_name);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -4937,7 +5023,7 @@ glusterd_add_inode_size_to_dict (dict_t *dict, int count)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (dict_set_dynstr_with_alloc (cached_fs, device, cur_word)) {
|
|
|
cb8e9e |
/* not fatal if not entered into the cache */
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug (THIS->name, 0,
|
|
|
cb8e9e |
"failed to cache fs inode size for %s", device);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -4949,7 +5035,8 @@ cached:
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_ERROR, "failed to get inode size");
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_INODE_SIZE_GET_FAIL, "failed to get inode size");
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -5057,7 +5144,9 @@ glusterd_get_brick_mount_device (char *brick_path)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = glusterd_get_brick_root (brick_path, &mnt_pt);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to get mount point "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_BRICKPATH_ROOT_GET_FAIL,
|
|
|
cb8e9e |
+ "Failed to get mount point "
|
|
|
cb8e9e |
"for %s brick", brick_path);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -5065,7 +5154,9 @@ glusterd_get_brick_mount_device (char *brick_path)
|
|
|
cb8e9e |
entry = glusterd_get_mnt_entry_info (mnt_pt, buff, sizeof (buff),
|
|
|
cb8e9e |
&save_entry);
|
|
|
cb8e9e |
if (NULL == entry) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to get mnt entry "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_MNTENTRY_GET_FAIL,
|
|
|
cb8e9e |
+ "Failed to get mnt entry "
|
|
|
cb8e9e |
"for %s mount path", mnt_pt);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -5102,7 +5193,8 @@ glusterd_add_brick_detail_to_dict (glusterd_volinfo_t *volinfo,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = statvfs (brickinfo->path, &brickstat);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "statfs error: %s ",
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, errno,
|
|
|
cb8e9e |
+ GD_MSG_FILE_OP_FAILED, "statfs error: %s ",
|
|
|
cb8e9e |
strerror (errno));
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -5157,7 +5249,7 @@ glusterd_add_brick_detail_to_dict (glusterd_volinfo_t *volinfo,
|
|
|
cb8e9e |
ret = glusterd_add_inode_size_to_dict (dict, count);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "Error adding brick"
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "Error adding brick"
|
|
|
cb8e9e |
" detail to dict: %s", strerror (errno));
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -5246,7 +5338,7 @@ glusterd_add_brick_to_dict (glusterd_volinfo_t *volinfo,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (ret)
|
|
|
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 |
@@ -5277,7 +5369,8 @@ glusterd_get_all_volnames (dict_t *dict)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_ERROR, "failed to get all "
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_SET_FAILED, "failed to get all "
|
|
|
cb8e9e |
"volume names for status");
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -5307,7 +5400,7 @@ glusterd_all_volume_cond_check (glusterd_condition_func func, int status,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = 0;
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG, "returning %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug ("", 0, "returning %d", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -5332,7 +5425,8 @@ glusterd_brick_stop (glusterd_volinfo_t *volinfo,
|
|
|
cb8e9e |
if (gf_uuid_is_null (brickinfo->uuid)) {
|
|
|
cb8e9e |
ret = glusterd_resolve_brick (brickinfo);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, FMTSTR_RESOLVE_BRICK,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_RESOLVE_BRICK_FAIL, FMTSTR_RESOLVE_BRICK,
|
|
|
cb8e9e |
brickinfo->hostname, brickinfo->path);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -5345,19 +5439,20 @@ glusterd_brick_stop (glusterd_volinfo_t *volinfo,
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "About to stop glusterfs"
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "About to stop glusterfs"
|
|
|
cb8e9e |
" for brick %s:%s", brickinfo->hostname,
|
|
|
cb8e9e |
brickinfo->path);
|
|
|
cb8e9e |
ret = glusterd_volume_stop_glusterfs (volinfo, brickinfo, del_brick);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_CRITICAL, "Unable to stop"
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_CRITICAL, 0,
|
|
|
cb8e9e |
+ GD_MSG_BRICK_STOP_FAIL, "Unable to stop"
|
|
|
cb8e9e |
" brick: %s:%s", brickinfo->hostname,
|
|
|
cb8e9e |
brickinfo->path);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
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 |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -5448,8 +5543,9 @@ out:
|
|
|
cb8e9e |
if (is_allocated)
|
|
|
cb8e9e |
glusterd_brickinfo_delete (newbrickinfo);
|
|
|
cb8e9e |
if (op_errstr[0] != '\0')
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "%s", op_errstr);
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "returning %d ", ret);
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_BRICK_VALIDATE_FAIL, "%s", op_errstr);
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "returning %d ", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -5468,13 +5564,17 @@ glusterd_rb_check_bricks (glusterd_volinfo_t *volinfo,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (strcmp (rb->src_brick->hostname, src->hostname) ||
|
|
|
cb8e9e |
strcmp (rb->src_brick->path, src->path)) {
|
|
|
cb8e9e |
- gf_log("", GF_LOG_ERROR, "Replace brick src bricks differ");
|
|
|
cb8e9e |
+ gf_msg("", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_RB_SRC_BRICKS_MISMATCH,
|
|
|
cb8e9e |
+ "Replace brick src bricks differ");
|
|
|
cb8e9e |
return -1;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (strcmp (rb->dst_brick->hostname, dst->hostname) ||
|
|
|
cb8e9e |
strcmp (rb->dst_brick->path, dst->path)) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "Replace brick dst bricks differ");
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_RB_DST_BRICKS_MISMATCH,
|
|
|
cb8e9e |
+ "Replace brick dst bricks differ");
|
|
|
cb8e9e |
return -1;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -5586,7 +5686,8 @@ out:
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (strlen (msg)) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_ERROR, "%s", msg);
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_ERROR, errno,
|
|
|
cb8e9e |
+ GD_MSG_PATH_ALREADY_PART_OF_VOL, "%s", msg);
|
|
|
cb8e9e |
*op_errstr = gf_strdup (msg);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -5690,7 +5791,7 @@ glusterd_sm_tr_log_transition_add_to_dict (dict_t *dict,
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG, "returning %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug ("", 0, "returning %d", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -5731,7 +5832,7 @@ glusterd_sm_tr_log_add_to_dict (dict_t *dict,
|
|
|
cb8e9e |
ret = dict_set_int32 (dict, key, log->count);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG, "returning %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug ("", 0, "returning %d", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -5762,7 +5863,7 @@ glusterd_sm_tr_log_init (glusterd_sm_tr_log_t *log,
|
|
|
cb8e9e |
ret = 0;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG, "returning %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug ("", 0, "returning %d", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -5809,11 +5910,11 @@ glusterd_sm_tr_log_transition_add (glusterd_sm_tr_log_t *log,
|
|
|
cb8e9e |
if (log->count < log->size)
|
|
|
cb8e9e |
log->count++;
|
|
|
cb8e9e |
ret = 0;
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "Transitioning from '%s' to '%s' "
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "Transitioning from '%s' to '%s' "
|
|
|
cb8e9e |
"due to event '%s'", log->state_name_get (old_state),
|
|
|
cb8e9e |
log->state_name_get (new_state), log->event_name_get (event));
|
|
|
cb8e9e |
out:
|
|
|
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 |
@@ -5833,7 +5934,7 @@ glusterd_remove_pending_entry (struct cds_list_head *list, void *elem)
|
|
|
cb8e9e |
}
|
|
|
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 |
return ret;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -5865,7 +5966,7 @@ glusterd_delete_volume (glusterd_volinfo_t *volinfo)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
glusterd_volinfo_remove (volinfo);
|
|
|
cb8e9e |
out:
|
|
|
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 |
@@ -5923,7 +6024,7 @@ glusterd_get_local_brickpaths (glusterd_volinfo_t *volinfo, char **pathlist)
|
|
|
cb8e9e |
path_tokens = GF_CALLOC (sizeof(char*), volinfo->brick_count,
|
|
|
cb8e9e |
gf_gld_mt_charptr);
|
|
|
cb8e9e |
if (!path_tokens) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG, "Could not allocate memory.");
|
|
|
cb8e9e |
+ gf_msg_debug ("", 0, "Could not allocate memory.");
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -5940,7 +6041,7 @@ glusterd_get_local_brickpaths (glusterd_volinfo_t *volinfo, char **pathlist)
|
|
|
cb8e9e |
path[sizeof(path)-1] = '\0';
|
|
|
cb8e9e |
path_tokens[count] = gf_strdup (path);
|
|
|
cb8e9e |
if (!path_tokens[count]) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug ("", 0,
|
|
|
cb8e9e |
"Could not allocate memory.");
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -5952,7 +6053,7 @@ glusterd_get_local_brickpaths (glusterd_volinfo_t *volinfo, char **pathlist)
|
|
|
cb8e9e |
tmp_path_list = GF_CALLOC (sizeof(char), total_len + 1,
|
|
|
cb8e9e |
gf_gld_mt_char);
|
|
|
cb8e9e |
if (!tmp_path_list) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG, "Could not allocate memory.");
|
|
|
cb8e9e |
+ gf_msg_debug ("", 0, "Could not allocate memory.");
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -5975,12 +6076,12 @@ out:
|
|
|
cb8e9e |
path_tokens = NULL;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (ret == 0) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG, "No Local Bricks Present.");
|
|
|
cb8e9e |
+ gf_msg_debug ("", 0, "No Local Bricks Present.");
|
|
|
cb8e9e |
GF_FREE (tmp_path_list);
|
|
|
cb8e9e |
tmp_path_list = NULL;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG, "Returning %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug ("", 0, "Returning %d", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -6008,7 +6109,7 @@ glusterd_start_gsync (glusterd_volinfo_t *master_vol, char *slave,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!path_list) {
|
|
|
cb8e9e |
ret = 0;
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG, "No Bricks in this node."
|
|
|
cb8e9e |
+ gf_msg_debug ("", 0, "No Bricks in this node."
|
|
|
cb8e9e |
" Not starting gsyncd.");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -6071,7 +6172,7 @@ out:
|
|
|
cb8e9e |
"the " GEOREP " session");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG, "Returning %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug ("", 0, "Returning %d", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -6088,21 +6189,24 @@ glusterd_recreate_volfiles (glusterd_conf_t *conf)
|
|
|
cb8e9e |
cds_list_for_each_entry (volinfo, &conf->volumes, vol_list) {
|
|
|
cb8e9e |
ret = generate_brick_volfiles (volinfo);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_ERROR, "Failed to "
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_VOLFILE_CREATE_FAIL, "Failed to "
|
|
|
cb8e9e |
"regenerate brick volfiles for %s",
|
|
|
cb8e9e |
volinfo->volname);
|
|
|
cb8e9e |
op_ret = ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = generate_client_volfiles (volinfo, GF_CLIENT_TRUSTED);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_ERROR, "Failed to "
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_VOLFILE_CREATE_FAIL, "Failed to "
|
|
|
cb8e9e |
"regenerate trusted client volfiles for %s",
|
|
|
cb8e9e |
volinfo->volname);
|
|
|
cb8e9e |
op_ret = ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = generate_client_volfiles (volinfo, GF_CLIENT_OTHER);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_ERROR, "Failed to "
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_VOLFILE_CREATE_FAIL, "Failed to "
|
|
|
cb8e9e |
"regenerate client volfiles for %s",
|
|
|
cb8e9e |
volinfo->volname);
|
|
|
cb8e9e |
op_ret = ret;
|
|
|
cb8e9e |
@@ -6125,7 +6229,8 @@ glusterd_handle_upgrade_downgrade (dict_t *options, glusterd_conf_t *conf)
|
|
|
cb8e9e |
if (!ret) {
|
|
|
cb8e9e |
ret = gf_string2boolean (type, &upgrade);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_ERROR, "upgrade option "
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_STR_TO_BOOL_FAIL, "upgrade option "
|
|
|
cb8e9e |
"%s is not a valid boolean type", type);
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -6138,7 +6243,8 @@ glusterd_handle_upgrade_downgrade (dict_t *options, glusterd_conf_t *conf)
|
|
|
cb8e9e |
if (!ret) {
|
|
|
cb8e9e |
ret = gf_string2boolean (type, &downgrade);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_ERROR, "downgrade option "
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_STR_TO_BOOL_FAIL, "downgrade option "
|
|
|
cb8e9e |
"%s is not a valid boolean type", type);
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -6146,7 +6252,8 @@ glusterd_handle_upgrade_downgrade (dict_t *options, glusterd_conf_t *conf)
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (upgrade && downgrade) {
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_ERROR, "Both upgrade and downgrade"
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_WRONG_OPTS_SETTING, "Both upgrade and downgrade"
|
|
|
cb8e9e |
" options are set. Only one should be on");
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -6265,7 +6372,8 @@ glusterd_brick_statedump (glusterd_volinfo_t *volinfo,
|
|
|
cb8e9e |
if (gf_uuid_is_null (brickinfo->uuid)) {
|
|
|
cb8e9e |
ret = glusterd_resolve_brick (brickinfo);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_RESOLVE_BRICK_FAIL,
|
|
|
cb8e9e |
"Cannot resolve brick %s:%s",
|
|
|
cb8e9e |
brickinfo->hostname, brickinfo->path);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -6281,7 +6389,8 @@ glusterd_brick_statedump (glusterd_volinfo_t *volinfo,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
pidfile = fopen (pidfile_path, "r");
|
|
|
cb8e9e |
if (!pidfile) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "Unable to open pidfile: %s",
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, errno,
|
|
|
cb8e9e |
+ GD_MSG_FILE_OP_FAILED, "Unable to open pidfile: %s",
|
|
|
cb8e9e |
pidfile_path);
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -6289,7 +6398,9 @@ glusterd_brick_statedump (glusterd_volinfo_t *volinfo,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = fscanf (pidfile, "%d", &pid;;
|
|
|
cb8e9e |
if (ret <= 0) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "Unable to get pid of brick process");
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, errno,
|
|
|
cb8e9e |
+ GD_MSG_FILE_OP_FAILED,
|
|
|
cb8e9e |
+ "Unable to get pid of brick process");
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -6298,7 +6409,9 @@ glusterd_brick_statedump (glusterd_volinfo_t *volinfo,
|
|
|
cb8e9e |
DEFAULT_VAR_RUN_DIRECTORY"/glusterdump.%d.options", pid);
|
|
|
cb8e9e |
ret = glusterd_set_dump_options (dumpoptions_path, options, option_cnt);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "error while parsing the statedump "
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_BRK_STATEDUMP_FAIL,
|
|
|
cb8e9e |
+ "error while parsing the statedump "
|
|
|
cb8e9e |
"options");
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -6354,7 +6467,8 @@ glusterd_nfs_statedump (char *options, int option_cnt, char **op_errstr)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
pidfile = fopen (pidfile_path, "r");
|
|
|
cb8e9e |
if (!pidfile) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "Unable to open pidfile: %s",
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, errno,
|
|
|
cb8e9e |
+ GD_MSG_FILE_OP_FAILED, "Unable to open pidfile: %s",
|
|
|
cb8e9e |
pidfile_path);
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -6362,7 +6476,9 @@ glusterd_nfs_statedump (char *options, int option_cnt, char **op_errstr)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = fscanf (pidfile, "%d", &pid;;
|
|
|
cb8e9e |
if (ret <= 0) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "Unable to get pid of brick process");
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, errno,
|
|
|
cb8e9e |
+ GD_MSG_FILE_OP_FAILED,
|
|
|
cb8e9e |
+ "Unable to get pid of brick process");
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -6371,7 +6487,9 @@ glusterd_nfs_statedump (char *options, int option_cnt, char **op_errstr)
|
|
|
cb8e9e |
DEFAULT_VAR_RUN_DIRECTORY"/glusterdump.%d.options", pid);
|
|
|
cb8e9e |
ret = glusterd_set_dump_options (dumpoptions_path, options, option_cnt);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "error while parsing the statedump "
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_BRK_STATEDUMP_FAIL,
|
|
|
cb8e9e |
+ "error while parsing the statedump "
|
|
|
cb8e9e |
"options");
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -6429,7 +6547,8 @@ glusterd_quotad_statedump (char *options, int option_cnt, char **op_errstr)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
pidfile = fopen (pidfile_path, "r");
|
|
|
cb8e9e |
if (!pidfile) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Unable to open pidfile: %s",
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, errno,
|
|
|
cb8e9e |
+ GD_MSG_FILE_OP_FAILED, "Unable to open pidfile: %s",
|
|
|
cb8e9e |
pidfile_path);
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -6437,7 +6556,8 @@ glusterd_quotad_statedump (char *options, int option_cnt, char **op_errstr)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = fscanf (pidfile, "%d", &pid;;
|
|
|
cb8e9e |
if (ret <= 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Unable to get pid of quotad "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, errno,
|
|
|
cb8e9e |
+ GD_MSG_FILE_OP_FAILED, "Unable to get pid of quotad "
|
|
|
cb8e9e |
"process");
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -6447,7 +6567,8 @@ glusterd_quotad_statedump (char *options, int option_cnt, char **op_errstr)
|
|
|
cb8e9e |
DEFAULT_VAR_RUN_DIRECTORY"/glusterdump.%d.options", pid);
|
|
|
cb8e9e |
ret = glusterd_set_dump_options (dumpoptions_path, options, option_cnt);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "error while parsing "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_BRK_STATEDUMP_FAIL, "error while parsing "
|
|
|
cb8e9e |
"statedump options");
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -6497,7 +6618,7 @@ glusterd_friend_contains_vol_bricks (glusterd_volinfo_t *volinfo,
|
|
|
cb8e9e |
else
|
|
|
cb8e9e |
ret = 1;
|
|
|
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 |
@@ -6523,7 +6644,8 @@ glusterd_friend_remove_cleanup_vols (uuid_t uuid)
|
|
|
cb8e9e |
"Deleting stale volume %s", volinfo->volname);
|
|
|
cb8e9e |
ret = glusterd_delete_volume (volinfo);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_STALE_VOL_REMOVE_FAIL,
|
|
|
cb8e9e |
"Error deleting stale volume");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -6531,7 +6653,7 @@ glusterd_friend_remove_cleanup_vols (uuid_t uuid)
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = 0;
|
|
|
cb8e9e |
out:
|
|
|
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 |
@@ -6651,7 +6773,9 @@ glusterd_volume_defrag_restart (glusterd_volinfo_t *volinfo, char *op_errstr,
|
|
|
cb8e9e |
cbk, volinfo->rebal.op);
|
|
|
cb8e9e |
break;
|
|
|
cb8e9e |
default:
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Unknown defrag status (%d)."
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_REBALANCE_START_FAIL,
|
|
|
cb8e9e |
+ "Unknown defrag status (%d)."
|
|
|
cb8e9e |
"Not starting rebalance process for %s.",
|
|
|
cb8e9e |
volinfo->rebal.defrag_status, volinfo->volname);
|
|
|
cb8e9e |
break;
|
|
|
cb8e9e |
@@ -6725,19 +6849,24 @@ glusterd_validate_volume_id (dict_t *op_dict, glusterd_volinfo_t *volinfo)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_str (op_dict, "vol-id", &volid_str);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to get volume id for "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED,
|
|
|
cb8e9e |
+ "Failed to get volume id for "
|
|
|
cb8e9e |
"volume %s", volinfo->volname);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = gf_uuid_parse (volid_str, vol_uid);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to parse volume id "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_UUID_PARSE_FAIL,
|
|
|
cb8e9e |
+ "Failed to parse volume id "
|
|
|
cb8e9e |
"for volume %s", volinfo->volname);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (gf_uuid_compare (vol_uid, volinfo->volume_id)) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Volume ids of volume %s - %s"
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_VOL_ID_MISMATCH, "Volume ids of volume %s - %s"
|
|
|
cb8e9e |
" and %s - are different. Possibly a split brain among "
|
|
|
cb8e9e |
"peers.", volinfo->volname, volid_str,
|
|
|
cb8e9e |
uuid_utoa (volinfo->volume_id));
|
|
|
cb8e9e |
@@ -6769,32 +6898,32 @@ glusterd_defrag_volume_status_update (glusterd_volinfo_t *volinfo,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_uint64 (rsp_dict, "files", &files);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_TRACE,
|
|
|
cb8e9e |
+ gf_msg_trace (this->name, 0,
|
|
|
cb8e9e |
"failed to get file count");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_uint64 (rsp_dict, "size", &size);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_TRACE,
|
|
|
cb8e9e |
+ gf_msg_trace (this->name, 0,
|
|
|
cb8e9e |
"failed to get size of xfer");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_uint64 (rsp_dict, "lookups", &lookup);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_TRACE,
|
|
|
cb8e9e |
+ gf_msg_trace (this->name, 0,
|
|
|
cb8e9e |
"failed to get lookedup file count");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_int32 (rsp_dict, "status", (int32_t *)&status);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_TRACE,
|
|
|
cb8e9e |
+ gf_msg_trace (this->name, 0,
|
|
|
cb8e9e |
"failed to get status");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_uint64 (rsp_dict, "failures", &failures);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_TRACE,
|
|
|
cb8e9e |
+ gf_msg_trace (this->name, 0,
|
|
|
cb8e9e |
"failed to get failure count");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_uint64 (rsp_dict, "skipped", &skipped);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_TRACE,
|
|
|
cb8e9e |
+ gf_msg_trace (this->name, 0,
|
|
|
cb8e9e |
"failed to get skipped count");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_uint64 (rsp_dict, "promoted", &promoted);
|
|
|
cb8e9e |
@@ -6809,7 +6938,7 @@ glusterd_defrag_volume_status_update (glusterd_volinfo_t *volinfo,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_double (rsp_dict, "run-time", &run_time);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_TRACE,
|
|
|
cb8e9e |
+ gf_msg_trace (this->name, 0,
|
|
|
cb8e9e |
"failed to get run-time");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (files)
|
|
|
cb8e9e |
@@ -6858,7 +6987,9 @@ glusterd_check_topology_identical (const char *filename1,
|
|
|
cb8e9e |
/* fopen() the volfile1 to create the graph */
|
|
|
cb8e9e |
fp1 = fopen (filename1, "r");
|
|
|
cb8e9e |
if (fp1 == NULL) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "fopen() on file: %s failed "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, errno,
|
|
|
cb8e9e |
+ GD_MSG_FILE_OP_FAILED,
|
|
|
cb8e9e |
+ "fopen() on file: %s failed "
|
|
|
cb8e9e |
"(%s)", filename1, strerror (errno));
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -6866,7 +6997,9 @@ glusterd_check_topology_identical (const char *filename1,
|
|
|
cb8e9e |
/* fopen() the volfile2 to create the graph */
|
|
|
cb8e9e |
fp2 = fopen (filename2, "r");
|
|
|
cb8e9e |
if (fp2 == NULL) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "fopen() on file: %s failed "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, errno,
|
|
|
cb8e9e |
+ GD_MSG_FILE_OP_FAILED,
|
|
|
cb8e9e |
+ "fopen() on file: %s failed "
|
|
|
cb8e9e |
"(%s)", filename2, strerror (errno));
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -6894,7 +7027,7 @@ out:
|
|
|
cb8e9e |
if (grph2)
|
|
|
cb8e9e |
glusterfs_graph_destroy(grph2);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "Returning with %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "Returning with %d", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -6918,7 +7051,9 @@ glusterd_check_files_identical (char *filename1, char *filename2,
|
|
|
cb8e9e |
ret = stat (filename1, &buf1);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "stat on file: %s failed "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, errno,
|
|
|
cb8e9e |
+ GD_MSG_FILE_OP_FAILED,
|
|
|
cb8e9e |
+ "stat on file: %s failed "
|
|
|
cb8e9e |
"(%s)", filename1, strerror (errno));
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -6926,7 +7061,9 @@ glusterd_check_files_identical (char *filename1, char *filename2,
|
|
|
cb8e9e |
ret = stat (filename2, &buf2);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "stat on file: %s failed "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, errno,
|
|
|
cb8e9e |
+ GD_MSG_FILE_OP_FAILED,
|
|
|
cb8e9e |
+ "stat on file: %s failed "
|
|
|
cb8e9e |
"(%s)", filename2, strerror (errno));
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -6951,7 +7088,7 @@ glusterd_check_files_identical (char *filename1, char *filename2,
|
|
|
cb8e9e |
*identical = _gf_true;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "Returning with %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "Returning with %d", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -6979,7 +7116,8 @@ glusterd_volset_help (dict_t *dict, char **op_errstr)
|
|
|
cb8e9e |
#if (HAVE_LIB_XML)
|
|
|
cb8e9e |
ret = 0;
|
|
|
cb8e9e |
#else
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_MODULE_NOT_INSTALLED,
|
|
|
cb8e9e |
"libxml not present in the system");
|
|
|
cb8e9e |
if (op_errstr)
|
|
|
cb8e9e |
*op_errstr = gf_strdup ("Error: xml libraries not "
|
|
|
cb8e9e |
@@ -6997,7 +7135,7 @@ glusterd_volset_help (dict_t *dict, char **op_errstr)
|
|
|
cb8e9e |
*op_errstr = gf_strdup ("Failed to get volume options help");
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
|
|
|
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 |
@@ -7022,7 +7160,9 @@ glusterd_to_cli (rpcsvc_request_t *req, gf_cli_rsp *arg, struct iovec *payload,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_str (dict, "cmd-str", &cmd);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to get command "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED,
|
|
|
cb8e9e |
+ "Failed to get command "
|
|
|
cb8e9e |
"string");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (cmd) {
|
|
|
cb8e9e |
@@ -7056,14 +7196,16 @@ glusterd_append_gsync_status (dict_t *dst, dict_t *src)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_set_dynstr_with_alloc (dst, "gsync-status", stop_msg);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_WARNING, "Unable to set the stop"
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_SET_FAILED,
|
|
|
cb8e9e |
+ "Unable to set the stop"
|
|
|
cb8e9e |
"message in the ctx dictionary");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = 0;
|
|
|
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 |
@@ -7090,7 +7232,7 @@ glusterd_append_status_dicts (dict_t *dst, dict_t *src)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_int32 (src, "gsync-count", &src_count);
|
|
|
cb8e9e |
if (ret || !src_count) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG, "Source brick empty");
|
|
|
cb8e9e |
+ gf_msg_debug ("", 0, "Source brick empty");
|
|
|
cb8e9e |
ret = 0;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -7106,7 +7248,8 @@ glusterd_append_status_dicts (dict_t *dst, dict_t *src)
|
|
|
cb8e9e |
dst_sts_val = GF_CALLOC (1, sizeof(gf_gsync_status_t),
|
|
|
cb8e9e |
gf_common_mt_gsync_status_t);
|
|
|
cb8e9e |
if (!dst_sts_val) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "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 |
@@ -7123,7 +7266,7 @@ glusterd_append_status_dicts (dict_t *dst, dict_t *src)
|
|
|
cb8e9e |
ret = dict_set_int32 (dst, "gsync-count", dst_count+src_count);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG, "Returning %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug ("", 0, "Returning %d", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -7145,7 +7288,7 @@ glusterd_aggr_brick_mount_dirs (dict_t *aggr, dict_t *rsp_dict)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_int32 (rsp_dict, "brick_count", &brick_count);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "No brick_count present");
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "No brick_count present");
|
|
|
cb8e9e |
ret = 0;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -7156,7 +7299,7 @@ glusterd_aggr_brick_mount_dirs (dict_t *aggr, dict_t *rsp_dict)
|
|
|
cb8e9e |
ret = dict_get_str (rsp_dict, key, &brick_mount_dir);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
/* Coz the info will come from a different node */
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0,
|
|
|
cb8e9e |
"%s not present", key);
|
|
|
cb8e9e |
continue;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -7164,7 +7307,8 @@ glusterd_aggr_brick_mount_dirs (dict_t *aggr, dict_t *rsp_dict)
|
|
|
cb8e9e |
ret = dict_set_dynstr_with_alloc (aggr, key,
|
|
|
cb8e9e |
brick_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 %s", key);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -7172,7 +7316,7 @@ glusterd_aggr_brick_mount_dirs (dict_t *aggr, dict_t *rsp_dict)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = 0;
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_TRACE, "Returning %d ", ret);
|
|
|
cb8e9e |
+ gf_msg_trace (this->name, 0, "Returning %d ", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -7189,7 +7333,8 @@ glusterd_gsync_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict, char *op_errstr)
|
|
|
cb8e9e |
} else {
|
|
|
cb8e9e |
ctx = glusterd_op_get_ctx ();
|
|
|
cb8e9e |
if (!ctx) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_OPCTX_GET_FAIL,
|
|
|
cb8e9e |
"Operation Context is not present");
|
|
|
cb8e9e |
GF_ASSERT (0);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -7209,7 +7354,8 @@ glusterd_gsync_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict, char *op_errstr)
|
|
|
cb8e9e |
ret = dict_set_dynstr_with_alloc (ctx, "conf_path",
|
|
|
cb8e9e |
conf_path);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_SET_FAILED,
|
|
|
cb8e9e |
"Unable to store conf path.");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -7224,7 +7370,7 @@ glusterd_gsync_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict, char *op_errstr)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = 0;
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG, "Returning %d ", ret);
|
|
|
cb8e9e |
+ gf_msg_debug ("", 0, "Returning %d ", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -7246,7 +7392,8 @@ glusterd_rb_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict)
|
|
|
cb8e9e |
} else {
|
|
|
cb8e9e |
ctx = glusterd_op_get_ctx ();
|
|
|
cb8e9e |
if (!ctx) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_OPCTX_GET_FAIL,
|
|
|
cb8e9e |
"Operation Context is not present");
|
|
|
cb8e9e |
GF_ASSERT (0);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -7255,19 +7402,21 @@ glusterd_rb_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict)
|
|
|
cb8e9e |
if (rsp_dict) {
|
|
|
cb8e9e |
ret = dict_get_int32 (rsp_dict, "src-brick-port", &src_port);
|
|
|
cb8e9e |
if (ret == 0) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug ("", 0,
|
|
|
cb8e9e |
"src-brick-port=%d found", src_port);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_int32 (rsp_dict, "dst-brick-port", &dst_port);
|
|
|
cb8e9e |
if (ret == 0) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug ("", 0,
|
|
|
cb8e9e |
"dst-brick-port=%d found", dst_port);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = glusterd_aggr_brick_mount_dirs (ctx, rsp_dict);
|
|
|
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_BRICK_MOUNDIRS_AGGR_FAIL,
|
|
|
cb8e9e |
+ "Failed to "
|
|
|
cb8e9e |
"aggregate brick mount dirs");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -7277,7 +7426,7 @@ glusterd_rb_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict)
|
|
|
cb8e9e |
ret = dict_set_int32 (ctx, "src-brick-port",
|
|
|
cb8e9e |
src_port);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug ("", 0,
|
|
|
cb8e9e |
"Could not set src-brick");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -7287,7 +7436,7 @@ glusterd_rb_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict)
|
|
|
cb8e9e |
ret = dict_set_int32 (ctx, "dst-brick-port",
|
|
|
cb8e9e |
dst_port);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug ("", 0,
|
|
|
cb8e9e |
"Could not set dst-brick");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -7411,7 +7560,9 @@ glusterd_volume_status_add_peer_rsp (dict_t *this, char *key, data_t *value,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_set (rsp_ctx->dict, new_key, new_value);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "Unable to set key: %s in dict",
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_SET_FAILED,
|
|
|
cb8e9e |
+ "Unable to set key: %s in dict",
|
|
|
cb8e9e |
key);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
return 0;
|
|
|
cb8e9e |
@@ -7464,7 +7615,8 @@ glusterd_volume_status_aggregate_tasks_status (dict_t *ctx_dict,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_int32 (rsp_dict, "tasks", &remote_count);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED,
|
|
|
cb8e9e |
"Failed to get remote task count");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -7477,13 +7629,16 @@ glusterd_volume_status_aggregate_tasks_status (dict_t *ctx_dict,
|
|
|
cb8e9e |
glusterd_volume_status_copy_tasks_to_ctx_dict,
|
|
|
cb8e9e |
ctx_dict);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to copy tasks"
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_SET_FAILED, "Failed to copy tasks"
|
|
|
cb8e9e |
"to ctx_dict.");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (local_count != remote_count) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Local tasks count (%d) and "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_TASKS_COUNT_MISMATCH,
|
|
|
cb8e9e |
+ "Local tasks count (%d) and "
|
|
|
cb8e9e |
"remote tasks count (%d) do not match. Not aggregating "
|
|
|
cb8e9e |
"tasks status.", local_count, remote_count);
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
@@ -7500,7 +7655,8 @@ glusterd_volume_status_aggregate_tasks_status (dict_t *ctx_dict,
|
|
|
cb8e9e |
snprintf (key, sizeof (key), "task%d.type", i);
|
|
|
cb8e9e |
ret = dict_get_str (rsp_dict, key, &task_type);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED,
|
|
|
cb8e9e |
"Failed to get task typpe from rsp dict");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -7518,14 +7674,16 @@ glusterd_volume_status_aggregate_tasks_status (dict_t *ctx_dict,
|
|
|
cb8e9e |
snprintf (key, sizeof (key), "task%d.status", i);
|
|
|
cb8e9e |
ret = dict_get_int32 (rsp_dict, key, &remote_status);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED,
|
|
|
cb8e9e |
"Failed to get task status from rsp dict");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
snprintf (key, sizeof (key), "task%d.id", i);
|
|
|
cb8e9e |
ret = dict_get_str (rsp_dict, key, &remote_task_id);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED,
|
|
|
cb8e9e |
"Failed to get task id from rsp dict");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -7534,7 +7692,8 @@ glusterd_volume_status_aggregate_tasks_status (dict_t *ctx_dict,
|
|
|
cb8e9e |
snprintf (key, sizeof (key), "task%d.id", j);
|
|
|
cb8e9e |
ret = dict_get_str (ctx_dict, key, &local_task_id);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED,
|
|
|
cb8e9e |
"Failed to get local task-id");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -7543,7 +7702,8 @@ glusterd_volume_status_aggregate_tasks_status (dict_t *ctx_dict,
|
|
|
cb8e9e |
strlen (remote_task_id))) {
|
|
|
cb8e9e |
/* Quit if a matching local task is not found */
|
|
|
cb8e9e |
if (j == (local_count - 1)) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_TASKS_COUNT_MISMATCH,
|
|
|
cb8e9e |
"Could not find matching local "
|
|
|
cb8e9e |
"task for task %s",
|
|
|
cb8e9e |
remote_task_id);
|
|
|
cb8e9e |
@@ -7556,7 +7716,8 @@ glusterd_volume_status_aggregate_tasks_status (dict_t *ctx_dict,
|
|
|
cb8e9e |
snprintf (key, sizeof (key), "task%d.status", j);
|
|
|
cb8e9e |
ret = dict_get_int32 (ctx_dict, key, &local_status);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED,
|
|
|
cb8e9e |
"Failed to get local task status");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -7585,7 +7746,9 @@ glusterd_volume_status_aggregate_tasks_status (dict_t *ctx_dict,
|
|
|
cb8e9e |
ret = dict_set_int32 (ctx_dict, key,
|
|
|
cb8e9e |
remote_status);
|
|
|
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_TASK_STATUS_UPDATE_FAIL,
|
|
|
cb8e9e |
+ "Failed to "
|
|
|
cb8e9e |
"update task status");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -7671,7 +7834,8 @@ glusterd_volume_status_copy_to_op_ctx_dict (dict_t *aggr, dict_t *rsp_dict)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_int32 (rsp_dict, "other-count", &rsp_other_count);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED,
|
|
|
cb8e9e |
"Failed to get other count from rsp_dict");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -7699,7 +7863,8 @@ glusterd_volume_status_copy_to_op_ctx_dict (dict_t *aggr, dict_t *rsp_dict)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_set_int32 (ctx_dict, "count", node_count + rsp_node_count);
|
|
|
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 update node count");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -7707,7 +7872,8 @@ glusterd_volume_status_copy_to_op_ctx_dict (dict_t *aggr, dict_t *rsp_dict)
|
|
|
cb8e9e |
ret = dict_set_int32 (ctx_dict, "other-count",
|
|
|
cb8e9e |
(other_count + rsp_other_count));
|
|
|
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 update other-count");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -7795,7 +7961,9 @@ glusterd_volume_rebalance_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_str (ctx_dict, "volname", &volname);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "Unable to get volume name");
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED,
|
|
|
cb8e9e |
+ "Unable to get volume name");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -7806,7 +7974,9 @@ glusterd_volume_rebalance_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_int32 (rsp_dict, "count", &index);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "failed to get index");
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED,
|
|
|
cb8e9e |
+ "failed to get index");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
memset (key, 0, 256);
|
|
|
cb8e9e |
snprintf (key, 256, "node-uuid-%d", index);
|
|
|
cb8e9e |
@@ -7829,9 +7999,11 @@ glusterd_volume_rebalance_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict)
|
|
|
cb8e9e |
/* Setting the largest index value as the total count. */
|
|
|
cb8e9e |
ret = dict_get_int32 (ctx_dict, "count", &count);
|
|
|
cb8e9e |
if (count < current_index) {
|
|
|
cb8e9e |
- ret = dict_set_int32 (ctx_dict, "count", current_index);
|
|
|
cb8e9e |
- if (ret)
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "Failed to set count");
|
|
|
cb8e9e |
+ ret = dict_set_int32 (ctx_dict, "count", current_index);
|
|
|
cb8e9e |
+ if (ret)
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_SET_FAILED,
|
|
|
cb8e9e |
+ "Failed to set count");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
/* Setting the same index for the node, as is in the peerlist.*/
|
|
|
cb8e9e |
@@ -7839,7 +8011,7 @@ glusterd_volume_rebalance_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict)
|
|
|
cb8e9e |
snprintf (key, 256, "node-uuid-%d", current_index);
|
|
|
cb8e9e |
ret = dict_set_dynstr (ctx_dict, key, node_uuid_str);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug (THIS->name, 0,
|
|
|
cb8e9e |
"failed to set node-uuid");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -7851,7 +8023,7 @@ glusterd_volume_rebalance_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict)
|
|
|
cb8e9e |
snprintf (key, 256, "files-%d", current_index);
|
|
|
cb8e9e |
ret = dict_set_uint64 (ctx_dict, key, value);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug (THIS->name, 0,
|
|
|
cb8e9e |
"failed to set the file count");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -7864,7 +8036,7 @@ glusterd_volume_rebalance_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict)
|
|
|
cb8e9e |
snprintf (key, 256, "size-%d", current_index);
|
|
|
cb8e9e |
ret = dict_set_uint64 (ctx_dict, key, value);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug (THIS->name, 0,
|
|
|
cb8e9e |
"failed to set the size of migration");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -7877,7 +8049,7 @@ glusterd_volume_rebalance_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict)
|
|
|
cb8e9e |
snprintf (key, 256, "lookups-%d", current_index);
|
|
|
cb8e9e |
ret = dict_set_uint64 (ctx_dict, key, value);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug (THIS->name, 0,
|
|
|
cb8e9e |
"failed to set lookuped file count");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -7890,7 +8062,7 @@ glusterd_volume_rebalance_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict)
|
|
|
cb8e9e |
snprintf (key, 256, "status-%d", current_index);
|
|
|
cb8e9e |
ret = dict_set_int32 (ctx_dict, key, value32);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug (THIS->name, 0,
|
|
|
cb8e9e |
"failed to set status");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -7903,7 +8075,7 @@ glusterd_volume_rebalance_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict)
|
|
|
cb8e9e |
snprintf (key, 256, "failures-%d", current_index);
|
|
|
cb8e9e |
ret = dict_set_uint64 (ctx_dict, key, value);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug (THIS->name, 0,
|
|
|
cb8e9e |
"failed to set failure count");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -7916,7 +8088,7 @@ glusterd_volume_rebalance_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict)
|
|
|
cb8e9e |
snprintf (key, 256, "skipped-%d", current_index);
|
|
|
cb8e9e |
ret = dict_set_uint64 (ctx_dict, key, value);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug (THIS->name, 0,
|
|
|
cb8e9e |
"failed to set skipped count");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -7928,7 +8100,7 @@ glusterd_volume_rebalance_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict)
|
|
|
cb8e9e |
snprintf (key, 256, "run-time-%d", current_index);
|
|
|
cb8e9e |
ret = dict_set_double (ctx_dict, key, elapsed_time);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug (THIS->name, 0,
|
|
|
cb8e9e |
"failed to set run-time");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -7976,7 +8148,9 @@ glusterd_sys_exec_output_rsp_dict (dict_t *dst, dict_t *src)
|
|
|
cb8e9e |
int dst_output_count = 0;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!dst || !src) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "Source or Destination "
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_EMPTY,
|
|
|
cb8e9e |
+ "Source or Destination "
|
|
|
cb8e9e |
"dict is empty.");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -7985,7 +8159,7 @@ glusterd_sys_exec_output_rsp_dict (dict_t *dst, dict_t *src)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_int32 (src, "output_count", &src_output_count);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG, "No output from source");
|
|
|
cb8e9e |
+ gf_msg_debug ("", 0, "No output from source");
|
|
|
cb8e9e |
ret = 0;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -7996,7 +8170,9 @@ glusterd_sys_exec_output_rsp_dict (dict_t *dst, dict_t *src)
|
|
|
cb8e9e |
output_name[len] = '\0';
|
|
|
cb8e9e |
ret = dict_get_str (src, output_name, &output);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "Unable to fetch %s",
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED,
|
|
|
cb8e9e |
+ "Unable to fetch %s",
|
|
|
cb8e9e |
output_name);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -8006,7 +8182,9 @@ glusterd_sys_exec_output_rsp_dict (dict_t *dst, dict_t *src)
|
|
|
cb8e9e |
output_name[len] = '\0';
|
|
|
cb8e9e |
ret = dict_set_dynstr (dst, output_name, gf_strdup (output));
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "Unable to set %s",
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_SET_FAILED,
|
|
|
cb8e9e |
+ "Unable to set %s",
|
|
|
cb8e9e |
output_name);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -8015,7 +8193,7 @@ glusterd_sys_exec_output_rsp_dict (dict_t *dst, dict_t *src)
|
|
|
cb8e9e |
ret = dict_set_int32 (dst, "output_count",
|
|
|
cb8e9e |
dst_output_count+src_output_count);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG, "Returning %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug ("", 0, "Returning %d", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -8050,12 +8228,14 @@ glusterd_volume_heal_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict)
|
|
|
cb8e9e |
ret = dict_get_bin (aggr, "transaction_id", (void **)&txn_id);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
goto out;
|
|
|
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_get_txn_opinfo (txn_id, &txn_op_info);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_ERROR, "Failed to get txn_op_info "
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_TRANS_OPINFO_GET_FAIL,
|
|
|
cb8e9e |
+ "Failed to get txn_op_info "
|
|
|
cb8e9e |
"for txn_id = %s", uuid_utoa (*txn_id));
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -8111,7 +8291,9 @@ glusterd_volume_quota_copy_to_op_ctx_dict (dict_t *dict, dict_t *rsp_dict)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_int32 (dict, "type", &type);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to get quota opcode");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED,
|
|
|
cb8e9e |
+ "Failed to get quota opcode");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -8126,7 +8308,9 @@ glusterd_volume_quota_copy_to_op_ctx_dict (dict_t *dict, dict_t *rsp_dict)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_int32 (rsp_dict, "count", &rsp_dict_count);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to get the count of "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED,
|
|
|
cb8e9e |
+ "Failed to get the count of "
|
|
|
cb8e9e |
"gfids from the rsp dict");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -8137,7 +8321,7 @@ glusterd_volume_quota_copy_to_op_ctx_dict (dict_t *dict, dict_t *rsp_dict)
|
|
|
cb8e9e |
* called after self-staging on the originator. This must not
|
|
|
cb8e9e |
* be treated as error.
|
|
|
cb8e9e |
*/
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "Failed to get count of gfids"
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "Failed to get count of gfids"
|
|
|
cb8e9e |
" from req dict. This could be because count is not yet"
|
|
|
cb8e9e |
" copied from rsp_dict into op_ctx");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -8146,7 +8330,9 @@ glusterd_volume_quota_copy_to_op_ctx_dict (dict_t *dict, dict_t *rsp_dict)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_str (rsp_dict, key, &uuid_str);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to get gfid "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED,
|
|
|
cb8e9e |
+ "Failed to get gfid "
|
|
|
cb8e9e |
"from rsp dict");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -8161,7 +8347,9 @@ glusterd_volume_quota_copy_to_op_ctx_dict (dict_t *dict, dict_t *rsp_dict)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_set_dynstr (dict, key, uuid_str_dup);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to set gfid "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_SET_FAILED,
|
|
|
cb8e9e |
+ "Failed to set gfid "
|
|
|
cb8e9e |
"from rsp dict into req dict");
|
|
|
cb8e9e |
GF_FREE (uuid_str_dup);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -8170,7 +8358,9 @@ glusterd_volume_quota_copy_to_op_ctx_dict (dict_t *dict, dict_t *rsp_dict)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_set_int32 (dict, "count", rsp_dict_count + count);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to set aggregated "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_SET_FAILED,
|
|
|
cb8e9e |
+ "Failed to set aggregated "
|
|
|
cb8e9e |
"count in req dict");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -8379,13 +8569,17 @@ glusterd_heal_volume_brick_rsp (dict_t *req_dict, dict_t *rsp_dict,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_str (req_dict, "volname", &volname);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "Unable to get volume name");
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED,
|
|
|
cb8e9e |
+ "Unable to get volume name");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_int32 (req_dict, "heal-op", &heal_op);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "Unable to get heal_op");
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED,
|
|
|
cb8e9e |
+ "Unable to get heal_op");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -8446,7 +8640,9 @@ glusterd_status_volume_brick_rsp (dict_t *rsp_dict, dict_t *op_ctx,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = dict_get_int32 (rsp_dict, "index", &index);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_ERROR, "Couldn't get node index");
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED,
|
|
|
cb8e9e |
+ "Couldn't get node index");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
dict_del (rsp_dict, "index");
|
|
|
cb8e9e |
@@ -8478,7 +8674,9 @@ glusterd_defrag_volume_node_rsp (dict_t *req_dict, dict_t *rsp_dict,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_str (req_dict, "volname", &volname);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR, "Unable to get volume name");
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED,
|
|
|
cb8e9e |
+ "Unable to get volume name");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -8502,7 +8700,9 @@ glusterd_defrag_volume_node_rsp (dict_t *req_dict, dict_t *rsp_dict,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_set_int32 (op_ctx, "count", i);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_ERROR, "Failed to set count");
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_SET_FAILED,
|
|
|
cb8e9e |
+ "Failed to set count");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
snprintf (buf, 1024, "%s", uuid_utoa (MY_UUID));
|
|
|
cb8e9e |
node_str = gf_strdup (buf);
|
|
|
cb8e9e |
@@ -8510,56 +8710,64 @@ glusterd_defrag_volume_node_rsp (dict_t *req_dict, dict_t *rsp_dict,
|
|
|
cb8e9e |
snprintf (key, 256, "node-uuid-%d",i);
|
|
|
cb8e9e |
ret = dict_set_dynstr (op_ctx, key, node_str);
|
|
|
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 node-uuid");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
memset (key, 0 , 256);
|
|
|
cb8e9e |
snprintf (key, 256, "files-%d", i);
|
|
|
cb8e9e |
ret = dict_set_uint64 (op_ctx, key, volinfo->rebal.rebalance_files);
|
|
|
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 file count");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
memset (key, 0 , 256);
|
|
|
cb8e9e |
snprintf (key, 256, "size-%d", i);
|
|
|
cb8e9e |
ret = dict_set_uint64 (op_ctx, key, volinfo->rebal.rebalance_data);
|
|
|
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 size of xfer");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
memset (key, 0 , 256);
|
|
|
cb8e9e |
snprintf (key, 256, "lookups-%d", i);
|
|
|
cb8e9e |
ret = dict_set_uint64 (op_ctx, key, volinfo->rebal.lookedup_files);
|
|
|
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 lookedup file count");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
memset (key, 0 , 256);
|
|
|
cb8e9e |
snprintf (key, 256, "status-%d", i);
|
|
|
cb8e9e |
ret = dict_set_int32 (op_ctx, key, volinfo->rebal.defrag_status);
|
|
|
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 status");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
memset (key, 0 , 256);
|
|
|
cb8e9e |
snprintf (key, 256, "failures-%d", i);
|
|
|
cb8e9e |
ret = dict_set_uint64 (op_ctx, key, volinfo->rebal.rebalance_failures);
|
|
|
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 failure count");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
memset (key, 0 , 256);
|
|
|
cb8e9e |
snprintf (key, 256, "skipped-%d", i);
|
|
|
cb8e9e |
ret = dict_set_uint64 (op_ctx, key, volinfo->rebal.skipped_files);
|
|
|
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 skipped count");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
memset (key, 0, 256);
|
|
|
cb8e9e |
snprintf (key, 256, "run-time-%d", i);
|
|
|
cb8e9e |
ret = dict_set_double (op_ctx, key, volinfo->rebal.rebalance_time);
|
|
|
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 run-time");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
memset (key, 0 , 256);
|
|
|
cb8e9e |
@@ -8612,7 +8820,7 @@ glusterd_handle_node_rsp (dict_t *req_dict, void *pending_entry,
|
|
|
cb8e9e |
break;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_DEBUG, "Returning %d", ret);
|
|
|
cb8e9e |
+ gf_msg_debug ("", 0, "Returning %d", ret);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -8635,7 +8843,8 @@ glusterd_set_originator_uuid (dict_t *dict)
|
|
|
cb8e9e |
ret = dict_set_bin (dict, "originator_uuid",
|
|
|
cb8e9e |
originator_uuid, sizeof (uuid_t));
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("", GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_SET_FAILED,
|
|
|
cb8e9e |
"Failed to set originator_uuid.");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -8700,7 +8909,8 @@ glusterd_generate_and_set_task_id (dict_t *dict, char *key)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_set_dynstr (dict, key, uuid_str);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to set %s in dict",
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_SET_FAILED, "Failed to set %s in dict",
|
|
|
cb8e9e |
key);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -8731,7 +8941,8 @@ glusterd_copy_uuid_to_dict (uuid_t uuid, dict_t *dict, char *key)
|
|
|
cb8e9e |
ret = dict_set_dynstr (dict, key, task_id_str);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
GF_FREE (task_id_str);
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_SET_FAILED,
|
|
|
cb8e9e |
"Error setting uuid in dict with key %s", key);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -8832,7 +9043,8 @@ op_version_check (xlator_t *this, int min_op_version, char *msg, int msglen)
|
|
|
cb8e9e |
snprintf (msg, msglen, "One or more nodes do not support "
|
|
|
cb8e9e |
"the required op-version. Cluster op-version must "
|
|
|
cb8e9e |
"atleast be %d.", min_op_version);
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "%s", msg);
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_UNSUPPORTED_VERSION, "%s", msg);
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
@@ -8864,7 +9076,9 @@ glusterd_is_status_tasks_op (glusterd_op_t op, dict_t *dict)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_uint32 (dict, "cmd", &cmd);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_ERROR, "Failed to get opcode");
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED,
|
|
|
cb8e9e |
+ "Failed to get opcode");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -8979,7 +9193,9 @@ glusterd_validate_and_set_gfid (dict_t *op_ctx, dict_t *req_dict,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_int32 (op_ctx, "type", &op_code);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to get quota opcode");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED,
|
|
|
cb8e9e |
+ "Failed to get quota opcode");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -8993,13 +9209,17 @@ glusterd_validate_and_set_gfid (dict_t *op_ctx, dict_t *req_dict,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_str (op_ctx, "path", &path);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to get path");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED,
|
|
|
cb8e9e |
+ "Failed to get path");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_int32 (op_ctx, "count", &count);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to get count");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED,
|
|
|
cb8e9e |
+ "Failed to get count");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -9026,7 +9246,9 @@ glusterd_validate_and_set_gfid (dict_t *op_ctx, dict_t *req_dict,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_str (op_ctx, key, &uuid1_str);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to get key '%s'",
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED,
|
|
|
cb8e9e |
+ "Failed to get key '%s'",
|
|
|
cb8e9e |
key);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -9038,7 +9260,9 @@ glusterd_validate_and_set_gfid (dict_t *op_ctx, dict_t *req_dict,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_str (op_ctx, key, &uuid2_str);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to get key "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_GET_FAILED,
|
|
|
cb8e9e |
+ "Failed to get key "
|
|
|
cb8e9e |
"'%s'", key);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -9063,12 +9287,16 @@ glusterd_validate_and_set_gfid (dict_t *op_ctx, dict_t *req_dict,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_set_dynstr (req_dict, "gfid", uuid1_str_dup);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to set gfid");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_SET_FAILED,
|
|
|
cb8e9e |
+ "Failed to set gfid");
|
|
|
cb8e9e |
GF_FREE (uuid1_str_dup);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
} else {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to iterate through %d"
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_ITER_FAIL,
|
|
|
cb8e9e |
+ "Failed to iterate through %d"
|
|
|
cb8e9e |
" entries in the req dict", count);
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -9123,7 +9351,7 @@ glusterd_remove_auxiliary_mount (char *volname)
|
|
|
cb8e9e |
GLUSTERFS_GET_AUX_MOUNT_PIDFILE (pidfile, volname);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!gf_is_service_running (pidfile, NULL)) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "Aux mount of volume %s "
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "Aux mount of volume %s "
|
|
|
cb8e9e |
"absent, hence returning", volname);
|
|
|
cb8e9e |
return 0;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -9131,7 +9359,8 @@ glusterd_remove_auxiliary_mount (char *volname)
|
|
|
cb8e9e |
GLUSTERD_GET_QUOTA_AUX_MOUNT_PATH (mountdir, volname, "/");
|
|
|
cb8e9e |
ret = gf_umount_lazy (this->name, mountdir, 1);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "umount on %s failed, "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, errno,
|
|
|
cb8e9e |
+ GD_MSG_LAZY_UMOUNT_FAIL, "umount on %s failed, "
|
|
|
cb8e9e |
"reason : %s", mountdir, strerror (errno));
|
|
|
cb8e9e |
|
|
|
cb8e9e |
/* Hide EBADF as it means the mount is already gone */
|
|
|
cb8e9e |
@@ -9215,7 +9444,8 @@ glusterd_launch_synctask (synctask_fn_t fn, void *opaque)
|
|
|
cb8e9e |
ret = synctask_new (this->ctx->env, fn, gd_default_synctask_cbk, NULL,
|
|
|
cb8e9e |
opaque);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_CRITICAL, "Failed to spawn bricks"
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_CRITICAL, 0,
|
|
|
cb8e9e |
+ GD_MSG_SPAWN_SVCS_FAIL, "Failed to spawn bricks"
|
|
|
cb8e9e |
" and other volume related services");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -9326,7 +9556,9 @@ glusterd_update_mntopts (char *brick_path, glusterd_brickinfo_t *brickinfo)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = glusterd_get_brick_root (brick_path, &mnt_pt);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "getting the root "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_BRICKPATH_ROOT_GET_FAIL,
|
|
|
cb8e9e |
+ "getting the root "
|
|
|
cb8e9e |
"of the brick (%s) failed ", brick_path);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -9334,7 +9566,9 @@ glusterd_update_mntopts (char *brick_path, glusterd_brickinfo_t *brickinfo)
|
|
|
cb8e9e |
entry = glusterd_get_mnt_entry_info (mnt_pt, buff, sizeof (buff),
|
|
|
cb8e9e |
&save_entry);
|
|
|
cb8e9e |
if (!entry) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "getting the mount entry for "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_MNTENTRY_GET_FAIL,
|
|
|
cb8e9e |
+ "getting the mount entry for "
|
|
|
cb8e9e |
"the brick (%s) failed", brick_path);
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -9366,14 +9600,18 @@ glusterd_get_value_for_vme_entry (struct volopt_map_entry *vme, char **def_val)
|
|
|
cb8e9e |
CDS_INIT_LIST_HEAD (&vol_opt_handle.list);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (_get_xlator_opt_key_from_vme (vme, &key)) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to get %s key from "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_GET_KEY_FAILED,
|
|
|
cb8e9e |
+ "Failed to get %s key from "
|
|
|
cb8e9e |
"volume option entry", vme->key);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = xlator_volopt_dynload (vme->voltype, &dl_handle, &vol_opt_handle);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "xlator_volopt_dynload error "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_XLATOR_VOLOPT_DYNLOAD_ERROR,
|
|
|
cb8e9e |
+ "xlator_volopt_dynload error "
|
|
|
cb8e9e |
"(%d)", ret);
|
|
|
cb8e9e |
ret = -2;
|
|
|
cb8e9e |
goto cont;
|
|
|
cb8e9e |
@@ -9383,7 +9621,9 @@ glusterd_get_value_for_vme_entry (struct volopt_map_entry *vme, char **def_val)
|
|
|
cb8e9e |
&local_def_val, &descr);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
/*Swallow Error if option not found*/
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to get option for %s "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_GET_KEY_FAILED,
|
|
|
cb8e9e |
+ "Failed to get option for %s "
|
|
|
cb8e9e |
"key", key);
|
|
|
cb8e9e |
ret = -2;
|
|
|
cb8e9e |
goto cont;
|
|
|
cb8e9e |
@@ -9408,7 +9648,7 @@ cont:
|
|
|
cb8e9e |
goto out;
|
|
|
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 |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -9433,7 +9673,9 @@ glusterd_get_default_val_for_volopt (dict_t *ctx, gf_boolean_t all_opts,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
/* Check whether key is passed for a single option */
|
|
|
cb8e9e |
if (!all_opts && !input_key) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Key is NULL");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_KEY_NULL,
|
|
|
cb8e9e |
+ "Key is NULL");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -9460,14 +9702,18 @@ glusterd_get_default_val_for_volopt (dict_t *ctx, gf_boolean_t all_opts,
|
|
|
cb8e9e |
sprintf (dict_key, "key%d", count);
|
|
|
cb8e9e |
ret = dict_set_str(ctx, dict_key, vme->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,
|
|
|
cb8e9e |
+ "Failed to "
|
|
|
cb8e9e |
"set %s in dictionary", vme->key);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
sprintf (dict_key, "value%d", count);
|
|
|
cb8e9e |
ret = dict_set_dynstr_with_alloc (ctx, dict_key, def_val);
|
|
|
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,
|
|
|
cb8e9e |
+ "Failed to "
|
|
|
cb8e9e |
"set %s for key %s in dictionary", def_val,
|
|
|
cb8e9e |
vme->key);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -9482,7 +9728,9 @@ glusterd_get_default_val_for_volopt (dict_t *ctx, gf_boolean_t all_opts,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_set_int32 (ctx, "count", count);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Failed to set count "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_DICT_SET_FAILED,
|
|
|
cb8e9e |
+ "Failed to set count "
|
|
|
cb8e9e |
"in dictionary");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -9492,7 +9740,7 @@ out:
|
|
|
cb8e9e |
"option %s does not exist", orig_key);
|
|
|
cb8e9e |
*op_errstr = gf_strdup (err_str);
|
|
|
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 |
@@ -9532,7 +9780,7 @@ glusterd_get_volopt_content (dict_t * ctx, gf_boolean_t xml_out)
|
|
|
cb8e9e |
def_val = vme->value;
|
|
|
cb8e9e |
} else {
|
|
|
cb8e9e |
if (_get_xlator_opt_key_from_vme (vme, &key)) {
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_DEBUG, "Failed to "
|
|
|
cb8e9e |
+ gf_msg_debug ("glusterd", 0, "Failed to "
|
|
|
cb8e9e |
"get %s key from volume option entry",
|
|
|
cb8e9e |
vme->key);
|
|
|
cb8e9e |
goto out; /*Some error while geting key*/
|
|
|
cb8e9e |
@@ -9543,7 +9791,7 @@ glusterd_get_volopt_content (dict_t * ctx, gf_boolean_t xml_out)
|
|
|
cb8e9e |
&vol_opt_handle);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug ("glusterd", 0,
|
|
|
cb8e9e |
"xlator_volopt_dynload error(%d)", ret);
|
|
|
cb8e9e |
ret = 0;
|
|
|
cb8e9e |
goto cont;
|
|
|
cb8e9e |
@@ -9552,7 +9800,7 @@ glusterd_get_volopt_content (dict_t * ctx, gf_boolean_t xml_out)
|
|
|
cb8e9e |
ret = xlator_option_info_list (&vol_opt_handle, key,
|
|
|
cb8e9e |
&def_val, &descr);
|
|
|
cb8e9e |
if (ret) { /*Swallow Error i.e if option not found*/
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_DEBUG,
|
|
|
cb8e9e |
+ gf_msg_debug ("glusterd", 0,
|
|
|
cb8e9e |
"Failed to get option for %s key", key);
|
|
|
cb8e9e |
ret = 0;
|
|
|
cb8e9e |
goto cont;
|
|
|
cb8e9e |
@@ -9567,7 +9815,9 @@ glusterd_get_volopt_content (dict_t * ctx, gf_boolean_t xml_out)
|
|
|
cb8e9e |
goto cont;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
#else
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_ERROR, "Libxml not present");
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_MODULE_NOT_INSTALLED,
|
|
|
cb8e9e |
+ "Libxml not present");
|
|
|
cb8e9e |
#endif
|
|
|
cb8e9e |
} else {
|
|
|
cb8e9e |
snprintf (tmp_str, sizeof (tmp_str), "Option: %s\nDefault "
|
|
|
cb8e9e |
@@ -9595,7 +9845,9 @@ cont:
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
#else
|
|
|
cb8e9e |
if (xml_out)
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_ERROR, "Libxml not present");
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_MODULE_NOT_INSTALLED,
|
|
|
cb8e9e |
+ "Libxml not present");
|
|
|
cb8e9e |
#endif
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!xml_out)
|
|
|
cb8e9e |
@@ -9604,7 +9856,9 @@ cont:
|
|
|
cb8e9e |
#if (HAVE_LIB_XML)
|
|
|
cb8e9e |
output = gf_strdup ((char *)buf->content);
|
|
|
cb8e9e |
#else
|
|
|
cb8e9e |
- gf_log ("glusterd", GF_LOG_ERROR, "Libxml not present");
|
|
|
cb8e9e |
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_MODULE_NOT_INSTALLED,
|
|
|
cb8e9e |
+ "Libxml not present");
|
|
|
cb8e9e |
#endif
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (NULL == output) {
|
|
|
cb8e9e |
@@ -9614,7 +9868,7 @@ cont:
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_set_dynstr (ctx, "help-str", output);
|
|
|
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 |
@@ -9644,7 +9898,9 @@ glusterd_check_client_op_version_support (char *volname, uint32_t op_version,
|
|
|
cb8e9e |
pthread_mutex_unlock (&priv->xprt_lock);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "One or more clients "
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ GD_MSG_UNSUPPORTED_VERSION,
|
|
|
cb8e9e |
+ "One or more clients "
|
|
|
cb8e9e |
"don't support the required op-version");
|
|
|
cb8e9e |
if (op_errstr)
|
|
|
cb8e9e |
ret = gf_asprintf (op_errstr, "One or more connected "
|
|
|
cb8e9e |
--
|
|
|
cb8e9e |
1.7.1
|
|
|
cb8e9e |
|