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

Caches with transactional stores handle 1PC transactions incorrectly

    XMLWordPrintable

Details

    Description

      My ISPN-13327 changes, which make preload always use a 1PC transaction, have uncovered a problem with the transactional stores and 1PC transactions, which is causing failures in TableJdbcStoreFunctionalTest.testLoadEntrySet[SQLITE|H2, transactionalCache=true, transactionalStore=true]

      When a 1PC PrepareCommand is executed, first TransactionalStoreInterceptor calls persistenceManager.prepareAllTxStores().
      Then CacheWriterInterceptor calls persistenceManager.performBatch() to store the entries.
      And there is no call to persistenceManager.prepareAllTxStores() to release the tx connection in TableJdbcStore.

      I'm thinking we could either

      • Skip the persistenceManager.prepareAllTxStores() call in TransactionalStoreInterceptor.visitPrepareCommand() if the prepare is 1PC and let CacheWriterInterceptor handle persistence
      • Add a call to persistenceManager.commitAllTxStores() in TransactionalStoreInterceptor.visitPrepareCommand() if the prepare is 1PC and make persistenceManager.performBatch() skip transactional stores

      We also need to add a test to cover transactional stores with 1PC transactions.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: