Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-12933

Node failed after put incorrect key class for indexed type to transactional cache

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.9, 2.8.1
    • Component/s: None
    • Labels:
      None

      Description

      Node failed after put incorrect key class for indexed type to the transactional cache when indexing is enabled.

      Reproducer:

      public class IndexedTypesTest extends GridCommonAbstractTest {
          private boolean failed;
      
          @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
              return super.getConfiguration(igniteInstanceName)
                  .setFailureHandler((ignite, ctx) -> failed = true)
                  .setCacheConfiguration(new CacheConfiguration<>(DEFAULT_CACHE_NAME)
                      .setAtomicityMode(TRANSACTIONAL)
                      .setIndexedTypes(String.class, String.class));
          }
      
          @Test
          public void testPutIndexedType() throws Exception {
              Ignite ignite = startGrids(2);
      
              for (int i = 0; i < 10; i++) {
                  try {
                      ignite.cache(DEFAULT_CACHE_NAME).put(i, "val" + i);
                  }
                  catch (Exception ignore) {
                  }
              }
      
              assertFalse(failed);
          }
      }
      

      Node failed with exception:

      [2020-04-22 17:05:34,524][ERROR][sys-stripe-11-#76%cache.IndexedTypesTest1%][IgniteTestResources] Critical system error detected. Will be handled accordingly to configured handler [hnd=o.a.i.i.processors.cache.IndexedTypesTest$$Lambda$115/0x000000080024d040@147237db, failureCtx=FailureContext [type=CRITICAL_ERROR, err=class o.a.i.i.transactions.IgniteTxHeuristicCheckedException: Committing a transaction has produced runtime exception]]
      class org.apache.ignite.internal.transactions.IgniteTxHeuristicCheckedException: Committing a transaction has produced runtime exception
          at org.apache.ignite.internal.processors.cache.transactions.IgniteTxAdapter.heuristicException(IgniteTxAdapter.java:800)
          at org.apache.ignite.internal.processors.cache.distributed.GridDistributedTxRemoteAdapter.commitIfLocked(GridDistributedTxRemoteAdapter.java:838)
          at org.apache.ignite.internal.processors.cache.distributed.GridDistributedTxRemoteAdapter.commitRemoteTx(GridDistributedTxRemoteAdapter.java:893)
          at org.apache.ignite.internal.processors.cache.transactions.IgniteTxHandler.finish(IgniteTxHandler.java:1502)
          at org.apache.ignite.internal.processors.cache.transactions.IgniteTxHandler.processDhtTxPrepareRequest(IgniteTxHandler.java:1233)
          at org.apache.ignite.internal.processors.cache.transactions.IgniteTxHandler$5.apply(IgniteTxHandler.java:229)
          at org.apache.ignite.internal.processors.cache.transactions.IgniteTxHandler$5.apply(IgniteTxHandler.java:227)
          at org.apache.ignite.internal.processors.cache.GridCacheIoManager.processMessage(GridCacheIoManager.java:1142)
          at org.apache.ignite.internal.processors.cache.GridCacheIoManager.onMessage0(GridCacheIoManager.java:591)
          at org.apache.ignite.internal.processors.cache.GridCacheIoManager.handleMessage(GridCacheIoManager.java:392)
          at org.apache.ignite.internal.processors.cache.GridCacheIoManager.handleMessage(GridCacheIoManager.java:318)
          at org.apache.ignite.internal.processors.cache.GridCacheIoManager$1.onMessage(GridCacheIoManager.java:308)
          at org.apache.ignite.internal.managers.communication.GridIoManager.invokeListener(GridIoManager.java:1847)
          at org.apache.ignite.internal.managers.communication.GridIoManager.processRegularMessage0(GridIoManager.java:1472)
          at org.apache.ignite.internal.managers.communication.GridIoManager$9.run(GridIoManager.java:1367)
          at org.apache.ignite.internal.util.StripedExecutor$Stripe.body(StripedExecutor.java:565)
          at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:120)
          at java.base/java.lang.Thread.run(Thread.java:834)
      Caused by: class org.apache.ignite.IgniteCheckedException: Failed to update index, incorrect key class [expCls=java.lang.String, actualCls=java.lang.Integer]
          at org.apache.ignite.internal.processors.query.GridQueryProcessor.typeByValue(GridQueryProcessor.java:2223)
          at org.apache.ignite.internal.processors.query.GridQueryProcessor.store(GridQueryProcessor.java:2092)
          at org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager.store(GridCacheQueryManager.java:410)
          at org.apache.ignite.internal.processors.cache.IgniteCacheOffheapManagerImpl$CacheDataStoreImpl.finishUpdate(IgniteCacheOffheapManagerImpl.java:2627)
          at org.apache.ignite.internal.processors.cache.IgniteCacheOffheapManagerImpl$CacheDataStoreImpl.invoke0(IgniteCacheOffheapManagerImpl.java:1713)
          at org.apache.ignite.internal.processors.cache.IgniteCacheOffheapManagerImpl$CacheDataStoreImpl.invoke(IgniteCacheOffheapManagerImpl.java:1688)
          at org.apache.ignite.internal.processors.cache.IgniteCacheOffheapManagerImpl.invoke(IgniteCacheOffheapManagerImpl.java:445)
          at org.apache.ignite.internal.processors.cache.GridCacheMapEntry.storeValue(GridCacheMapEntry.java:4296)
          at org.apache.ignite.internal.processors.cache.GridCacheMapEntry.storeValue(GridCacheMapEntry.java:4270)
          at org.apache.ignite.internal.processors.cache.GridCacheMapEntry.innerSet(GridCacheMapEntry.java:1545)
          at org.apache.ignite.internal.processors.cache.distributed.GridDistributedTxRemoteAdapter.commitIfLocked(GridDistributedTxRemoteAdapter.java:675)
          ... 16 more

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alex_pl Aleksey Plekhanov
                Reporter:
                alex_pl Aleksey Plekhanov
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h