I'm trying to think of how this can be. Worker threads adding data, adding stuff to the async cache store queue for flushing. The eviction thread removing stuff from the data container *only*.*Perhaps* what you see is a race where you have:1 add item to data container2 enqueue in async cache store for storage3 evict in memory4 attempt a get
where steps 1 - 4 happen *before* the async cache store can flush its queue to disk. So this would result in the thread in 4 consulting the data container, not finding the entry, then checking the cache store and not finding it there either since it hasn't been flushed yet.Now IMO this is normal behaviour - the price you pay for asynchronously writing to a store. But perhaps this window can be
reduced by looking through the async queue as well, before checking the underlying store. But as I said, this just reduces the size of this window and not eliminate it altogether, since this is async and there is no guarantee that the cache store has finished writing internally (e.g., an fsync() operation or in the case of S3, Amazon's eventual consistency model).Why should eviction be transactional? I don't need eviction to be an all-or-nothing, reversible event. :) If an entry gets evicted, cool. If not (for whatever reason), too bad, move on to the next evictable entry.
CheersManik_______________________________________________Looks like a design issue ? WDYT ?Cheers,PhilOn Thu, Feb 4, 2010 at 10:44 AM, Manik Surtani <manik@jboss.org> wrote:
That is strange since there is no correlation between eviction and the synchronicity of cache stores. Have you got a reproducible test for this?CheersManikOn 3 Feb 2010, at 18:37, Philippe Van Dyck wrote:Thanks Manik,I have a another problem with eviction, it seems to destroy cache entries, only when I use async.Of course, all updates are transactional.Where should I search for clues ? Any idea ?Here is my config:<?xml version="1.0" encoding="UTF-8"?><infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns="urn:infinispan:config:4.0"><global><transporttransportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport"><properties><property name="configurationFile" value="jgroups.xml" /></properties></transport></global><namedCache name="qi4j"><transactiontransactionManagerLookupClass="org.infinispan.transaction.lookup.DummyTransactionManagerLookup" /><clustering mode="distribution"><l1 enabled="true" lifespan="100000" /><hash numOwners="1" rehashRpcTimeout="120000" /></clustering><loaders passivation="false" shared="true" preload="false"><loader class="org.infinispan.loaders.file.FileCacheStore"fetchPersistentState="false" ignoreModifications="false"purgeOnStartup="true"><properties><property name="location" value="/tmp" /></properties><async enabled="true" threadPoolSize="3" /></loader></loaders><deadlockDetection enabled="true" spinDuration="1000"></deadlockDetection><eviction strategy="FIFO" wakeUpInterval="1000" maxEntries="10" /><unsafe unreliableReturnValues="true" /></namedCache></infinispan>phil_______________________________________________On Wed, Feb 3, 2010 at 6:42 PM, Manik Surtani <manik@jboss.org> wrote:
Ugh, good point. I thought the unit tests would have trapped a dumb-ass mistake like this.The reason for transforming the name of the bucket is that we usually use hashcodes as the bucket name, which can take Integer.MIN_VALUE to Integer.MAX_VALUE. These are then translated into Strings, and this becomes the name of the storage unit, e.g., 12345.bucket in the FileCacheStore. Now filesystems are happy to accept a -12345.bucket but certain cloud storage providers barf when encountering the '-' character. Hence the transformation to A12345.bucket in some cases.CheersManikPS: pushing up a new snapshot as I type, containing this fix + lower verbosity on eviction-related lock timeouts.On 3 Feb 2010, at 17:16, Philippe Van Dyck wrote:_______________________________________________And BTW, why do it ?p---------- Forwarded message ----------
From: Philippe Van Dyck <pvdyck@gmail.com>
Date: Wed, Feb 3, 2010 at 6:15 PM
Subject: CloudCacheStore Bug
To: infinispan -Dev List <infinispan-dev@lists.jboss.org>
Hi all,there is a bug in CloudCacheStore that makes me feel like I am the only one using it ;-)in CR4 : if you change the "-" sign to "A" in getBucketName ... you need to do the opposite somewhere (or call it every time) ;-)WDYT ?p
infinispan-dev mailing listhttps://lists.jboss.org/mailman/listinfo/infinispan-dev--Manik SurtaniLead, InfinispanLead, JBoss Cache
_______________________________________________
infinispan-dev mailing list
infinispan-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/infinispan-dev
infinispan-dev mailing list
infinispan-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/infinispan-dev--Manik SurtaniLead, InfinispanLead, JBoss Cache
_______________________________________________
infinispan-dev mailing list
infinispan-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/infinispan-dev
infinispan-dev mailing list
infinispan-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/infinispan-dev--Manik SurtaniLead, InfinispanLead, JBoss Cache
_______________________________________________
infinispan-dev mailing list
infinispan-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/infinispan-dev