[
https://issues.jboss.org/browse/ISPN-6266?page=com.atlassian.jira.plugin....
]
Gustavo Fernandes edited comment on ISPN-6266 at 6/20/16 9:40 AM:
------------------------------------------------------------------
This is due to a lack of wrapping for an entry that comes from a remote get before write.
The sequence of events is:
1) {{PutKeyValueCommand}} is called for key {{K}} on {{NodeB}}
2) {{NodeB}} verifies that it is not primary owner of {{K}} and forward it to {{NodeC}}
3) {{NodeC}} receives the command, on topology id {{4}}
4) In the meantime, {{NodeC}} receives a topology update to id {{5}}, where {{NodeC}} is
not a primary owner anymore and neither a backup owner.
5) The {{EntryWrappingInterceptor}} on {{NodeC}} does not wrap the entry since origin is
not local, and {{NodeC}} is not an onwer
6) Since the entry is {{DELTA_AWARE}}, the {{NonTxDistributionInterceptor}} on {{NodeC}}
does a remote call to obtain the value, and the value is put on context as an
{{ImmortalCacheEntry}}
7) {{ClassCastException}} on {{NodeC}} since the {{PutKeyValueCommand}} casts to
{{MVCCEntry}}
was (Author: gustavonalle):
This is due to a lack of wrapping for an entry that comes from a remote get before write.
The sequence of events is:
1) {{PutKeyValueCommand}} is called for key {{K}} on {{NodeB}}
2) {{NodeB}} verifies that it is not primary owner of {{K}} and forward it to {{NodeC}}
3) {{NodeC}} receives the command, on topology id {{4}}
4) In the meantime, {{NodeC}} receives a topology update to id {{5}}, where {{NodeC}} is
not a primary owner anymore and neither a backup owner.
5) The {{EntryWrappingInterceptor}} on {{NodeC}} does not wrap the entry since origin is
not local, and {{NodeC}} is not an onwer
6) Since the entry is {{DELTA_AWARE}}, the {{NonTxDistributionInterceptor}} does a remote
call to obtain the value, and the value is put on context as an {{ImmortalCacheEntry}}
7) {{ClassCastException}} on {{NodeC}} since the {{PutKeyValueCommand}} casts to
{{MVCCEntry}}
ClassCastException:
org.infinispan.container.entries.ImmortalCacheEntry cannot be cast to
org.infinispan.container.entries.MVCCEntry
------------------------------------------------------------------------------------------------------------------------------------
Key: ISPN-6266
URL:
https://issues.jboss.org/browse/ISPN-6266
Project: Infinispan
Issue Type: Bug
Components: Core
Affects Versions: 8.2.0.Beta2
Reporter: Gustavo Fernandes
Assignee: Gustavo Fernandes
Fix For: 9.0.0.Alpha3
I've observed this intermittent error when running the test
https://github.com/infinispan/infinispan/blob/master/query/src/test/java/...
The stack is shown below:
{code}
Caused by: java.lang.ClassCastException:
org.infinispan.container.entries.ImmortalCacheEntry cannot be cast to
org.infinispan.container.entries.MVCCEntry
at
org.infinispan.commands.write.PutKeyValueCommand.perform(PutKeyValueCommand.java:98)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.interceptors.CallInterceptor.handleDefault(CallInterceptor.java:125)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:43)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:78)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.interceptors.distribution.BaseDistributionInterceptor.handleNonTxWriteCommand(BaseDistributionInterceptor.java:285)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.interceptors.distribution.NonTxDistributionInterceptor.visitPutKeyValueCommand(NonTxDistributionInterceptor.java:107)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:78)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.interceptors.EntryWrappingInterceptor.invokeNextAndApplyChanges(EntryWrappingInterceptor.java:496)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.interceptors.EntryWrappingInterceptor.setSkipRemoteGetsAndInvokeNextForDataCommand(EntryWrappingInterceptor.java:561)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.interceptors.EntryWrappingInterceptor.visitPutKeyValueCommand(EntryWrappingInterceptor.java:199)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:78)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.query.backend.QueryInterceptor.visitPutKeyValueCommand(QueryInterceptor.java:151)
~[classes/:?]
at
org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:78)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitNonTxDataWriteCommand(AbstractLockingInterceptor.java:94)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.interceptors.locking.NonTransactionalLockingInterceptor.visitDataWriteCommand(NonTransactionalLockingInterceptor.java:41)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitPutKeyValueCommand(AbstractLockingInterceptor.java:63)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:78)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.statetransfer.StateTransferInterceptor.handleNonTxWriteCommand(StateTransferInterceptor.java:343)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.statetransfer.StateTransferInterceptor.handleWriteCommand(StateTransferInterceptor.java:281)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.statetransfer.StateTransferInterceptor.visitPutKeyValueCommand(StateTransferInterceptor.java:107)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:78)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.interceptors.CacheMgmtInterceptor.updateStoreStatistics(CacheMgmtInterceptor.java:191)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.interceptors.CacheMgmtInterceptor.visitPutKeyValueCommand(CacheMgmtInterceptor.java:177)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:78)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:110)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:79)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:43)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:78)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:113)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:43)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:78)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:335)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.commands.remote.BaseRpcInvokingCommand.processVisitableCommand(BaseRpcInvokingCommand.java:43)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.commands.remote.SingleRpcCommand.perform(SingleRpcCommand.java:51)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.remoting.inboundhandler.BasePerCacheInboundInvocationHandler.invokePerform(BasePerCacheInboundInvocationHandler.java:92)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
at
org.infinispan.remoting.inboundhandler.BaseBlockingRunnable.run(BaseBlockingRunnable.java:34)
~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
... 3 more
{code}
The test is essentially composed of 3 indexed caches, 2 threads doing PUT picking a
random cache on each write
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)