You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using cachelib in a storage system with RAFT consensus. We are thinking of a way to invalidate all cache items in the cache quickly on partition leader change, to avoid cache incoherence. Since it's leader change, the callback must finish quickly, maybe 1s.
I am wondering whether cachelib can (1) support removing all keys in the cache with one function call (2) do this quickly. Our goal is just to make sure those keys are not found when calling cache.find(). It may be achieved by clearing all meta data or data in cachelib.
Thanks
The text was updated successfully, but these errors were encountered:
The easiest way to do this would be to have an epoch for all the cache items that is bumped up on version change and let your application code do epoch checks after find() while having some background thread purge expired epochs or let them fall out of cache as the reads taper off. This does not accomplish your goal as you outline it above on how it can be done, but wonder if this meet the application level requirement to wipe out the cache. Few more questions
what's the intent with clearing the cache on leader change ? Is it purely for coeherence to avoid stale reads from being served while routing change propagates ?
do you have additional requirement to reclaim the cache space within a certain timeframe to make space for new data ?
Hi,
We are using cachelib in a storage system with RAFT consensus. We are thinking of a way to invalidate all cache items in the cache quickly on partition leader change, to avoid cache incoherence. Since it's leader change, the callback must finish quickly, maybe 1s.
I am wondering whether cachelib can (1) support removing all keys in the cache with one function call (2) do this quickly. Our goal is just to make sure those keys are not found when calling cache.find(). It may be achieved by clearing all meta data or data in cachelib.
Thanks
The text was updated successfully, but these errors were encountered: