From e1584b1c1df656612f6233ac40ba55f29591b0c3 Mon Sep 17 00:00:00 2001 From: Ashish Pandey Date: Tue, 30 Aug 2016 14:17:58 +0530 Subject: 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 Reviewed-on: http://review.gluster.org/15348 Tested-by: Pranith Kumar Karampuri NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Smoke: Gluster Build System Reviewed-by: Pranith Kumar Karampuri --- xlators/cluster/ec/src/ec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'xlators/cluster/ec/src/ec.c') 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); } } -- cgit