[infinispan-dev] Eviction thread and purging expired entries

Mircea Markus mircea.markus at jboss.com
Fri Jul 23 08:58:27 EDT 2010


On 23 Jul 2010, at 13:48, Manik Surtani wrote:

> 
> On 23 Jul 2010, at 13:11, Mircea Markus wrote:
> 
>>>> What I have in mind is: cache store has a a boolean field set to true if it has entries that can expire, false otherwise. It is in full control of the modifications applied to it and it can update this flag accordingly. 
>>>> if the flag is false, then when asked to purge the store won't do anything. So if one doesn't use expiry at all, it won't even have to configure anything to disable it.
>>>> I've implemented this for BucketBasedCacheStore and is really simple (attached). 
>>>> <purging_optimization.patch>
>>> 
>>> How would this work for shared cache stores?
>> It would be the cache store where the data was written that would do the purging.
> 
> Makes sense (-ish).  How would you deal with failover?  E.g., C1, C2, C3 all write to shared cache store S.  C1, C2 both store immortal entries, and C3 decides to store an entry with a lifespan.  C3 then crashes and is removed from the cluster.  The entry would never be purged in S (at least, until someone decides to access the entry from C1 or C2).  Right?
Yes. On startup the cache should do a purge, as it should assume there might be expired entries. So if C3 is brought back it will run a purge. More, if another entry that might expire is added the purge would run anyway.
Another point: we don't need to run purging on all nodes if the store is shared. 
> 
> Cheers
> Manik
> --
> Manik Surtani
> manik at jboss.org
> Lead, Infinispan
> Lead, JBoss Cache
> http://www.infinispan.org
> http://www.jbosscache.org
> 
> 
> 
> 
> 
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev




More information about the infinispan-dev mailing list