summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2010-07-27 03:13:55 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-07-27 06:48:47 -0700
commit232235a9ddeaf33159ee8af809efee440b06c6d1 (patch)
tree093c89fc1398656da2ab7cdae192669ccc624eea /xlators/cluster/afr/src
parent7c3ee2fd042c56ef6f53159f1ae9dd9a8f91c6f4 (diff)
cluster/afr: Logging improvement for self-heal
Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 1037 (selfheal information in normal logging mode) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1037
Diffstat (limited to 'xlators/cluster/afr/src')
-rw-r--r--xlators/cluster/afr/src/afr-dir-read.c6
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-algorithm.c21
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-common.c8
-rw-r--r--xlators/cluster/afr/src/afr.c16
4 files changed, 28 insertions, 23 deletions
diff --git a/xlators/cluster/afr/src/afr-dir-read.c b/xlators/cluster/afr/src/afr-dir-read.c
index d2b8e528797..281fc78d3cd 100644
--- a/xlators/cluster/afr/src/afr-dir-read.c
+++ b/xlators/cluster/afr/src/afr-dir-read.c
@@ -163,10 +163,8 @@ out:
sh_type_str,
sizeof(sh_type_str));
gf_log (this->name, GF_LOG_NORMAL,
- "%s self-heal triggered. "
- "path: %s, "
- "reason: checksums of "
- "directory differ,"
+ "%s self-heal triggered. path: %s, "
+ "reason: checksums of directory differ,"
" forced merge option set",
sh_type_str, local->loc.path);
diff --git a/xlators/cluster/afr/src/afr-self-heal-algorithm.c b/xlators/cluster/afr/src/afr-self-heal-algorithm.c
index daac0ce476c..51f5fd3df5b 100644
--- a/xlators/cluster/afr/src/afr-self-heal-algorithm.c
+++ b/xlators/cluster/afr/src/afr-self-heal-algorithm.c
@@ -947,17 +947,20 @@ sh_diff_loop_driver (call_frame_t *frame, xlator_t *this)
int recurse = 0;
off_t offset = 0;
+ char sh_type_str[256] = {0,};
priv = this->private;
local = frame->local;
sh = &local->self_heal;
sh_priv = sh->private;
+ afr_self_heal_type_str_get(sh, sh_type_str, sizeof(sh_type_str));
+
if (sh->op_failed) {
if (sh_priv->loops_running == 0) {
- gf_log (this->name, GF_LOG_TRACE,
- "diff self-heal aborting on %s",
- local->loc.path);
+ gf_log (this->name, GF_LOG_ERROR,
+ "diff %s self-heal aborting on %s",
+ sh_type_str, local->loc.path);
sh_diff_private_cleanup (frame, this);
local->self_heal.algo_abort_cbk (frame, this);
@@ -969,14 +972,14 @@ sh_diff_loop_driver (call_frame_t *frame, xlator_t *this)
if (sh_priv->offset >= sh->file_size) {
if (sh_priv->loops_running == 0) {
gf_log (this->name, GF_LOG_TRACE,
- "diff self-heal completed on %s",
- local->loc.path);
+ "diff %s self-heal completed on %s",
+ sh_type_str, local->loc.path);
- gf_log (this->name, GF_LOG_DEBUG,
- "diff self-heal on %s: %d blocks of %d were different (%.2f%%)",
- local->loc.path, sh_priv->diff_blocks,
- sh_priv->total_blocks,
+ gf_log (this->name, GF_LOG_NORMAL,
+ "diff %s self-heal on %s: %d blocks of %d were different (%.2f%%)",
+ sh_type_str, local->loc.path,
+ sh_priv->diff_blocks, sh_priv->total_blocks,
((sh_priv->diff_blocks * 1.0)/sh_priv->total_blocks) * 100);
sh_diff_private_cleanup (frame, this);
diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c
index d37c1b25dd8..e3e484aabbe 100644
--- a/xlators/cluster/afr/src/afr-self-heal-common.c
+++ b/xlators/cluster/afr/src/afr-self-heal-common.c
@@ -1501,6 +1501,7 @@ afr_self_heal_completion_cbk (call_frame_t *bgsh_frame, xlator_t *this)
afr_private_t * priv = NULL;
afr_local_t * local = NULL;
afr_self_heal_t * sh = NULL;
+ char sh_type_str[256] = {0,};
priv = this->private;
local = bgsh_frame->local;
@@ -1512,8 +1513,11 @@ afr_self_heal_completion_cbk (call_frame_t *bgsh_frame, xlator_t *this)
afr_set_split_brain (this, local->cont.lookup.inode, _gf_false);
}
- gf_log (this->name, GF_LOG_TRACE,
- "background self-heal completed");
+ afr_self_heal_type_str_get(sh, sh_type_str,
+ sizeof(sh_type_str));
+ gf_log (this->name, GF_LOG_NORMAL,
+ "background %s self-heal completed on %s", sh_type_str,
+ local->loc.path);
if (!sh->unwound) {
sh->unwind (sh->orig_frame, this);
diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c
index 56df1bd31c0..b795ea1d17f 100644
--- a/xlators/cluster/afr/src/afr.c
+++ b/xlators/cluster/afr/src/afr.c
@@ -557,14 +557,14 @@ afr_lookup_collect_xattr (afr_local_t *local, xlator_t *this,
static void
-afr_lookup_self_heal_check (afr_local_t *local, struct iatt *buf,
- struct iatt *lookup_buf)
+afr_lookup_self_heal_check (xlator_t *this, afr_local_t *local,
+ struct iatt *buf, struct iatt *lookup_buf)
{
if (FILETYPE_DIFFERS (buf, lookup_buf)) {
/* mismatching filetypes with same name
*/
- gf_log ("Replicate", GF_LOG_NORMAL,
+ gf_log (this->name, GF_LOG_NORMAL,
"filetype differs for %s ", local->loc.path);
local->govinda_gOvinda = 1;
@@ -572,7 +572,7 @@ afr_lookup_self_heal_check (afr_local_t *local, struct iatt *buf,
if (PERMISSION_DIFFERS (buf, lookup_buf)) {
/* mismatching permissions */
- gf_log ("Replicate", GF_LOG_NORMAL,
+ gf_log (this->name, GF_LOG_NORMAL,
"permissions differ for %s ", local->loc.path);
local->self_heal.need_metadata_self_heal = _gf_true;
}
@@ -580,13 +580,13 @@ afr_lookup_self_heal_check (afr_local_t *local, struct iatt *buf,
if (OWNERSHIP_DIFFERS (buf, lookup_buf)) {
/* mismatching permissions */
local->self_heal.need_metadata_self_heal = _gf_true;
- gf_log ("Replicate", GF_LOG_NORMAL,
+ gf_log (this->name, GF_LOG_NORMAL,
"ownership differs for %s ", local->loc.path);
}
if (SIZE_DIFFERS (buf, lookup_buf)
&& IA_ISREG (buf->ia_type)) {
- gf_log ("Replicate", GF_LOG_NORMAL,
+ gf_log (this->name, GF_LOG_NORMAL,
"size differs for %s ", local->loc.path);
local->self_heal.need_data_self_heal = _gf_true;
}
@@ -802,7 +802,7 @@ afr_fresh_lookup_cbk (call_frame_t *frame, void *cookie,
}
} else {
- afr_lookup_self_heal_check (local, buf, lookup_buf);
+ afr_lookup_self_heal_check (this, local, buf, lookup_buf);
if (child_index == local->read_child_index) {
/*
@@ -929,7 +929,7 @@ afr_revalidate_lookup_cbk (call_frame_t *frame, void *cookie,
}
} else {
- afr_lookup_self_heal_check (local, buf, lookup_buf);
+ afr_lookup_self_heal_check (this, local, buf, lookup_buf);
if (child_index == local->read_child_index) {