diff options
Diffstat (limited to 'xlators/cluster/afr/src')
-rw-r--r-- | xlators/cluster/afr/src/afr-common.c | 41 | ||||
-rw-r--r-- | xlators/cluster/afr/src/afr.h | 1 |
2 files changed, 40 insertions, 2 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index c8c6642d1e7..e77f0dd6891 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -32,7 +32,7 @@ #include "statedump.h" #include "inode.h" #include "events.h" - +#include "upcall-utils.h" #include "fd.h" #include "afr-inode-read.h" @@ -4231,6 +4231,14 @@ afr_ipc (call_frame_t *frame, xlator_t *this, int32_t op, dict_t *xdata) goto err; call_cnt = local->call_count; + + if (xdata) { + for (i = 0; i < priv->child_count; i++) { + if (dict_set_int8 (xdata, priv->pending_key[i], 0) < 0) + goto err; + } + } + for (i = 0; i < priv->child_count; i++) { if (!local->child_up[i]) continue; @@ -4468,6 +4476,10 @@ afr_notify (xlator_t *this, int32_t event, dict_t *output = NULL; gf_boolean_t had_quorum = _gf_false; gf_boolean_t has_quorum = _gf_false; + struct gf_upcall *up_data = NULL; + struct gf_upcall_cache_invalidation *up_ci = NULL; + inode_table_t *itable = NULL; + inode_t *inode = NULL; priv = this->private; @@ -4588,7 +4600,34 @@ afr_notify (xlator_t *this, int32_t event, case GF_EVENT_SOME_CHILD_DOWN: priv->last_event[idx] = event; break; + case GF_EVENT_UPCALL: + up_data = (struct gf_upcall *)data; + if (up_data->event_type != GF_UPCALL_CACHE_INVALIDATION) + break; + up_ci = (struct gf_upcall_cache_invalidation *)up_data->data; + + /* Since md-cache will be aggressively filtering + * lookups, the stale read issue will be more + * pronounced. Hence when a pending xattr is set notify + * all the md-cache clients to invalidate the existing + * stat cache and send the lookup next time */ + if (up_ci->dict) { + for (i = 0; i < priv->child_count; i++) { + if (dict_get (up_ci->dict, priv->pending_key[i])) { + ret = dict_set_int8 (up_ci->dict, + MDC_INVALIDATE_IATT , 0); + break; + } + } + } + itable = ((xlator_t *)this->graph->top)->itable; + /*Internal processes may not have itable for top xlator*/ + if (itable) + inode = inode_find (itable, up_data->gfid); + if (inode) + afr_inode_read_subvol_reset (inode, this); + break; default: propagate = 1; break; diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h index ff136c0b093..93f4ba3dddc 100644 --- a/xlators/cluster/afr/src/afr.h +++ b/xlators/cluster/afr/src/afr.h @@ -23,7 +23,6 @@ #include "afr-self-heald.h" #include "afr-messages.h" -#define AFR_XATTR_PREFIX "trusted.afr" #define AFR_PATHINFO_HEADER "REPLICATE:" #define AFR_SH_READDIR_SIZE_KEY "self-heal-readdir-size" #define AFR_SH_DATA_DOMAIN_FMT "%s:self-heal" |