[infinispan-issues] [JBoss JIRA] Created: (ISPN-903) CacheStore throws a NPE when preparing a transaction which includes a key it doesn't own

Manik Surtani (JIRA) jira-events at lists.jboss.org
Thu Jan 27 17:16:03 EST 2011


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

                 Key: ISPN-903
                 URL: https://issues.jboss.org/browse/ISPN-903
             Project: Infinispan
          Issue Type: Bug
          Components: Distributed Cache, Loaders and Stores, Transactions
    Affects Versions: 4.2.0.Final
            Reporter: Manik Surtani
            Assignee: Manik Surtani
            Priority: Critical
             Fix For: 4.2.1.Final


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:

{code}
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)
{code}

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the infinispan-issues mailing list