diff options
author | Pranith Kumar K <pranithk@gluster.com> | 2011-06-09 04:00:40 +0000 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-06-09 07:41:28 -0700 |
commit | 272d43e6721d559594375e385b42e88122b42bd9 (patch) | |
tree | d9d5eba425c9fd11ba0b264b5de917e86cca3127 /xlators/cluster/afr/src/afr-self-heal-common.c | |
parent | 1a06583bc6ad298c97bdbafbcc0246bddc0ce301 (diff) |
cluster/afr: Log errors in afr self-heal with GF_LOG_ERROR
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Signed-off-by: Anand Avati <avati@gluster.com>
BUG: 2986 (Failed operations should should be logged `E' or `W')
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2986
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-common.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-common.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c index 7ef4c508d..5a5326ee3 100644 --- a/xlators/cluster/afr/src/afr-self-heal-common.c +++ b/xlators/cluster/afr/src/afr-self-heal-common.c @@ -778,9 +778,10 @@ afr_sh_missing_entries_done (call_frame_t *frame, xlator_t *this) } if (local->govinda_gOvinda) { - gf_log (this->name, GF_LOG_TRACE, - "aborting selfheal of %s", + gf_log (this->name, GF_LOG_INFO, + "split brain found, aborting selfheal of %s", local->loc.path); + sh->op_failed = 1; sh->completion_cbk (frame, this); } else { gf_log (this->name, GF_LOG_TRACE, @@ -1525,11 +1526,16 @@ afr_self_heal_completion_cbk (call_frame_t *bgsh_frame, xlator_t *this) _gf_false); } - 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); + afr_self_heal_type_str_get (sh, sh_type_str, + sizeof(sh_type_str)); + if (sh->op_failed) { + gf_log (this->name, GF_LOG_ERROR, "background %s self-heal " + "failed on %s", sh_type_str, local->loc.path); + } else { + gf_log (this->name, GF_LOG_INFO, "background %s self-heal " + "completed on %s", sh_type_str, local->loc.path); + } + FRAME_SU_UNDO (bgsh_frame, afr_local_t); if (!sh->unwound) { @@ -1649,7 +1655,7 @@ void afr_self_heal_type_str_get (afr_self_heal_t *self_heal_p, char *str, size_t size) { - GF_ASSERT (str && (size > 0)); + GF_ASSERT (str && (size > strlen (" meta-data data entry"))); if (self_heal_p->need_metadata_self_heal) { snprintf(str, size, " meta-data"); |