summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAshish Pandey <aspandey@redhat.com>2016-08-30 14:17:58 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-09-07 09:10:08 -0700
commite1584b1c1df656612f6233ac40ba55f29591b0c3 (patch)
tree1c0eb8a9101f510930e63f6bd47e0f42e72d105a
parent86e312d872a957afff1e508f13f62c4102dba22d (diff)
cluster/ec: Add events for EC translator
This patch will generates events in following cases which will be consumed by new event framework. Consider an EC volume with (K+M) configuration K = Data bricks M = Redundancy bricks 1- EVENT_EC_MIN_BRICKS_NOT_UP - When minimum "K" number of bricks, required for any ec fop, are not up. 2- EVENT_EC_MIN_BRICKS_UP When minimum "K" number of bricks, required for any ec fop, are up. Change-Id: I0414b8968c39740a171e5aa14b087afd524d574f BUG: 1371470 Signed-off-by: Ashish Pandey <aspandey@redhat.com> Reviewed-on: http://review.gluster.org/15348 Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
-rw-r--r--events/eventskeygen.py4
-rw-r--r--xlators/cluster/ec/src/ec.c5
2 files changed, 6 insertions, 3 deletions
diff --git a/events/eventskeygen.py b/events/eventskeygen.py
index ac5a0f78a3c..7f3f6572a04 100644
--- a/events/eventskeygen.py
+++ b/events/eventskeygen.py
@@ -124,8 +124,8 @@ keys = (
"EVENT_COMPARE_FRIEND_VOLUME_FAILED",
"EVENT_NFS_GANESHA_EXPORT_FAILED",
#ec events
- "EVENT_EC_DATA_BRICKS_NOT_UP",
- "EVENT_EC_DATA_BRICKS_UP",
+ "EVENT_EC_MIN_BRICKS_NOT_UP",
+ "EVENT_EC_MIN_BRICKS_UP",
#georep async events
"EVENT_GEOREP_FAULTY",
#quota async events
diff --git a/xlators/cluster/ec/src/ec.c b/xlators/cluster/ec/src/ec.c
index fd8ef24ab11..659e3fd8108 100644
--- a/xlators/cluster/ec/src/ec.c
+++ b/xlators/cluster/ec/src/ec.c
@@ -20,6 +20,7 @@
#include "ec.h"
#include "ec-messages.h"
#include "ec-heald.h"
+#include "events.h"
static char *ec_read_policies[EC_READ_POLICY_MAX + 1] = {
[EC_ROUND_ROBIN] = "round-robin",
@@ -317,6 +318,7 @@ ec_up (xlator_t *this, ec_t *ec)
ec->up = 1;
gf_msg (this->name, GF_LOG_INFO, 0,
EC_MSG_EC_UP, "Going UP");
+ gf_event (EVENT_EC_MIN_BRICKS_UP, "subvol=%s", this->name);
}
void
@@ -330,6 +332,7 @@ ec_down (xlator_t *this, ec_t *ec)
ec->up = 0;
gf_msg (this->name, GF_LOG_INFO, 0,
EC_MSG_EC_DOWN, "Going DOWN");
+ gf_event (EVENT_EC_MIN_BRICKS_NOT_UP, "subvol=%s", this->name);
}
void
@@ -437,7 +440,7 @@ void
ec_pending_fops_completed(ec_t *ec)
{
if (ec->shutdown) {
- default_notify(ec->xl, GF_EVENT_PARENT_DOWN, NULL);
+ default_notify (ec->xl, GF_EVENT_PARENT_DOWN, NULL);
}
}