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

Functional API should support transactional caches

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 8.2.1.Final
    • Core
    • None

      What is needed: a functional write operation on a key on a node that is not the key's owner, with cache loader enabled. What happens then is in non-transactional context it works fine; It starts failing when the functional operation is done in a transaction. Looks like the entry is wrapped prematurely, which puts it into the context's looked up nodes with the null value; the cache loader skips because the key is not local; and when it reaches Command.perform(), it still has null value. In the non-tx context this works OK because the command returns early if the entry is null (not wrapped) and then it is properly sent across the cluster. But in tx context it gets confused and invokes the functional operation on the local node even if it's not the owner. The functional operation gets an empty entry even though the cache loader would load it. It then modifies the entry, but the modification is not propagated anywhere because the tx distribution interceptor... well, because it doesn't handle this command at all? And the change is (apparently) not committed on the local node because it's not an owner.

      Oh, and if the node is an owner it doesn't help

      The tests are also available at https://gist.github.com/ksobolew/74bb8ff6b321786e64a62ecd0e4c5878/836905d2384a17989e41979232b0f962c88f06f4

        1. AbstractFunctionalCachestoreTest.java
          4 kB
          Krzysztof Sobolewski
        2. AbstractFunctionalInMemoryTest.java
          5 kB
          Krzysztof Sobolewski
        3. FunctionalCachestoreTestNonTx.java
          0.2 kB
          Krzysztof Sobolewski
        4. FunctionalCachestoreTestTx.java
          0.2 kB
          Krzysztof Sobolewski
        5. FunctionalInMemoryTestNonTx.java
          0.2 kB
          Krzysztof Sobolewski
        6. FunctionalInMemoryTestTx.java
          0.2 kB
          Krzysztof Sobolewski

            Unassigned Unassigned
            ksobolewski_jira Krzysztof Sobolewski (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: