summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-utils.c
diff options
context:
space:
mode:
authorNandaja Varma <nandaja.varma@gmail.com>2015-06-25 00:57:00 +0530
committerKaushal M <kaushal@redhat.com>2015-06-26 23:56:09 -0700
commit8708953fa3d9187997dc6d484dae663b4469c7ca (patch)
tree38e9ef4db291ee0c1c50805bc08aee6fa3c7780f /xlators/mgmt/glusterd/src/glusterd-utils.c
parent08586ee518de438fe2bbbaa74ae4c9a02a5d88cf (diff)
glusterd: Porting left out log messages to new framework
This is a backport of http://review.gluster.org/11388 cherry-picked from commit 23c1e6dc0fa86c014e1a8b6aa5729675f6d69017 >Change-Id: I70d40ae3b5f49a21e1b93f82885cd58fa2723647 >BUG: 1235538 >Signed-off-by: Nandaja Varma <nandaja.varma@gmail.com> Change-Id: I70d40ae3b5f49a21e1b93f82885cd58fa2723647 BUG: 1217722 Signed-off-by: Nandaja Varma <nandaja.varma@gmail.com> Reviewed-on: http://review.gluster.org/11422 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Anand Nekkunti <anekkunt@redhat.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c189
1 files changed, 113 insertions, 76 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 4d86cac79a8..0c0c0420ef5 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -1275,7 +1275,7 @@ glusterd_volume_brickinfo_get_by_brick (char *brick,
brickinfo);
(void) glusterd_brickinfo_delete (tmp_brickinfo);
out:
- gf_msg_debug ("", 0, "Returning %d", ret);
+ gf_msg_debug ("glusterd", 0, "Returning %d", ret);
return ret;
}
@@ -1363,7 +1363,9 @@ glusterd_service_stop (const char *service, char *pidfile, int sig,
GF_ASSERT (this);
if (!gf_is_service_running (pidfile, &pid)) {
ret = 0;
- gf_log (this->name, GF_LOG_INFO, "%s already stopped", service);
+ gf_msg (this->name, GF_LOG_INFO, 0,
+ GD_MSG_ALREADY_STOPPED,
+ "%s already stopped", service);
goto out;
}
gf_msg_debug (this->name, 0, "Stopping gluster %s running in pid: "
@@ -1486,7 +1488,7 @@ glusterd_brick_connect (glusterd_volinfo_t *volinfo,
}
out:
- gf_msg_debug ("", 0, "Returning %d", ret);
+ gf_msg_debug ("glusterd", 0, "Returning %d", ret);
return ret;
}
@@ -1540,7 +1542,8 @@ glusterd_volume_start_glusterfs (glusterd_volinfo_t *volinfo,
GF_ASSERT (priv);
if (brickinfo->snap_status == -1) {
- gf_log (this->name, GF_LOG_INFO,
+ gf_msg (this->name, GF_LOG_INFO, 0,
+ GD_MSG_SNAPSHOT_PENDING,
"Snapshot is pending on %s:%s. "
"Hence not starting the brick",
brickinfo->hostname,
@@ -1654,7 +1657,7 @@ glusterd_volume_start_glusterfs (glusterd_volinfo_t *volinfo,
if (volinfo->memory_accounting)
runner_add_arg (&runner, "--mem-accounting");
- runner_log (&runner, "", GF_LOG_DEBUG, "Starting GlusterFS");
+ runner_log (&runner, "", 0, "Starting GlusterFS");
if (wait) {
synclock_unlock (&priv->big_lock);
ret = runner_run (&runner);
@@ -1715,7 +1718,8 @@ glusterd_brick_disconnect (glusterd_brickinfo_t *brickinfo)
GF_ASSERT (brickinfo);
if (!brickinfo) {
- gf_log_callingfn ("glusterd", GF_LOG_WARNING, "!brickinfo");
+ gf_msg_callingfn ("glusterd", GF_LOG_WARNING, EINVAL,
+ GD_MSG_BRICK_NOT_FOUND, "!brickinfo");
return -1;
}
@@ -2739,7 +2743,7 @@ out:
if (msg[0])
gf_msg ("glusterd", GF_LOG_ERROR, 0,
GD_MSG_IMPORT_PRDICT_DICT, "%s", msg);
- gf_msg_debug ("", 0, "Returning with %d", ret);
+ gf_msg_debug ("glusterd", 0, "Returning with %d", ret);
return ret;
}
@@ -2818,7 +2822,7 @@ out:
if (msg[0])
gf_msg ("glusterd", GF_LOG_ERROR, 0,
GD_MSG_VOL_OPTS_IMPORT_FAIL, "%s", msg);
- gf_msg_debug ("", 0, "Returning with %d", ret);
+ gf_msg_debug ("glusterd", 0, "Returning with %d", ret);
return ret;
}
@@ -2906,7 +2910,7 @@ out:
if (msg[0])
gf_msg ("glusterd", GF_LOG_ERROR, 0,
GD_MSG_BRICK_IMPORT_FAIL, "%s", msg);
- gf_msg_debug ("", 0, "Returning with %d", ret);
+ gf_msg_debug ("glusterd", 0, "Returning with %d", ret);
return ret;
}
@@ -2946,7 +2950,7 @@ glusterd_import_bricks (dict_t *peer_data, int32_t vol_count,
}
ret = 0;
out:
- gf_msg_debug ("", 0, "Returning with %d", ret);
+ gf_msg_debug ("glusterd", 0, "Returning with %d", ret);
return ret;
}
@@ -3260,7 +3264,7 @@ glusterd_import_volinfo (dict_t *peer_data, int count,
ret = dict_get_int32 (peer_data, key,
&new_volinfo->tier_info.hot_brick_count);
if (ret)
- gf_log (THIS->name, GF_LOG_DEBUG,
+ gf_msg_debug (THIS->name, 0,
"peer is possibly old version");
/* not having a 'hot_type' key is not a error
@@ -3270,7 +3274,7 @@ glusterd_import_volinfo (dict_t *peer_data, int count,
ret = dict_get_int32 (peer_data, key,
&new_volinfo->tier_info.hot_type);
if (ret)
- gf_log (THIS->name, GF_LOG_DEBUG,
+ gf_msg_debug (THIS->name, 0,
"peer is possibly old version");
/* not having a 'hot_replica_count' key is not a error
@@ -3280,7 +3284,7 @@ glusterd_import_volinfo (dict_t *peer_data, int count,
ret = dict_get_int32 (peer_data, key,
&new_volinfo->tier_info.hot_replica_count);
if (ret)
- gf_log (THIS->name, GF_LOG_DEBUG,
+ gf_msg_debug (THIS->name, 0,
"peer is possibly old version");
/* not having a 'cold_brick_count' key is not a error
@@ -3290,7 +3294,7 @@ glusterd_import_volinfo (dict_t *peer_data, int count,
ret = dict_get_int32 (peer_data, key,
&new_volinfo->tier_info.cold_brick_count);
if (ret)
- gf_log (THIS->name, GF_LOG_DEBUG,
+ gf_msg_debug (THIS->name, 0,
"peer is possibly old version");
/* not having a 'cold_type' key is not a error
@@ -3300,7 +3304,7 @@ glusterd_import_volinfo (dict_t *peer_data, int count,
ret = dict_get_int32 (peer_data, key,
&new_volinfo->tier_info.cold_type);
if (ret)
- gf_log (THIS->name, GF_LOG_DEBUG,
+ gf_msg_debug (THIS->name, 0,
"peer is possibly old version");
/* not having a 'cold_replica_count' key is not a error
@@ -3310,7 +3314,7 @@ glusterd_import_volinfo (dict_t *peer_data, int count,
ret = dict_get_int32 (peer_data, key,
&new_volinfo->tier_info.cold_replica_count);
if (ret)
- gf_log (THIS->name, GF_LOG_DEBUG,
+ gf_msg_debug (THIS->name, 0,
"peer is possibly old version");
/* not having a 'cold_disperse_count' key is not a error
@@ -3320,7 +3324,7 @@ glusterd_import_volinfo (dict_t *peer_data, int count,
ret = dict_get_int32 (peer_data, key,
&new_volinfo->tier_info.cold_disperse_count);
if (ret)
- gf_log (THIS->name, GF_LOG_DEBUG,
+ gf_msg_debug (THIS->name, 0,
"peer is possibly old version");
/* not having a 'cold_redundancy_count' key is not a error
@@ -3331,7 +3335,7 @@ glusterd_import_volinfo (dict_t *peer_data, int count,
ret = dict_get_int32 (peer_data, key,
&new_volinfo->tier_info.cold_redundancy_count);
if (ret)
- gf_log (THIS->name, GF_LOG_DEBUG,
+ gf_msg_debug (THIS->name, 0,
"peer is possibly old version");
/* not having a 'cold_dist_count' key is not a error
@@ -3341,7 +3345,7 @@ glusterd_import_volinfo (dict_t *peer_data, int count,
ret = dict_get_int32 (peer_data, key,
&new_volinfo->tier_info.cold_dist_leaf_count);
if (ret)
- gf_log (THIS->name, GF_LOG_DEBUG,
+ gf_msg_debug (THIS->name, 0,
"peer is possibly old version");
new_volinfo->subvol_count = new_volinfo->brick_count/
@@ -3497,7 +3501,7 @@ out:
if (msg[0])
gf_msg ("glusterd", GF_LOG_ERROR, 0,
GD_MSG_VOLINFO_IMPORT_FAIL, "%s", msg);
- gf_msg_debug ("", 0, "Returning with %d", ret);
+ gf_msg_debug ("glusterd", 0, "Returning with %d", ret);
return ret;
}
@@ -3604,7 +3608,7 @@ glusterd_volinfo_stop_stale_bricks (glusterd_volinfo_t *new_volinfo,
}
ret = 0;
out:
- gf_msg_debug ("", 0, "Returning with %d", ret);
+ gf_msg_debug ("glusterd", 0, "Returning with %d", ret);
return ret;
}
@@ -3784,7 +3788,8 @@ glusterd_import_friend_volume (dict_t *peer_data, size_t count)
ret = glusterd_snapdsvc_init (new_volinfo);
if (ret) {
- gf_log (this->name, GF_LOG_ERROR, "Failed to initialize "
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ GD_MSG_SNAPD_INIT_FAIL, "Failed to initialize "
"snapdsvc for volume %s", new_volinfo->volname);
goto out;
}
@@ -3799,7 +3804,8 @@ glusterd_import_friend_volume (dict_t *peer_data, size_t count)
ret = glusterd_store_volinfo (new_volinfo, GLUSTERD_VOLINFO_VER_AC_NONE);
if (ret) {
- gf_log (this->name, GF_LOG_ERROR, "Failed to store "
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ GD_MSG_VOLINFO_STORE_FAIL, "Failed to store "
"volinfo for volume %s", new_volinfo->volname);
goto out;
}
@@ -3817,7 +3823,7 @@ glusterd_import_friend_volume (dict_t *peer_data, size_t count)
glusterd_compare_volume_name);
out:
- gf_msg_debug ("", 0, "Returning with ret: %d", ret);
+ gf_msg_debug ("glusterd", 0, "Returning with ret: %d", ret);
return ret;
}
@@ -3842,7 +3848,7 @@ glusterd_import_friend_volumes (dict_t *peer_data)
}
out:
- gf_msg_debug ("", 0, "Returning with %d", ret);
+ gf_msg_debug ("glusterd", 0, "Returning with %d", ret);
return ret;
}
@@ -4104,42 +4110,54 @@ void
glusterd_nfs_pmap_deregister ()
{
if (pmap_unset (MOUNT_PROGRAM, MOUNTV3_VERSION))
- gf_log ("", GF_LOG_INFO, "De-registered MOUNTV3 successfully");
+ gf_msg ("glusterd", GF_LOG_INFO, 0,
+ GD_MSG_DEREGISTER_SUCCESS,
+ "De-registered MOUNTV3 successfully");
else
gf_msg ("glusterd", GF_LOG_ERROR, 0,
GD_MSG_PMAP_UNSET_FAIL,
"De-register MOUNTV3 is unsuccessful");
if (pmap_unset (MOUNT_PROGRAM, MOUNTV1_VERSION))
- gf_log ("", GF_LOG_INFO, "De-registered MOUNTV1 successfully");
+ gf_msg ("glusterd", GF_LOG_INFO, 0,
+ GD_MSG_DEREGISTER_SUCCESS,
+ "De-registered MOUNTV1 successfully");
else
gf_msg ("glusterd", GF_LOG_ERROR, 0,
GD_MSG_PMAP_UNSET_FAIL,
"De-register MOUNTV1 is unsuccessful");
if (pmap_unset (NFS_PROGRAM, NFSV3_VERSION))
- gf_log ("", GF_LOG_INFO, "De-registered NFSV3 successfully");
+ gf_msg ("glusterd", GF_LOG_INFO, 0,
+ GD_MSG_DEREGISTER_SUCCESS,
+ "De-registered NFSV3 successfully");
else
gf_msg ("glusterd", GF_LOG_ERROR, 0,
GD_MSG_PMAP_UNSET_FAIL,
"De-register NFSV3 is unsuccessful");
if (pmap_unset (NLM_PROGRAM, NLMV4_VERSION))
- gf_log ("", GF_LOG_INFO, "De-registered NLM v4 successfully");
+ gf_msg ("glusterd", GF_LOG_INFO, 0,
+ GD_MSG_DEREGISTER_SUCCESS,
+ "De-registered NLM v4 successfully");
else
gf_msg ("glusterd", GF_LOG_ERROR, 0,
GD_MSG_PMAP_UNSET_FAIL,
"De-registration of NLM v4 failed");
if (pmap_unset (NLM_PROGRAM, NLMV1_VERSION))
- gf_log ("", GF_LOG_INFO, "De-registered NLM v1 successfully");
+ gf_msg ("glusterd", GF_LOG_INFO, 0,
+ GD_MSG_DEREGISTER_SUCCESS,
+ "De-registered NLM v1 successfully");
else
gf_msg ("glusterd", GF_LOG_ERROR, 0,
GD_MSG_PMAP_UNSET_FAIL,
"De-registration of NLM v1 failed");
if (pmap_unset (ACL_PROGRAM, ACLV3_VERSION))
- gf_log ("", GF_LOG_INFO, "De-registered ACL v3 successfully");
+ gf_msg ("glusterd", GF_LOG_INFO, 0,
+ GD_MSG_DEREGISTER_SUCCESS,
+ "De-registered ACL v3 successfully");
else
gf_msg ("glusterd", GF_LOG_ERROR, 0,
GD_MSG_PMAP_UNSET_FAIL,
@@ -4364,7 +4382,7 @@ glusterd_volume_count_get (void)
}
- gf_msg_debug ("", 0, "Returning %d", ret);
+ gf_msg_debug ("glusterd", 0, "Returning %d", ret);
return ret;
}
@@ -4615,7 +4633,8 @@ _local_gsyncd_start (dict_t *this, char *key, data_t *value, void *data)
* not started, do not restart the geo-rep session */
if ((!strcmp (buf, "Created")) ||
(!strcmp (buf, "Stopped"))) {
- gf_log (this1->name, GF_LOG_INFO,
+ gf_msg (this1->name, GF_LOG_INFO, 0,
+ GD_MSG_GEO_REP_START_FAILED,
"Geo-Rep Session was not started between "
"%s and %s::%s. Not Restarting", volinfo->volname,
slave_url, slave_vol);
@@ -4623,7 +4642,8 @@ _local_gsyncd_start (dict_t *this, char *key, data_t *value, void *data)
} else if (strstr(buf, "Paused")) {
is_paused = _gf_true;
} else if ((!strcmp (buf, "Config Corrupted"))) {
- gf_log (this1->name, GF_LOG_INFO,
+ gf_msg (this1->name, GF_LOG_INFO, 0,
+ GD_MSG_RECOVERING_CORRUPT_CONF,
"Recovering from a corrupted config. "
"Not Restarting. Use start (force) to "
"start the session between %s and %s::%s.",
@@ -5385,7 +5405,7 @@ glusterd_all_volume_cond_check (glusterd_condition_func func, int status,
}
ret = 0;
out:
- gf_msg_debug ("", 0, "returning %d", ret);
+ gf_msg_debug ("glusterd", 0, "returning %d", ret);
return ret;
}
@@ -5549,7 +5569,7 @@ glusterd_rb_check_bricks (glusterd_volinfo_t *volinfo,
if (strcmp (rb->src_brick->hostname, src->hostname) ||
strcmp (rb->src_brick->path, src->path)) {
- gf_msg("", GF_LOG_ERROR, 0,
+ gf_msg("glusterd", GF_LOG_ERROR, 0,
GD_MSG_RB_SRC_BRICKS_MISMATCH,
"Replace brick src bricks differ");
return -1;
@@ -5776,7 +5796,7 @@ glusterd_sm_tr_log_transition_add_to_dict (dict_t *dict,
goto out;
out:
- gf_msg_debug ("", 0, "returning %d", ret);
+ gf_msg_debug ("glusterd", 0, "returning %d", ret);
return ret;
}
@@ -5817,7 +5837,7 @@ glusterd_sm_tr_log_add_to_dict (dict_t *dict,
ret = dict_set_int32 (dict, key, log->count);
out:
- gf_msg_debug ("", 0, "returning %d", ret);
+ gf_msg_debug ("glusterd", 0, "returning %d", ret);
return ret;
}
@@ -5848,7 +5868,7 @@ glusterd_sm_tr_log_init (glusterd_sm_tr_log_t *log,
ret = 0;
out:
- gf_msg_debug ("", 0, "returning %d", ret);
+ gf_msg_debug ("glusterd", 0, "returning %d", ret);
return ret;
}
@@ -6009,7 +6029,7 @@ glusterd_get_local_brickpaths (glusterd_volinfo_t *volinfo, char **pathlist)
path_tokens = GF_CALLOC (sizeof(char*), volinfo->brick_count,
gf_gld_mt_charptr);
if (!path_tokens) {
- gf_msg_debug ("", 0, "Could not allocate memory.");
+ gf_msg_debug ("glusterd", 0, "Could not allocate memory.");
ret = -1;
goto out;
}
@@ -6026,7 +6046,7 @@ glusterd_get_local_brickpaths (glusterd_volinfo_t *volinfo, char **pathlist)
path[sizeof(path)-1] = '\0';
path_tokens[count] = gf_strdup (path);
if (!path_tokens[count]) {
- gf_msg_debug ("", 0,
+ gf_msg_debug ("glusterd", 0,
"Could not allocate memory.");
ret = -1;
goto out;
@@ -6038,7 +6058,7 @@ glusterd_get_local_brickpaths (glusterd_volinfo_t *volinfo, char **pathlist)
tmp_path_list = GF_CALLOC (sizeof(char), total_len + 1,
gf_gld_mt_char);
if (!tmp_path_list) {
- gf_msg_debug ("", 0, "Could not allocate memory.");
+ gf_msg_debug ("glusterd", 0, "Could not allocate memory.");
ret = -1;
goto out;
}
@@ -6061,12 +6081,12 @@ out:
path_tokens = NULL;
if (ret == 0) {
- gf_msg_debug ("", 0, "No Local Bricks Present.");
+ gf_msg_debug ("glusterd", 0, "No Local Bricks Present.");
GF_FREE (tmp_path_list);
tmp_path_list = NULL;
}
- gf_msg_debug ("", 0, "Returning %d", ret);
+ gf_msg_debug ("glusterd", 0, "Returning %d", ret);
return ret;
}
@@ -6094,7 +6114,7 @@ glusterd_start_gsync (glusterd_volinfo_t *master_vol, char *slave,
if (!path_list) {
ret = 0;
- gf_msg_debug ("", 0, "No Bricks in this node."
+ gf_msg_debug ("glusterd", 0, "No Bricks in this node."
" Not starting gsyncd.");
goto out;
}
@@ -6157,7 +6177,7 @@ out:
"the " GEOREP " session");
}
- gf_msg_debug ("", 0, "Returning %d", ret);
+ gf_msg_debug ("glusterd", 0, "Returning %d", ret);
return ret;
}
@@ -6311,7 +6331,9 @@ glusterd_set_dump_options (char *dumpoptions_path, char *options,
goto out;
}
dup_options = gf_strdup (options);
- gf_log ("", GF_LOG_INFO, "Received following statedump options: %s",
+ gf_msg ("glusterd", GF_LOG_INFO, 0,
+ GD_MSG_STATEDUMP_OPTS_RCVD,
+ "Received following statedump options: %s",
dup_options);
option = strtok_r (dup_options, " ", &tmpptr);
while (option) {
@@ -6402,7 +6424,9 @@ glusterd_brick_statedump (glusterd_volinfo_t *volinfo,
goto out;
}
- gf_log ("", GF_LOG_INFO, "Performing statedump on brick with pid %d",
+ gf_msg ("glusterd", GF_LOG_INFO, 0,
+ GD_MSG_STATEDUMP_INFO,
+ "Performing statedump on brick with pid %d",
pid);
kill (pid, SIGUSR1);
@@ -6480,7 +6504,9 @@ glusterd_nfs_statedump (char *options, int option_cnt, char **op_errstr)
goto out;
}
- gf_log ("", GF_LOG_INFO, "Performing statedump on nfs server with "
+ gf_msg ("glusterd", GF_LOG_INFO, 0,
+ GD_MSG_STATEDUMP_INFO,
+ "Performing statedump on nfs server with "
"pid %d", pid);
kill (pid, SIGUSR1);
@@ -6559,7 +6585,9 @@ glusterd_quotad_statedump (char *options, int option_cnt, char **op_errstr)
goto out;
}
- gf_log (this->name, GF_LOG_INFO, "Performing statedump on quotad with "
+ gf_msg (this->name, GF_LOG_INFO, 0,
+ GD_MSG_STATEDUMP_INFO,
+ "Performing statedump on quotad with "
"pid %d", pid);
kill (pid, SIGUSR1);
@@ -6625,7 +6653,8 @@ glusterd_friend_remove_cleanup_vols (uuid_t uuid)
cds_list_for_each_entry_safe (volinfo, tmp_volinfo, &priv->volumes,
vol_list) {
if (glusterd_friend_contains_vol_bricks (volinfo, uuid) == 2) {
- gf_log (THIS->name, GF_LOG_INFO,
+ gf_msg (THIS->name, GF_LOG_INFO, 0,
+ GD_MSG_STALE_VOL_DELETE_INFO,
"Deleting stale volume %s", volinfo->volname);
ret = glusterd_delete_volume (volinfo);
if (ret) {
@@ -6913,12 +6942,12 @@ glusterd_defrag_volume_status_update (glusterd_volinfo_t *volinfo,
ret = dict_get_uint64 (rsp_dict, "promoted", &promoted);
if (ret)
- gf_log (this->name, GF_LOG_TRACE,
+ gf_msg_trace (this->name, 0,
"failed to get promoted count");
ret = dict_get_uint64 (rsp_dict, "demoted", &demoted);
if (ret)
- gf_log (this->name, GF_LOG_TRACE,
+ gf_msg_trace (this->name, 0,
"failed to get demoted count");
ret = dict_get_double (rsp_dict, "run-time", &run_time);
@@ -7217,7 +7246,7 @@ glusterd_append_status_dicts (dict_t *dst, dict_t *src)
ret = dict_get_int32 (src, "gsync-count", &src_count);
if (ret || !src_count) {
- gf_msg_debug ("", 0, "Source brick empty");
+ gf_msg_debug ("glusterd", 0, "Source brick empty");
ret = 0;
goto out;
}
@@ -7251,7 +7280,7 @@ glusterd_append_status_dicts (dict_t *dst, dict_t *src)
ret = dict_set_int32 (dst, "gsync-count", dst_count+src_count);
out:
- gf_msg_debug ("", 0, "Returning %d", ret);
+ gf_msg_debug ("glusterd", 0, "Returning %d", ret);
return ret;
}
@@ -7355,7 +7384,7 @@ glusterd_gsync_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict, char *op_errstr)
ret = 0;
out:
- gf_msg_debug ("", 0, "Returning %d ", ret);
+ gf_msg_debug ("glusterd", 0, "Returning %d ", ret);
return ret;
}
@@ -7387,13 +7416,13 @@ glusterd_rb_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict)
if (rsp_dict) {
ret = dict_get_int32 (rsp_dict, "src-brick-port", &src_port);
if (ret == 0) {
- gf_msg_debug ("", 0,
+ gf_msg_debug ("glusterd", 0,
"src-brick-port=%d found", src_port);
}
ret = dict_get_int32 (rsp_dict, "dst-brick-port", &dst_port);
if (ret == 0) {
- gf_msg_debug ("", 0,
+ gf_msg_debug ("glusterd", 0,
"dst-brick-port=%d found", dst_port);
}
@@ -7411,7 +7440,7 @@ glusterd_rb_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict)
ret = dict_set_int32 (ctx, "src-brick-port",
src_port);
if (ret) {
- gf_msg_debug ("", 0,
+ gf_msg_debug ("glusterd", 0,
"Could not set src-brick");
goto out;
}
@@ -7421,7 +7450,7 @@ glusterd_rb_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict)
ret = dict_set_int32 (ctx, "dst-brick-port",
dst_port);
if (ret) {
- gf_msg_debug ("", 0,
+ gf_msg_debug ("glusterd", 0,
"Could not set dst-brick");
goto out;
}
@@ -7865,28 +7894,32 @@ glusterd_volume_status_copy_to_op_ctx_dict (dict_t *aggr, dict_t *rsp_dict)
ret = dict_get_int32 (rsp_dict, "hot_brick_count", &hot_brick_count);
if (ret) {
- gf_log (THIS->name, GF_LOG_ERROR,
+ gf_msg (THIS->name, GF_LOG_ERROR, errno,
+ GD_MSG_DICT_GET_FAILED,
"Failed to get hot brick count from rsp_dict");
goto out;
}
ret = dict_set_int32 (ctx_dict, "hot_brick_count", hot_brick_count);
if (ret) {
- gf_log (THIS->name, GF_LOG_ERROR,
+ gf_msg (THIS->name, GF_LOG_ERROR, errno,
+ GD_MSG_DICT_SET_FAILED,
"Failed to update hot_brick_count");
goto out;
}
ret = dict_get_int32 (rsp_dict, "type", &type);
if (ret) {
- gf_log (THIS->name, GF_LOG_ERROR,
+ gf_msg (THIS->name, GF_LOG_ERROR, errno,
+ GD_MSG_DICT_GET_FAILED,
"Failed to get type from rsp_dict");
goto out;
}
ret = dict_set_int32 (ctx_dict, "type", type);
if (ret) {
- gf_log (THIS->name, GF_LOG_ERROR,
+ gf_msg (THIS->name, GF_LOG_ERROR, errno,
+ GD_MSG_DICT_SET_FAILED,
"Failed to update type");
goto out;
}
@@ -8098,7 +8131,7 @@ glusterd_volume_rebalance_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict)
snprintf (key, 256, "demoted-%d", current_index);
ret = dict_set_uint64 (ctx_dict, key, value);
if (ret) {
- gf_log (THIS->name, GF_LOG_DEBUG,
+ gf_msg_debug (THIS->name, 0,
"failed to set demoted count");
}
}
@@ -8110,7 +8143,7 @@ glusterd_volume_rebalance_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict)
snprintf (key, 256, "promoted-%d", current_index);
ret = dict_set_uint64 (ctx_dict, key, value);
if (ret) {
- gf_log (THIS->name, GF_LOG_DEBUG,
+ gf_msg_debug (THIS->name, 0,
"failed to set promoted count");
}
}
@@ -8144,7 +8177,7 @@ glusterd_sys_exec_output_rsp_dict (dict_t *dst, dict_t *src)
ret = dict_get_int32 (src, "output_count", &src_output_count);
if (ret) {
- gf_msg_debug ("", 0, "No output from source");
+ gf_msg_debug ("glusterd", 0, "No output from source");
ret = 0;
goto out;
}
@@ -8178,7 +8211,7 @@ glusterd_sys_exec_output_rsp_dict (dict_t *dst, dict_t *src)
ret = dict_set_int32 (dst, "output_count",
dst_output_count+src_output_count);
out:
- gf_msg_debug ("", 0, "Returning %d", ret);
+ gf_msg_debug ("glusterd", 0, "Returning %d", ret);
return ret;
}
@@ -8759,14 +8792,16 @@ glusterd_defrag_volume_node_rsp (dict_t *req_dict, dict_t *rsp_dict,
snprintf (key, 256, "promoted-%d", i);
ret = dict_set_uint64 (op_ctx, key, volinfo->tier_info.promoted);
if (ret)
- gf_log (THIS->name, GF_LOG_ERROR,
+ gf_msg (THIS->name, GF_LOG_ERROR, errno,
+ GD_MSG_DICT_SET_FAILED,
"failed to set lookedup file count");
memset (key, 0 , 256);
snprintf (key, 256, "demoted-%d", i);
ret = dict_set_uint64 (op_ctx, key, volinfo->tier_info.demoted);
if (ret)
- gf_log (THIS->name, GF_LOG_ERROR,
+ gf_msg (THIS->name, GF_LOG_ERROR, errno,
+ GD_MSG_DICT_SET_FAILED,
"failed to set lookedup file count");
out:
@@ -8805,7 +8840,7 @@ glusterd_handle_node_rsp (dict_t *req_dict, void *pending_entry,
break;
}
- gf_msg_debug ("", 0, "Returning %d", ret);
+ gf_msg_debug ("glusterd", 0, "Returning %d", ret);
return ret;
}
@@ -8899,7 +8934,8 @@ glusterd_generate_and_set_task_id (dict_t *dict, char *key)
key);
goto out;
}
- gf_log (this->name, GF_LOG_INFO, "Generated task-id %s for key %s",
+ gf_msg (this->name, GF_LOG_INFO, 0,
+ GD_MSG_TASK_ID_INFO, "Generated task-id %s for key %s",
uuid_str, key);
out:
@@ -9486,7 +9522,8 @@ glusterd_enable_default_options (glusterd_volinfo_t *volinfo, char *option)
ret = dict_set_dynstr_with_alloc (volinfo->dict,
"performance.readdir-ahead", "on");
if (ret) {
- gf_log (this->name, GF_LOG_ERROR,
+ gf_msg (this->name, GF_LOG_ERROR, errno,
+ GD_MSG_DICT_SET_FAILED,
"Failed to set option "
"'performance.readdir-ahead' on volume "
"%s", volinfo->volname);
@@ -9959,7 +9996,7 @@ glusterd_disallow_op_for_tier (glusterd_volinfo_t *volinfo, glusterd_op_t op,
case GD_OP_ADD_BRICK:
case GD_OP_REPLACE_BRICK:
ret = -1;
- gf_log (this->name, GF_LOG_DEBUG, "Operation not "
+ gf_msg_debug (this->name, 0, "Operation not "
"permitted on tiered volume %s",
volinfo->volname);
break;
@@ -9973,7 +10010,7 @@ glusterd_disallow_op_for_tier (glusterd_volinfo_t *volinfo, glusterd_op_t op,
ret = 0;
break;
default:
- gf_log (this->name, GF_LOG_DEBUG,
+ gf_msg_debug (this->name, 0,
"Rebalance Operation not permitted"
" on tiered volume %s",
volinfo->volname);
@@ -9990,7 +10027,7 @@ glusterd_disallow_op_for_tier (glusterd_volinfo_t *volinfo, glusterd_op_t op,
ret = 0;
break;
default:
- gf_log (this->name, GF_LOG_DEBUG,
+ gf_msg_debug (this->name, 0,
"Remove brick operation not "
"permitted on tiered volume %s",
volinfo->volname);