diff options
author | Pranith Kumar K <pranithk@gluster.com> | 2011-06-06 03:22:01 +0000 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-06-08 03:03:13 -0700 |
commit | b96d9cbf7300e515a8de8d7d90c61110b5301f37 (patch) | |
tree | f204334045bf1ea20b63039644ee9f7ce2c63989 /xlators/cluster/afr/src/afr-self-heal-common.c | |
parent | 3589a379f0274c4c2abf683f6c5c69c7fa70b187 (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 | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c index 2e046614ddb..60492c3ae89 100644 --- a/xlators/cluster/afr/src/afr-self-heal-common.c +++ b/xlators/cluster/afr/src/afr-self-heal-common.c @@ -780,8 +780,9 @@ afr_sh_missing_entries_done (call_frame_t *frame, xlator_t *this) if (local->govinda_gOvinda) { gf_log (this->name, GF_LOG_INFO, - "split brain found: aborting selfheal of %s", + "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, @@ -1546,9 +1547,16 @@ afr_self_heal_completion_cbk (call_frame_t *bgsh_frame, xlator_t *this) afr_self_heal_type_str_get(sh, sh_type_str, sizeof(sh_type_str)); - gf_log (this->name, GF_LOG_DEBUG, - "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) { @@ -1666,7 +1674,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"); |