summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/tier.c
diff options
context:
space:
mode:
authorarao <arao@redhat.com>2015-06-12 16:35:53 +0530
committerRaghavendra G <rgowdapp@redhat.com>2015-07-27 00:21:48 -0700
commit73517fedf7840363b9f688183e604a617d934652 (patch)
treeaf6e03acd0d45a81b555cd8c0a123c3baa5fbd0e /xlators/cluster/dht/src/tier.c
parent5ebf298ec03bc929a4142e70ed105130cf9c58df (diff)
dht: Adding log messages to the new logging framework
Backported from: http://review.gluster.org/10021 > Change-Id: Ib3bb61c5223f409c23c68100f3fe884918d2dc3f > BUG: 1194640 > Reviewed-on: http://review.gluster.org/10021 > Reviewed-by: N Balachandran <nbalacha@redhat.com> > Reviewed-by: Joseph Fernandes <josferna@redhat.com> > Tested-by: Joseph Fernandes <josferna@redhat.com> > Reviewed-by: Dan Lambright <dlambrig@redhat.com> > Reviewed-by: Raghavendra G <rgowdapp@redhat.com> > Tested-by: Raghavendra G <rgowdapp@redhat.com> > Signed-off-by: arao <arao@redhat.com> BUG: 1217722 Change-Id: Ide79c6c1e6a466fb52f955c90a2b22711bec794a Signed-off-by: arao <arao@redhat.com> Signed-off-by: Anusha Rao <arao@redhat.com> Reviewed-on: http://review.gluster.org/11350 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/cluster/dht/src/tier.c')
-rw-r--r--xlators/cluster/dht/src/tier.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/xlators/cluster/dht/src/tier.c b/xlators/cluster/dht/src/tier.c
index c2a9d6b4ebd..97482fc3112 100644
--- a/xlators/cluster/dht/src/tier.c
+++ b/xlators/cluster/dht/src/tier.c
@@ -485,11 +485,11 @@ tier_process_brick_cbk (dict_t *brick_dict, char *key, data_t *value,
query_cbk_args->queryFILE = fopen(GET_QFILE_PATH
(gfdb_brick_dict_info->_gfdb_promote), "a+");
if (!query_cbk_args->queryFILE) {
- gf_msg (this->name, GF_LOG_ERROR, 0, DHT_MSG_LOG_TIER_ERROR,
- "Failed to open query file %s:%s",
- GET_QFILE_PATH
- (gfdb_brick_dict_info->_gfdb_promote),
- strerror(errno));
+ gf_msg (this->name, GF_LOG_ERROR, errno,
+ DHT_MSG_LOG_TIER_ERROR,
+ "Failed to open query file %s",
+ GET_QFILE_PATH
+ (gfdb_brick_dict_info->_gfdb_promote));
goto out;
}
if (!gfdb_brick_dict_info->_gfdb_promote) {
@@ -577,8 +577,9 @@ tier_build_migration_qfile (demotion_args_t *args,
ret = gettimeofday (&current_time, NULL);
if (ret == -1) {
- gf_log (args->this->name, GF_LOG_ERROR,
- "Failed to get current timen");
+ gf_msg (args->this->name, GF_LOG_ERROR, errno,
+ DHT_MSG_SYS_CALL_GET_TIME_FAILED,
+ "Failed to get current time\n");
goto out;
}
time_in_past.tv_sec = current_time.tv_sec - time_in_past.tv_sec;
@@ -589,8 +590,9 @@ tier_build_migration_qfile (demotion_args_t *args,
ret = dict_foreach (args->brick_list, tier_process_brick_cbk,
&gfdb_brick_dict_info);
if (ret) {
- gf_log (args->this->name, GF_LOG_ERROR,
- "Brick query failedn");
+ gf_msg (args->this->name, GF_LOG_ERROR, 0,
+ DHT_MSG_BRICK_QUERY_FAILED,
+ "Brick query failed\n");
goto out;
}
out:
@@ -607,7 +609,8 @@ tier_migrate_files_using_qfile (demotion_args_t *comp,
query_cbk_args->queryFILE = fopen (qfile, "r");
if (!query_cbk_args->queryFILE) {
- gf_log ("tier", GF_LOG_ERROR,
+ gf_msg ("tier", GF_LOG_ERROR, 0,
+ DHT_MSG_FOPEN_FAILED,
"Failed opening %s for migration", qfile);
goto out;
}
@@ -831,7 +834,8 @@ tier_start (xlator_t *this, gf_defrag_info_t *defrag)
* using a NTP server*/
ret = gettimeofday (&current_time, NULL);
if (ret == -1) {
- gf_log (this->name, GF_LOG_ERROR,
+ gf_msg (this->name, GF_LOG_ERROR, errno,
+ DHT_MSG_SYS_CALL_GET_TIME_FAILED,
"Failed to get current time");
goto out;
}