[infinispan-issues] [JBoss JIRA] (ISPN-2072) After a write skew check failure applications can't rollback
Sanne Grinovero (JIRA)
jira-events at lists.jboss.org
Tue May 29 06:18:18 EDT 2012
[ https://issues.jboss.org/browse/ISPN-2072?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12696681#comment-12696681 ]
Sanne Grinovero commented on ISPN-2072:
---------------------------------------
Hi Mircea,
I can't apply the workaround, the transaction needs to be rolled back explicitly as there might be other resources registered.
I need to "manually" call a rollback on a failure; it's ok if you have Infinispan already clear up locks and other resources as rollback will be the only acceptable operation, but you should not have Infinispan clear the Transaction from it's register of known transactions yet, to allow the TransactionManager to rollback correctly.
> After a write skew check failure applications can't rollback
> ------------------------------------------------------------
>
> Key: ISPN-2072
> URL: https://issues.jboss.org/browse/ISPN-2072
> Project: Infinispan
> Issue Type: Bug
> Components: Transactions
> Affects Versions: 5.1.5.CR1
> Reporter: Sanne Grinovero
> Assignee: Mircea Markus
> Priority: Critical
> Fix For: 5.1.5.FINAL, 5.2.0.ALPHA1
>
>
> When having this configuration:
> {code:xml}
> <transaction
> transactionMode="TRANSACTIONAL"
> transactionManagerLookupClass="org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup"/>
> <locking isolationLevel="REPEATABLE_READ" writeSkewCheck="true" />
> {code}
> When a write skew check is failed, the following exception is propagated to the user code:
> {quote}
> org.infinispan.CacheException: Detected write skew - concurrent removal of entry!
> at org.infinispan.container.entries.RepeatableReadEntry.performLocalWriteSkewCheck(RepeatableReadEntry.java:75)
> at org.infinispan.container.entries.RepeatableReadEntry.copyForUpdate(RepeatableReadEntry.java:52)
> at org.infinispan.container.EntryFactoryImpl.wrapEntryForRemove(EntryFactoryImpl.java:133)
> at org.infinispan.interceptors.EntryWrappingInterceptor.visitRemoveCommand(EntryWrappingInterceptor.java:158)
> at org.infinispan.commands.write.RemoveCommand.acceptVisitor(RemoveCommand.java:72)
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
> at org.infinispan.interceptors.locking.OptimisticLockingInterceptor.visitRemoveCommand(OptimisticLockingInterceptor.java:173)
> at org.infinispan.commands.write.RemoveCommand.acceptVisitor(RemoveCommand.java:72)
> {quote}
> The user code is catching the exception, and attempts a rollback. The rollback fails with:
> {quote}
> WARN [jta] (main) ARJUNA016045: attempted rollback of < formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffffac11823e:8e2d:4fc39246:2669f, node_name=1, branch_uid=0:ffffac11823e:8e2d:4fc39246:266a4, subordinatenodename=null, eis_name=0 > (TransactionXaAdapter\{localTransaction=LocalXaTransaction\{xid=< formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffffac11823e:8e2d:4fc39246:2669f, node_name=1, branch_uid=0:ffffac11823e:8e2d:4fc39246:266a4, subordinatenodename=null, eis_name=0 >} LocalTransaction\{remoteLockedNodes=null, isMarkedForRollback=false, transaction=TransactionImple < ac, BasicAction: 0:ffffac11823e:8e2d:4fc39246:2669f status: ActionStatus.ABORTING >, lockedKeys=null, backupKeyLocks=null, viewId=-1} org.infinispan.transaction.xa.LocalXaTransaction at 99a9}) failed with exception code XAException.XAER_NOTA
> javax.transaction.xa.XAException
> at org.infinispan.transaction.xa.TransactionXaAdapter.getLocalTransactionAndValidateImpl(TransactionXaAdapter.java:245)
> at org.infinispan.transaction.xa.TransactionXaAdapter.rollback(TransactionXaAdapter.java:134)
> at com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord.topLevelAbort(XAResourceRecord.java:345)
> at com.arjuna.ats.arjuna.coordinator.BasicAction.doAbort(BasicAction.java:2876)
> at com.arjuna.ats.arjuna.coordinator.BasicAction.doAbort(BasicAction.java:2855)
> at com.arjuna.ats.arjuna.coordinator.BasicAction.Abort(BasicAction.java:1618)
> at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.cancel(TwoPhaseCoordinator.java:118)
> at com.arjuna.ats.arjuna.AtomicAction.abort(AtomicAction.java:188)
> at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.rollbackAndDisassociate(TransactionImple.java:1247)
> at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.rollback(BaseTransaction.java:134)
> {quote}
> as in _org.infinispan.transaction.xa.TransactionXaAdapter.getLocalTransactionAndValidateImpl(Xid, XaTransactionTable)_ the operation
> {code}
> LocalXaTransaction localTransaction = txTable.getLocalTransaction(xid);{code}
> returns *null*.
> This happens as the method _org.infinispan.interceptors.TxInterceptor_.enlistWriteAndInvokeNext(InvocationContext, WriteCommand) is removing a reference to the local transaction on *line 218*
> I've removed the cleanup line and it fixes my problem: I'm now correctly able to rollback transactions and try again. Still I'm uncomfortable with that change..
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the infinispan-issues
mailing list