summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-self-heal-entry.c
diff options
context:
space:
mode:
authorRavishankar N <ravishankar@redhat.com>2016-09-01 13:01:22 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-09-06 23:05:37 -0700
commit86e312d872a957afff1e508f13f62c4102dba22d (patch)
tree3339b2180693ab20e8971538632331a59d23a9f3 /xlators/cluster/afr/src/afr-self-heal-entry.c
parentf20e41aec392a45f860fa7e80ad5ee9d5607a45c (diff)
afr: add replication events
Added the following events for the eventing framework: "EVENT_AFR_QUORUM_MET", --> Sent when quorum is met. "EVENT_AFR_QUORUM_FAIL" -->Sent when quorum is lost. "EVENT_AFR_SUBVOL_UP" -->Sent when afr witnesses the first up subvolume. "EVENT_AFR_SUBVOLS_DOWN"-->Sent when all children of an afr subvol are down. "EVENT_AFR_SPLIT_BRAIN" -->Sent when self-heal detects split-brain in heal path (not read/write path). Change-Id: I937c61ca1ce78b5922ade73c7bfa3051df59c513 BUG: 1371485 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/15349 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-entry.c')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-entry.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-entry.c b/xlators/cluster/afr/src/afr-self-heal-entry.c
index bc0cf25281b..254ff6d742c 100644
--- a/xlators/cluster/afr/src/afr-self-heal-entry.c
+++ b/xlators/cluster/afr/src/afr-self-heal-entry.c
@@ -15,6 +15,7 @@
#include "afr-transaction.h"
#include "afr-messages.h"
#include "syncop-utils.h"
+#include "events.h"
/* Max file name length is 255 this filename is of length 256. No file with
* this name can ever come, entry-lock with this name is going to prevent
@@ -240,13 +241,22 @@ afr_selfheal_detect_gfid_and_type_mismatch (xlator_t *this,
replies[i].poststat.ia_gfid)) {
gf_msg (this->name, GF_LOG_ERROR, 0,
AFR_MSG_SPLIT_BRAIN, "Gfid mismatch "
- "detected for <%s/%s>, %s on %s and %s on %s. "
+ "detected for <gfid:%s>/%s>, %s on %s and %s on %s. "
"Skipping conservative merge on the file.",
uuid_utoa (pargfid), bname,
uuid_utoa_r (replies[i].poststat.ia_gfid, g1),
priv->children[i]->name,
uuid_utoa_r (replies[src_idx].poststat.ia_gfid,
g2), priv->children[src_idx]->name);
+ gf_event (EVENT_AFR_SPLIT_BRAIN,
+ "subvol=%s;msg=gfid mismatch. Skipping "
+ "conservative merge.;file=<gfid:%s>/%s>;count=2;"
+ "child-%d=%s;gfid-%d=%s;child-%d=%s;gfid-%d=%s",
+ this->name, uuid_utoa (pargfid), bname, i,
+ priv->children[i]->name, i,
+ uuid_utoa_r (replies[i].poststat.ia_gfid, g1),
+ src_idx, priv->children[src_idx]->name, src_idx,
+ uuid_utoa_r (replies[src_idx].poststat.ia_gfid, g2));
return -1;
}
@@ -254,13 +264,22 @@ afr_selfheal_detect_gfid_and_type_mismatch (xlator_t *this,
(replies[i].poststat.ia_type)) {
gf_msg (this->name, GF_LOG_ERROR, 0,
AFR_MSG_SPLIT_BRAIN, "Type mismatch "
- "detected for <%s/%s>, %d on %s and %d on %s. "
+ "detected for <gfid:%s>/%s>, %s on %s and %s on %s. "
"Skipping conservative merge on the file.",
uuid_utoa (pargfid), bname,
- replies[i].poststat.ia_type,
+ gf_inode_type_to_str (replies[i].poststat.ia_type),
priv->children[i]->name,
- replies[src_idx].poststat.ia_type,
+ gf_inode_type_to_str (replies[src_idx].poststat.ia_type),
priv->children[src_idx]->name);
+ gf_event (EVENT_AFR_SPLIT_BRAIN,
+ "subvol=%s;msg=file type mismatch. Skipping "
+ "conservative merge;file=<gfid:%s>/%s>;count=2;"
+ "child-%d=%s;type-%d=%s;child-%d=%s;type-%d=%s",
+ this->name, uuid_utoa (pargfid), bname, i,
+ priv->children[i]->name, i,
+ gf_inode_type_to_str(replies[i].poststat.ia_type),
+ src_idx, priv->children[src_idx]->name, src_idx,
+ gf_inode_type_to_str(replies[src_idx].poststat.ia_type));
return -1;
}
}