summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-self-heal-common.c
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2011-06-06 03:10:39 +0000
committerAnand Avati <avati@gluster.com>2011-06-08 03:03:02 -0700
commit99588612db403dffdb6380ceaaec1a8b10a3be5d (patch)
tree35342357d407491a5f0d733c18d5a1caf913ea1e /xlators/cluster/afr/src/afr-self-heal-common.c
parentc997393c8a546e28648d56d2e86651f4bb4b38d8 (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.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c
index b64c5fcf691..a0a2b5cf3d4 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,
@@ -1544,11 +1545,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_INFO,
- "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 +1672,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");