cannot lock entry after entry owner has been disconnected
jseparovic Jun 14, 2015 12:07 AMHi,
I have a 3 node replicated clustered cache functioning as a high frequency "lock then process" type application. Each iteration tries to lock a record in the cache, if successful it does stuff, then writes back (sometimes). If lock fails, it moves on to the next record.
return new ConfigurationBuilder()
.locking()
.concurrencyLevel(3)
.lockAcquisitionTimeout(3000L)
.isolationLevel(IsolationLevel.REPEATABLE_READ)
.useLockStriping(false)
.clustering()
.cacheMode(CacheMode.REPL_SYNC)
.transaction()
.transactionManagerLookup(new JBossTransactionManagerLookup())
.lockingMode(LockingMode.PESSIMISTIC)
.transactionMode(TransactionMode.TRANSACTIONAL)
.autoCommit(false)
.build();
*version: jboss-as-clustering-infinispan-7.2.0.Final.jar
When all 3 nodes are up everything operated as expected. Then when I "ifdown" the owner of the cache entry, the other 2 nodes cannot obtain a lock on this entry until the owner comes back up:
After bringing down the owner, I get a SuspectException, then on the next attempt I get a TimeoutException. Then the timeout exception repeats until the owner node comes back up. (this happens on both the non-owner nodes)
14-Jun-2015 03:40:28,801 DEBUG [CacheContainer] (pool-12-thread-1) TX: lock failed on 5a594cd4-405c-4c50-9086-5deb0bda6571 : org.infinispan.remoting.transport.jgroups.SuspectException : Suspected member: node1/mycache
Lock info: AbstractPerEntryLockContainer{locks={}}
14-Jun-2015 03:40:28,801 DEBUG [Controller] (pool-12-thread-1) Couldn't Lock: 5a594cd4-405c-4c50-9086-5deb0bda6571
14-Jun-2015 03:40:28,801 DEBUG [CacheContainer] (pool-12-thread-1) TX: rollback
14-Jun-2015 03:40:33,803 DEBUG [Controller] (pool-12-thread-1) CacheContainer lock info: AbstractPerEntryLockContainer{locks={}}
14-Jun-2015 03:40:33,803 DEBUG [CacheContainer] (pool-12-thread-1) TX: begin
14-Jun-2015 03:40:33,804 DEBUG [CacheContainer] (pool-12-thread-1) TX: attempting lock on 5a594cd4-405c-4c50-9086-5deb0bda6571
14-Jun-2015 03:40:36,809 DEBUG [CacheContainer] (pool-12-thread-1) TX: lock failed on 5a594cd4-405c-4c50-9086-5deb0bda6571 : org.infinispan.util.concurrent.TimeoutException : Could not acquire lock on 5a594cd4-405c-4c50-9086-5deb0bda6571 on behalf of transaction GlobalTransaction:<node2:mycache>:9:local. Lock is being held by null
Any ideas how to handle the stale lock once the SuspectException is raised? Should this be handled by infinispan?
Cheers,
Jason Separovic