[jboss-user] [JBossCache] - Two nodes updating cache concurrently using a PojoCacheMBean

jbirkenmaier do-not-reply at jboss.com
Tue Sep 26 10:02:53 EDT 2006


I have a 3 node cluster and one node goes away. The two remaining nodes receive notice at exactly the same time and update their cache accordingly. Each is basically removing references to the disappeared node from cache. The problem occurs when the commit is done on the 2 nodes. Each one has a lock that the other node wants. Here is the exception:

Caused by: java.lang.IllegalStateException: there is already a writer holding the lock: GlobalTransaction:<192.168.69.253:41197>:65
        at org.jboss.cache.lock.LockMap.setWriterIfNotNull(LockMap.java:96)
        at org.jboss.cache.lock.IdentityLock.acquireWriteLock(IdentityLock.java:204)
        at org.jboss.cache.Node.acquireWriteLock(Node.java:431)
        at org.jboss.cache.Node.acquire(Node.java:386)
        at org.jboss.cache.interceptors.OptimisticLockingInterceptor.lockNodes(OptimisticLockingInterceptor.java:149)
        at org.jboss.cache.interceptors.OptimisticLockingInterceptor.invoke(OptimisticLockingInterceptor.java:76)
        at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
        at org.jboss.cache.interceptors.OptimisticReplicationInterceptor.invoke(OptimisticReplicationInterceptor.java:74)
        at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
        at org.jboss.cache.interceptors.TxInterceptor.runPreparePhase(TxInterceptor.java:804)
        at org.jboss.cache.interceptors.TxInterceptor$LocalSynchronizationHandler.beforeCompletion(TxInterceptor.java:1069)
        ... 83 more
07:13:13,767 ERROR [ResourceReplicatorBase] (JBoss Shutdown Hook) removeResourceDescriptor: org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=dragoneyes/119, BranchQual=, localId=119] status=STATUS_NO_TRANSACTION; - nested throwable: (java.lang.RuntimeException: ), retry the operation, current iteration: 0

Each node throws this exception with an IP and port of the other node. I have retry code in there to retry my operations but when this exception is thrown, the cache becomes corrupt and I am unable to remove the data (again) from the cache. This works perfectly if one node gets there first but when they hit the cache at the same time....trouble.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3974206#3974206

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3974206



More information about the jboss-user mailing list