[
https://issues.jboss.org/browse/ISPN-1750?page=com.atlassian.jira.plugin....
]
Manik Surtani commented on ISPN-1750:
-------------------------------------
I don't think the bug is in the comparator per-se, but possibly in the TimSort
implementation. For some reason it complains about the compareTo contract not being fully
honoured with the original comparator and not with the patch. I suspect it has to do with
the comparison returning numbers other than just -1, 0 and 1.
Broken key comparator in OptimisticLockingInterceptor
-----------------------------------------------------
Key: ISPN-1750
URL:
https://issues.jboss.org/browse/ISPN-1750
Project: Infinispan
Issue Type: Bug
Components: Core API
Affects Versions: 5.1.0.CR4
Reporter: Nicolas Filotto
Assignee: Manik Surtani
Priority: Blocker
Fix For: 5.1.0.FINAL
Attachments: TestSort.java
With ISPN 5.1.0.CR4, I face exceptions of the following type:
{code}
17.01.2012 11:56:53 *ERROR* [main] InvocationContextInterceptor: ISPN000136: Execution
error (InvocationContextInterceptor.java, line 123)
java.lang.IllegalArgumentException: Comparison method violates its general contract!
at org.infinispan.util.TimSort.mergeHi(TimSort.java:872)
at org.infinispan.util.TimSort.mergeAt(TimSort.java:489)
at org.infinispan.util.TimSort.mergeForceCollapse(TimSort.java:430)
at org.infinispan.util.TimSort.sort(TimSort.java:227)
at org.infinispan.util.TimSort.sort(TimSort.java:177)
at
org.infinispan.interceptors.locking.OptimisticLockingInterceptor.sort(OptimisticLockingInterceptor.java:252)
at
org.infinispan.interceptors.locking.OptimisticLockingInterceptor.visitPrepareCommand(OptimisticLockingInterceptor.java:94)
at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:131)
at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
at
org.infinispan.interceptors.NotificationInterceptor.visitPrepareCommand(NotificationInterceptor.java:58)
at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:131)
at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
at
org.infinispan.interceptors.TxInterceptor.visitPrepareCommand(TxInterceptor.java:106)
at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:131)
at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
at
org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:130)
at
org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:113)
at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:131)
at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
at
org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:116)
at
org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:76)
at
org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:113)
at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:131)
at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:345)
at
org.infinispan.transaction.TransactionCoordinator.prepare(TransactionCoordinator.java:129)
at
org.infinispan.transaction.TransactionCoordinator.prepare(TransactionCoordinator.java:111)
at
org.infinispan.transaction.xa.TransactionXaAdapter.commit(TransactionXaAdapter.java:122)
at
com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord.topLevelOnePhaseCommit(XAResourceRecord.java:811)
at com.arjuna.ats.arjuna.coordinator.BasicAction.onePhaseCommit(BasicAction.java:2656)
at com.arjuna.ats.arjuna.coordinator.BasicAction.End(BasicAction.java:1784)
at
com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:94)
at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:177)
at
com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1423)
at
com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:137)
{code}
After a deeper investigation, it seems to be due to the implementation of
{{keyComparator}} used to sort the keys based on {{MurmurHash3}}. Please find as attached
file a test case that shows the issue.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira