From f7ab6c45963fa0da68acedfb14281cd2456abc68 Mon Sep 17 00:00:00 2001 From: Poornima G Date: Fri, 28 Oct 2016 15:27:15 +0530 Subject: afr,dht,ec: Replace GF_EVENT_CHILD_MODIFIED with event SOME_DESCENDENT_DOWN/UP Currently these are few events related to child_up/down: GF_EVENT_CHILD_UP : Issued when any of the protocol client connects. GF_EVENT_CHILD_MODIFIED : Issued by afr/dht/ec GF_EVENT_CHILD_DOWN : Issued when any of the protocol client disconnects. These events get modified at the dht/afr/ec layers. Here is a brief on the same. DHT: - All the subvolumes reported once, and atleast one child came up, then GF_EVENT_CHILD_UP is issued - connect GF_EVENT_CHILD_UP is issued - disconnect GF_EVENT_CHILD_MODIFIED is issued - All the subvolumes disconnected, GF_EVENT_CHILD_DOWN is issued AFR: - First subvolume came up, then GF_EVENT_CHILD_UP is issued - Subsequent subvolumes coming up, results in GF_EVENT_CHILD_MODIFIED - Any of the subvolumes go down, then GF_EVENT_SOME_CHILD_DOWN is issued - Last up subvolume goes down, then GF_EVENT_CHILD_DOWN is issued Until the patch [1] introduced GF_EVENT_SOME_CHILD_UP, GF_EVENT_CHILD_MODIFIED was issued by afr/dht when any of the subvolumes go up or down. Now with md-cache changes, there is a necessity to differentiate between child up and down. Hence, introducing GF_EVENT_SOME_DESCENDENT_DOWN/UP and getting rid of GF_EVENT_CHILD_MODIFIED. [1] http://review.gluster.org/12573 Change-Id: I704140b6598f7ec705493251d2dbc4191c965a58 BUG: 1396038 Signed-off-by: Poornima G Reviewed-on: http://review.gluster.org/15764 CentOS-regression: Gluster Build System NetBSD-regression: NetBSD Build System Smoke: Gluster Build System Reviewed-by: N Balachandran Reviewed-by: Pranith Kumar Karampuri Reviewed-by: Rajesh Joseph --- xlators/performance/md-cache/src/md-cache.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'xlators/performance') diff --git a/xlators/performance/md-cache/src/md-cache.c b/xlators/performance/md-cache/src/md-cache.c index 42c86a2fb07..aa1c22ade51 100644 --- a/xlators/performance/md-cache/src/md-cache.c +++ b/xlators/performance/md-cache/src/md-cache.c @@ -2897,7 +2897,7 @@ notify (xlator_t *this, int event, void *data, ...) conf = this->private; switch (event) { case GF_EVENT_CHILD_DOWN: - case GF_EVENT_SOME_CHILD_DOWN: + case GF_EVENT_SOME_DESCENDENT_DOWN: time (&now); mdc_update_child_down_time (this, &now); break; @@ -2905,12 +2905,8 @@ notify (xlator_t *this, int event, void *data, ...) if (conf->mdc_invalidation) ret = mdc_invalidate (this, data); break; - case GF_EVENT_CHILD_MODIFIED: - time (&now); - mdc_update_child_down_time (this, &now); - ret = mdc_register_xattr_inval (this); - break; case GF_EVENT_CHILD_UP: + case GF_EVENT_SOME_DESCENDENT_UP: ret = mdc_register_xattr_inval (this); break; default: -- cgit