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

CacheStore throws a NPE when preparing a transaction which includes a key it doesn't own

    XMLWordPrintable

Details

    • Low

    Description

      When a transaction is prepared, the PrepareCommand is broadcast to all participants in the transaction. However, recipients only replay Commands whose keys map to their node (by consulting the DistributionManager). When the PrepareCommand reaches the CacheStoreInterceptor, however, the CacheStoreInterceptor is unable to handle all of the modifications in the prepare as it doesn't filter out modifications based on what is mapped to the node in question. This results in a NullPointerExceptoion on the receiving node, which causes the transaction to abort:

      java.lang.NullPointerException
      	at org.infinispan.interceptors.CacheStoreInterceptor.getStoredEntry(CacheStoreInterceptor.java:337)
      	at org.infinispan.interceptors.CacheStoreInterceptor$StoreModificationsBuilder.visitPutKeyValueCommand(CacheStoreInterceptor.java:288)
      	at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:72)
      	at org.infinispan.interceptors.CacheStoreInterceptor.prepareCacheLoader(CacheStoreInterceptor.java:255)
      	at org.infinispan.interceptors.CacheStoreInterceptor.visitPrepareCommand(CacheStoreInterceptor.java:175)
      	at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:116)
      	at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
      	at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:132)
      	at org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:106)
      	at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:116)
      	at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
      	at org.infinispan.interceptors.NotificationInterceptor.visitPrepareCommand(NotificationInterceptor.java:48)
      	at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:116)
      	at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
      	at org.infinispan.interceptors.TxInterceptor.visitPrepareCommand(TxInterceptor.java:103)
      	at org.infinispan.interceptors.DistTxInterceptor.visitPrepareCommand(DistTxInterceptor.java:59)
      	at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:116)
      	at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
      	at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:87)
      	at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:58)
      	at org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:106)
      	at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:116)
      	at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:273)
      	at org.infinispan.commands.tx.PrepareCommand.perform(PrepareCommand.java:107)
      	at org.infinispan.remoting.InboundInvocationHandlerImpl.handle(InboundInvocationHandlerImpl.java:94)
      	at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.executeCommand(CommandAwareRpcDispatcher.java:179)
      	at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.handle(CommandAwareRpcDispatcher.java:153)
      	at org.jgroups.blocks.RequestCorrelator.handleRequest(RequestCorrelator.java:577)
      	at org.jgroups.blocks.RequestCorrelator.receiveMessage(RequestCorrelator.java:488)
      	at org.jgroups.blocks.RequestCorrelator.receive(RequestCorrelator.java:364)
      	at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.up(MessageDispatcher.java:770)
      	at org.jgroups.JChannel.up(JChannel.java:1467)
      

      Attachments

        Activity

          People

            manik_jira Manik Surtani (Inactive)
            manik_jira Manik Surtani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: