summaryrefslogtreecommitdiffstats
path: root/xlators/performance
diff options
context:
space:
mode:
authorPoornima G <pgurusid@redhat.com>2016-08-23 18:15:22 +0530
committerRaghavendra G <rgowdapp@redhat.com>2016-08-30 23:08:54 -0700
commit065a27948c4e0651f5bdac1703939adf34e5380e (patch)
tree8e563eb9e75337f9e36852e7ea2a95be27e359aa /xlators/performance
parent8f053f9d7270f1c6d50c0b3ab5d020503ceeb31a (diff)
dht, md-cache, upcall: Add invalidation of IATT when the layout changes
Issue: dht_layout is built as a part of lookup only. The layout can be modified by rebalance process. Since every IO fop is preceded by a lookup, there are very less issues of stale layout. But with enhancements of aggressive caching of stats in md-cache, the lookup will reduce and expose the stale layout issue often. Solution: Since stale layout is already an issue on dht, there is already a plan to fix this at the dht layer, but this fix is not currently planned for any release. Until this fix comes out, we can have a workaround where, the upcall will send a notification to md-cache when a layout xattr is changed. As a part of layout change notification the existing cache is invalidated and the next lookup will fetch the latest layout. This is not a foolproof solution as the window between the layout change and the next lookup(after invalidation of stat), where there will be stale layout. But until the final fix comes in, this reduces the stale layout window. Change-Id: Iacf871a38b35880c1fc0bc68fe7ce291265e71d4 BUG: 1369638 Signed-off-by: Poornima G <pgurusid@redhat.com> Reviewed-on: http://review.gluster.org/15300 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: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/performance')
-rw-r--r--xlators/performance/md-cache/src/md-cache.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/xlators/performance/md-cache/src/md-cache.c b/xlators/performance/md-cache/src/md-cache.c
index e0e7ee68e3b..586a203398b 100644
--- a/xlators/performance/md-cache/src/md-cache.c
+++ b/xlators/performance/md-cache/src/md-cache.c
@@ -792,10 +792,9 @@ out:
}
-int
+void
mdc_inode_iatt_invalidate (xlator_t *this, inode_t *inode)
{
- int ret = -1;
struct md_cache *mdc = NULL;
if (mdc_inode_ctx_get (this, inode, &mdc) != 0)
@@ -808,7 +807,7 @@ mdc_inode_iatt_invalidate (xlator_t *this, inode_t *inode)
UNLOCK (&mdc->lock);
out:
- return ret;
+ return;
}
@@ -2523,8 +2522,11 @@ mdc_invalidate (xlator_t *this, void *data)
}
if (up_ci->flags & IATT_UPDATE_FLAGS) {
- ret = mdc_inode_iatt_set_validate (this, inode, NULL,
- &up_ci->stat);
+ if (up_ci->dict && dict_get (up_ci->dict, MDC_INVALIDATE_IATT))
+ mdc_inode_iatt_invalidate (this, inode);
+ else
+ ret = mdc_inode_iatt_set_validate (this, inode, NULL,
+ &up_ci->stat);
/* one of the scenarios where ret < 0 is when this invalidate
* is older than the current stat, in that case do not
* update the xattrs as well