diff options
author | Poornima G <pgurusid@redhat.com> | 2015-12-11 05:12:07 -0500 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2016-07-20 05:12:05 -0700 |
commit | 1f97d7101b3313ce647638310e1028da8dac6785 (patch) | |
tree | 869593e615ad5c7eff936a3dac72eab7aecebf0a /xlators/performance/md-cache/src/md-cache-messages.h | |
parent | 1929141da34d36f537e9798e3618e0e3bdc61eb6 (diff) |
md-cache: Add cache invalidation support to invalidate the meta data cache
Problem:
md-cache currently updates its stat in cbks of selected fops.
The default cache time is 1 second, if this is increasd to reap the
benefits of caching, we may end up with stale cache for long time,
as there is no logic yet to notify md-cache of backend changes by
another client.
Solution:
Use the existing upcall mechanism to invalidate the cache.
For this feature to work, "features.cache-invalidation" volume
option should be enabled.
This patch as is doesn't improve any performance, the benifit of the
patch is that it provides coherency for stat cache, hence the cache
timeout can be quite longer which in turn can improve the performance.
Change-Id: I2dbb0afa7b5e4a5a248f910188e0918e02f18692
BUG: 1211863
Signed-off-by: Poornima G <pgurusid@redhat.com>
Reviewed-on: http://review.gluster.org/12951
Smoke: Gluster Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/performance/md-cache/src/md-cache-messages.h')
-rw-r--r-- | xlators/performance/md-cache/src/md-cache-messages.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/xlators/performance/md-cache/src/md-cache-messages.h b/xlators/performance/md-cache/src/md-cache-messages.h index 2fe8d457a9a..a4259bacf1b 100644 --- a/xlators/performance/md-cache/src/md-cache-messages.h +++ b/xlators/performance/md-cache/src/md-cache-messages.h @@ -40,7 +40,7 @@ */ #define GLFS_MD_CACHE_BASE GLFS_MSGID_COMP_MD_CACHE -#define GLFS_MD_CACHE_NUM_MESSAGES 1 +#define GLFS_MD_CACHE_NUM_MESSAGES 2 #define GLFS_MSGID_END (GLFS_MD_CACHE_BASE + GLFS_MD_CACHE_NUM_MESSAGES + 1) /* Messages with message IDs */ @@ -58,6 +58,14 @@ #define MD_CACHE_MSG_NO_MEMORY (GLFS_MD_CACHE_BASE + 1) +/*! + * @messageid + * @diagnosis + * @recommendedaction None + * + */ + +#define MD_CACHE_MSG_DISCARD_UPDATE (GLFS_MD_CACHE_BASE + 2) /*------------*/ #define glfs_msg_end_x GLFS_MSGID_END, "Invalid: End of messages" |