You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The assertion logic in LongHashSet.java assumes signed long values, which leads to incorrect validation when dealing with unsigned long values. The sorted order check fails because value >= previousValue does not correctly handle unsigned comparisons.
We get - [Please check Additional Details below for Stack trace]
» fatal error in thread [opensearch[runTask-0][search][T#1]], exiting
» java.lang.AssertionError: values must be provided in sorted order
FAILURE: Build failed with an exception.
Expected behavior
In the normal flow, the query should correctly apply Terms aggregations without assertion errors.
Additional Details
Stack Trace
» java.lang.AssertionError: values must be provided in sorted order
» at org.apache.lucene.util.LongHashSet.assertBasedOnDataType(LongHashSet.java:68)
» at org.apache.lucene.util.LongHashSet.<init>(LongHashSet.java:55)
» at org.opensearch.index.document.SortedUnsignedLongDocValuesSetQuery.<init>(SortedUnsignedLongDocValuesSetQuery.java:48)
» at org.opensearch.index.document.SortedUnsignedLongDocValuesSetQuery$2.<init>(SortedUnsignedLongDocValuesSetQuery.java:150)
» at org.opensearch.index.document.SortedUnsignedLongDocValuesSetQuery.newSlowSetQuery(SortedUnsignedLongDocValuesSetQuery.java:150)
» at org.opensearch.index.mapper.NumberFieldMapper$NumberType$8.termsQuery(NumberFieldMapper.java:1168)
» at org.opensearch.index.mapper.NumberFieldMapper$NumberFieldType.termsQuery(NumberFieldMapper.java:1577)
» at org.opensearch.index.query.TermsQueryBuilder.doToQuery(TermsQueryBuilder.java:556)
» at org.opensearch.index.query.AbstractQueryBuilder.toQuery(AbstractQueryBuilder.java:117)
» at org.opensearch.index.query.QueryShardContext.lambda$toQuery$3(QueryShardContext.java:575)
» at org.opensearch.index.query.QueryShardContext.toQuery(QueryShardContext.java:587)
» at org.opensearch.index.query.QueryShardContext.toQuery(QueryShardContext.java:574)
» at org.opensearch.search.SearchService.parseSource(SearchService.java:1374)
» at org.opensearch.search.SearchService.createContext(SearchService.java:1110)
» at org.opensearch.search.SearchService.executeQueryPhase(SearchService.java:707)
» at org.opensearch.search.SearchService$2.lambda$onResponse$0(SearchService.java:680)
» at org.opensearch.action.ActionRunnable.lambda$supply$0(ActionRunnable.java:74)
» at org.opensearch.action.ActionRunnable$2.doRun(ActionRunnable.java:89)
» at org.opensearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:52)
» at org.opensearch.threadpool.TaskAwareRunnable.doRun(TaskAwareRunnable.java:78)
» at org.opensearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:52)
» at org.opensearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:59)
» at org.opensearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:994)
» at org.opensearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:52)
» at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
» at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
» at java.base/java.lang.Thread.run(Thread.java:1583)
The text was updated successfully, but these errors were encountered:
Describe the bug
The assertion logic in LongHashSet.java assumes signed long values, which leads to incorrect validation when dealing with unsigned long values. The sorted order check fails because
value >= previousValue
does not correctly handle unsigned comparisons.Related component
Search
To Reproduce
./gradlew run
PUT test_index
POST test_index/_search
Expected behavior
In the normal flow, the query should correctly apply Terms aggregations without assertion errors.
Additional Details
Stack Trace
The text was updated successfully, but these errors were encountered: