ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Medvedev (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (IGNITE-9235) Transitivity violation in GridMergeIndex Comparator
Date Wed, 08 Aug 2018 21:47:00 GMT

     [ https://issues.apache.org/jira/browse/IGNITE-9235?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andrew Medvedev reassigned IGNITE-9235:
---------------------------------------

    Assignee: Andrew Medvedev

> Transitivity violation in GridMergeIndex Comparator
> ---------------------------------------------------
>
>                 Key: IGNITE-9235
>                 URL: https://issues.apache.org/jira/browse/IGNITE-9235
>             Project: Ignite
>          Issue Type: Bug
>    Affects Versions: 2.5
>            Reporter: Andrew Medvedev
>            Assignee: Andrew Medvedev
>            Priority: Major
>
> Currently comparator in org.apache.ignite.internal.processors.query.h2.twostep.GridMergeIndex
is:
>  
> Private final Comparator<RowStream> streamCmp = new Comparator<RowStream>()
{
>  @Override public int compare(RowStream o1, RowStream o2) {
>  // Nulls at the beginning.
>  if (o1 == null)
>  return -1;
>  if (o2 == null)
>  return 1;
>  return compareRows(o1.get(), o2.get());
>  }
> };
> --
>  
> This comparator violates transitivity when o1 and o2 are null. Thus we get exception
in JDK1.8:
>  
>  
> {color:#d04437}Caused by: java.lang.IllegalArgumentException: Comparison method violates
its general contract!{color}
> {color:#d04437}  at java.util.TimSort.mergeHi(TimSort.java:899){color}
> {color:#d04437}  at java.util.TimSort.mergeAt(TimSort.java:516){color}
> {color:#d04437}  at java.util.TimSort.mergeCollapse(TimSort.java:441){color}
> {color:#d04437}  at java.util.TimSort.sort(TimSort.java:245){color}
> {color:#d04437}  at java.util.Arrays.sort(Arrays.java:1438){color}
> {color:#d04437}  at org.apache.ignite.internal.processors.query.h2.twostep.GridMergeIndexSorted$MergeStreamIterator.goFirst(GridMergeIndexSorted.java:248){color}
> {color:#d04437}  at org.apache.ignite.internal.processors.query.h2.twostep.GridMergeIndexSorted$MergeStreamIterator.hasNext(GridMergeIndexSorted.java:270){color}
> {color:#d04437}  at org.apache.ignite.internal.processors.query.h2.twostep.GridMergeIndex$FetchingCursor.fetchRows(GridMergeIndex.java:614){color}
> {color:#d04437}  at org.apache.ignite.internal.processors.query.h2.twostep.GridMergeIndex$FetchingCursor.next(GridMergeIndex.java:658){color}
> {color:#d04437}  at org.h2.index.IndexCursor.next(IndexCursor.java:305){color}
> {color:#d04437}  at org.h2.table.TableFilter.next(TableFilter.java:499){color}
> {color:#d04437}  at org.h2.command.dml.Select$LazyResultQueryFlat.fetchNextRow(Select.java:1452){color}
> {color:#d04437}  at org.h2.result.LazyResult.hasNext(LazyResult.java:79){color}
> {color:#d04437}  at org.h2.result.LazyResult.next(LazyResult.java:59){color}
> {color:#d04437}  at org.h2.command.dml.Select.queryFlat(Select.java:519){color}
> {color:#d04437}  at org.h2.command.dml.Select.queryWithoutCache(Select.java:625){color}
> {color:#d04437}  at org.h2.command.dml.Query.queryWithoutCacheLazyCheck(Query.java:114){color}
> {color:#d04437}  at org.h2.command.dml.Query.query(Query.java:352){color}
> {color:#d04437}  at org.h2.command.dml.Query.query(Query.java:333){color}
> {color:#d04437}  at org.h2.command.CommandContainer.query(CommandContainer.java:113){color}
> {color:#d04437}  at org.h2.command.Command.executeQuery(Command.java:201){color}
> {color:#d04437} ... 44 more{color}
>   
> WA: use -Djava.util.Arrays.useLegacyMergeSort=true
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message