Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-1343 Stale locks occurring on rehashing into a running cluster.
  3. ISPN-1483

Stale locks with eager/pessimistic locking after the prepare command fails on a remote node

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Done
    • Icon: Major Major
    • 5.1.0.BETA3, 5.1.0.FINAL
    • 5.0.1.FINAL, 5.1.0.BETA2
    • Transactions
    • None

      When a PrepareCommand fails (in our case because it didn't get a reply from the remote node in 15 seconds), the locking interceptor catches the exception and releases all the locks acquired by the transaction.

      After that TransactionCoordinator starts a proper rollback, but the entries in the invocation context are no longer locked (and in 5.0 that means they only have the VALID flag set, not CHANGED or CREATED). That means local locks are not released twice, but it also means the PrepareCommand is not executed remotely (BaseRpcInterceptor.shouldInvokeRemoteTxCommand() returns false).

      In 5.1 we no longer have the entry flags but the entries are still locked.

      I see 3 possible solutions:
      1. Don't clean up the locks at all in LockingInterceptor (if the invocation context is transactional) and rely on TransactionCoordinator to do it.
      2. Clean up the locks but don't call rollback() on the entry.
      3. Rely on LocalTransaction's getRemoteLocksAcquired() instead of the locked entries to determine if the rollback command should be executed on the remote nodes.

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

              Created:
              Updated:
              Resolved: