[infinispan-dev] CacheLoaders, Distribution mode and Interceptors

Mircea Markus mmarkus at redhat.com
Tue Mar 19 14:51:40 EDT 2013


On 19 Mar 2013, at 17:38, Dan Berindei wrote:

> >
> > Implementation-wise, just changing the interceptor order is probably not enough. If the key doesn't exist in the cache, the CacheLoaderInterceptor will still try to load it from the cache store after the remote lookup, so we'll need a marker  in the invocation context to avoid the extra cache store load.
> if the key does't map to the local node it should trigger a remote get to owners (or allow the dist interceptor to do just that)
> > Actually, since this is just a performance issue, it could wait until we implement tombstones everywhere.
> Hmm, not sure i see the correlation between this and tombstones?
> 
> 
> If the key doesn't exist in the cache at all, on any node, then the remote lookup will return null and the CacheLoaderInterceptor will try to load it from the local cache store again (assuming we move CacheLoaderInterceptor after DistributionInterceptor). If DistributionInterceptor put a tombstone in the invocation context for that key, CacheLoaderInterceptor could avoid that extra cache store lookup.
I think the rule for going to the caches store should be based on key locality - if the key does not map to the local node, then don't involve the store at all locally,  but delegate the store interaction to actual owner.

Cheers,
-- 
Mircea Markus
Infinispan lead (www.infinispan.org)







More information about the infinispan-dev mailing list