Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-4732

Can't acquire locks with lockAcquisitionTimeout = 0 immediately after topology change

    XMLWordPrintable

Details

    Description

      After a topology change, as long as there are still transactions from the previous topology, it's not possible to acquire locks with a lockAcquisitionTimeout of 0. AbstractTxLockingInterceptor first checks for backup locks, and throws a TimeoutException if the remaining time is <= 0. But waitForTransactionsToComplete already throws a TimeoutException if the timeout was exceeded, so the additional check is not needed.

      This caused a random failure in SyncDistTxClusterExtendedStatisticLogicTest.testConditionalPutTxAndReadOnlyTx:

      20:43:28,771 ERROR (testng-SyncDistTxClusterExtendedStatisticLogicTest:) [UnitTestTestNGListener] Test testConditionalPutTxAndReadOnlyTx(org.infinispan.stats.logic.SyncDistTxClusterExtendedStatisticLogicTest) failed.
      javax.transaction.RollbackException: ARJUNA016053: Could not commit transaction.
      	at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1177)
      	at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:126)
      	at org.infinispan.stats.BaseTxClusterExtendedStatisticLogicTest.testStats(BaseTxClusterExtendedStatisticLogicTest.java:242)
      	at org.infinispan.stats.BaseTxClusterExtendedStatisticLogicTest.testConditionalPutTxAndReadOnlyTx(BaseTxClusterExtendedStatisticLogicTest.java:104)
      Caused by: org.infinispan.commons.CacheException: Could not prepare. 
      	at org.infinispan.transaction.synchronization.SynchronizationAdapter.beforeCompletion(SynchronizationAdapter.java:46)
      	at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:76)
      	at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:273)
      	at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:93)
      	at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:162)
      	at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1165)
      	... 23 more
      Caused by: javax.transaction.xa.XAException
      	at org.infinispan.transaction.impl.TransactionCoordinator.prepare(TransactionCoordinator.java:141)
      	at org.infinispan.transaction.impl.TransactionCoordinator.prepare(TransactionCoordinator.java:104)
      	at org.infinispan.transaction.synchronization.SynchronizationAdapter.beforeCompletion(SynchronizationAdapter.java:44)
      	... 28 more
      Caused by: org.infinispan.util.concurrent.TimeoutException: Could not acquire lock on MagicKey#KEY_38{b4f7313c@NodeA-6769/0} on behalf of transaction GlobalTransaction:<NodeA-6769>:418:local.Lock is being held by null
      	at org.infinispan.interceptors.locking.AbstractTxLockingInterceptor.newTimeoutException(AbstractTxLockingInterceptor.java:200)
      	at org.infinispan.interceptors.locking.AbstractTxLockingInterceptor.lockKeyAndCheckOwnership(AbstractTxLockingInterceptor.java:158)
      	at org.infinispan.interceptors.locking.AbstractTxLockingInterceptor.lockAndRegisterBackupLock(AbstractTxLockingInterceptor.java:98)
      	at org.infinispan.interceptors.locking.OptimisticLockingInterceptor.acquireAllLocks(OptimisticLockingInterceptor.java:262)
      	at org.infinispan.interceptors.locking.OptimisticLockingInterceptor.visitPrepareCommand(OptimisticLockingInterceptor.java:84)
      	at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:124)
      	at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:98)
      	at org.infinispan.interceptors.NotificationInterceptor.visitPrepareCommand(NotificationInterceptor.java:36)
      	at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:124)
      	at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:98)
      	at org.infinispan.stats.wrappers.ExtendedStatisticInterceptor.visitPrepareCommand(ExtendedStatisticInterceptor.java:122)
      	at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:124)
      	at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:98)
      	at org.infinispan.interceptors.TxInterceptor.invokeNextInterceptorAndVerifyTransaction(TxInterceptor.java:124)
      	at org.infinispan.interceptors.TxInterceptor.visitPrepareCommand(TxInterceptor.java:111)
      	at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:124)
      	at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:98)
      	at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:112)
      	at org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:97)
      	at org.infinispan.statetransfer.TransactionSynchronizerInterceptor.visitPrepareCommand(TransactionSynchronizerInterceptor.java:42)
      	at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:124)
      	at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:98)
      	at org.infinispan.statetransfer.StateTransferInterceptor.handleTopologyAffectedCommand(StateTransferInterceptor.java:217)
      	at org.infinispan.statetransfer.StateTransferInterceptor.handleTxCommand(StateTransferInterceptor.java:147)
      	at org.infinispan.statetransfer.StateTransferInterceptor.visitPrepareCommand(StateTransferInterceptor.java:75)
      	at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:124)
      	at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:98)
      	at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:112)
      	at org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:97)
      	at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:124)
      	at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:98)
      	at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:108)
      	at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:71)
      	at org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:97)
      	at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:124)
      	at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:98)
      	at org.infinispan.util.TransactionTrackInterceptor.visitPrepareCommand(TransactionTrackInterceptor.java:81)
      	at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:124)
      	at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:333)
      	at org.infinispan.transaction.impl.TransactionCoordinator.prepare(TransactionCoordinator.java:121)
      

      Attachments

        Activity

          People

            dberinde@redhat.com Dan Berindei
            dberinde@redhat.com Dan Berindei
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: