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

Locks are lost in pessimistic cache

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 8.2.4.Final, 9.0.0.Final
    • 7.2.3.Final
    • Core
    • None

      When you perform multiple TX write operations in one transaction (put, replace, lock, etc) and one of the nodes goes down, there is a slight chance that some locks will be lost and acquired by another transaction before current transaction ends.

      So client ends up with two transactions holding the same lock on pessimistic cache at the same time. Both transactions commit at the end successfully.

      I spent some time debugging infinispan code and found that PessimisticLockingInterceptor#releaseLocksOnFailureBeforePrepare releases all locks when OutdatedTopologyException occurs on remote node. But then StateTransferInterceptor#handleTxWriteCommand retries last command. This behavior produces inconsistent state - all locks before last command are released and any other transaction can acquire them.

      I am attaching Test which reproduces this problem

              pruivo@redhat.com Pedro Ruivo
              eugene.scripnik Eugene Scripnik (Inactive)
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: