diff options
Diffstat (limited to 'xlators/cluster')
-rw-r--r-- | xlators/cluster/afr/src/afr-common.c | 38 | ||||
-rw-r--r-- | xlators/cluster/dht/src/dht-common.c | 7 | ||||
-rw-r--r-- | xlators/cluster/ec/src/ec.c | 6 |
3 files changed, 24 insertions, 27 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index d503609e8a2..dd6c1dfac5c 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -4374,27 +4374,21 @@ __afr_transform_event_from_state (afr_private_t *priv) return GF_EVENT_MAXVAL; up_children = __afr_get_up_children_count (priv); - if (up_children) { - /* We received at least one child up and there are pending - * notifications from some children. Treat these children as - * having sent a GF_EVENT_CHILD_DOWN. i.e. set the event as - * GF_EVENT_CHILD_MODIFIED, as done in afr_notify() */ - for (i = 0; i < priv->child_count; i++) { - if (priv->last_event[i]) - continue; - priv->last_event[i] = GF_EVENT_CHILD_MODIFIED; - priv->child_up[i] = 0; - } + /* Treat the children with pending notification, as having sent a + * GF_EVENT_CHILD_DOWN. i.e. set the event as GF_EVENT_SOME_DESCENDENT_DOWN, + * as done in afr_notify() */ + for (i = 0; i < priv->child_count; i++) { + if (priv->last_event[i]) + continue; + priv->last_event[i] = GF_EVENT_SOME_DESCENDENT_DOWN; + priv->child_up[i] = 0; + } + + if (up_children) + /* We received at least one child up */ return GF_EVENT_CHILD_UP; - } else { - for (i = 0; i < priv->child_count; i++) { - if (priv->last_event[i]) - continue; - priv->last_event[i] = GF_EVENT_SOME_CHILD_DOWN; - priv->child_up[i] = 0; - } + else return GF_EVENT_CHILD_DOWN; - } return GF_EVENT_MAXVAL; } @@ -4563,7 +4557,7 @@ afr_notify (xlator_t *this, int32_t event, "subvol=%s", this->name); } else { - event = GF_EVENT_CHILD_MODIFIED; + event = GF_EVENT_SOME_DESCENDENT_UP; } priv->last_event[idx] = event; @@ -4587,7 +4581,7 @@ afr_notify (xlator_t *this, int32_t event, gf_event (EVENT_AFR_SUBVOLS_DOWN, "subvol=%s", this->name); } else { - event = GF_EVENT_SOME_CHILD_DOWN; + event = GF_EVENT_SOME_DESCENDENT_DOWN; } priv->last_event[idx] = event; @@ -4599,7 +4593,7 @@ afr_notify (xlator_t *this, int32_t event, break; - case GF_EVENT_SOME_CHILD_DOWN: + case GF_EVENT_SOME_DESCENDENT_DOWN: priv->last_event[idx] = event; break; case GF_EVENT_UPCALL: diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index ab3b893d151..a85627a683e 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -8915,15 +8915,14 @@ dht_notify (xlator_t *this, int event, void *data, ...) break; - case GF_EVENT_CHILD_MODIFIED: + case GF_EVENT_SOME_DESCENDENT_UP: subvol = data; - conf->gen++; propagate = 1; break; - case GF_EVENT_SOME_CHILD_DOWN: + case GF_EVENT_SOME_DESCENDENT_DOWN: subvol = data; propagate = 1; @@ -8968,7 +8967,7 @@ dht_notify (xlator_t *this, int event, void *data, ...) for (i = 0; i < conf->subvolume_cnt; i++) if (conf->last_event[i] != event) - event = GF_EVENT_CHILD_MODIFIED; + event = GF_EVENT_SOME_DESCENDENT_DOWN; break; case GF_EVENT_CHILD_CONNECTING: diff --git a/xlators/cluster/ec/src/ec.c b/xlators/cluster/ec/src/ec.c index e10de4e38aa..97786657071 100644 --- a/xlators/cluster/ec/src/ec.c +++ b/xlators/cluster/ec/src/ec.c @@ -471,6 +471,7 @@ ec_notify (xlator_t *this, int32_t event, void *data, void *data2) dict_t *input = NULL; dict_t *output = NULL; gf_boolean_t propagate = _gf_true; + int32_t orig_event = event; gf_msg_trace (this->name, 0, "NOTIFY(%d): %p, %p", event, data, data2); @@ -529,7 +530,10 @@ ec_notify (xlator_t *this, int32_t event, void *data, void *data2) if (event != GF_EVENT_MAXVAL) { if (event == old_event) { - event = GF_EVENT_CHILD_MODIFIED; + if (orig_event == GF_EVENT_CHILD_UP) + event = GF_EVENT_SOME_DESCENDENT_UP; + else /* orig_event has to be GF_EVENT_CHILD_DOWN */ + event = GF_EVENT_SOME_DESCENDENT_DOWN; } } else { propagate = _gf_false; |