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

Julie Tibshirani updated LUCENE-9501:
-------------------------------------
    Description: 
In LUCENE-7714 we added a new query to sandbox called 
IndexSortSortedNumericDocValuesRangeQuery that optimizes range calculations 
when the field is sorted. The query has a bad bug: its DocIdSetIterator can 
return an old value for docID() even after advance has returned NO_MORE_DOCS. 
This violates the DocIdSetIterator contract and means that it's possible for 
DocIdSetIterator#advance to be called when it's already been exhausted (which 
can result in invalid reads).

We would have expected this issue to be caught in tests, especially because 
classes like AssertingIndexSearcher check for these invariants. As part of this 
fix I'll look into improvements to the Asserting* wrapper framework.

  was:
In LUCENE-7714 added a new query to sandbox called 
IndexSortSortedNumericDocValuesRangeQuery that optimizes range calculations 
when the field is sorted. The query has a bad bug: its DocIdSetIterator can 
return an old value for docID() even after advance has returned NO_MORE_DOCS. 
This violates the DocIdSetIterator contract and means that it's possible for 
DocIdSetIterator#advance to be called when it's already been exhausted (which 
can result in invalid reads).

We would have expected this issue to be caught in tests, especially because 
classes like AssertingIndexSearcher check for these invariants. As part of this 
fix I'll look into improvements to the Asserting* wrapper framework.


> IndexSortSortedNumericDocValuesRangeQuery violates iterator invariant.
> ----------------------------------------------------------------------
>
>                 Key: LUCENE-9501
>                 URL: https://issues.apache.org/jira/browse/LUCENE-9501
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Julie Tibshirani
>            Priority: Major
>
> In LUCENE-7714 we added a new query to sandbox called 
> IndexSortSortedNumericDocValuesRangeQuery that optimizes range calculations 
> when the field is sorted. The query has a bad bug: its DocIdSetIterator can 
> return an old value for docID() even after advance has returned NO_MORE_DOCS. 
> This violates the DocIdSetIterator contract and means that it's possible for 
> DocIdSetIterator#advance to be called when it's already been exhausted (which 
> can result in invalid reads).
> We would have expected this issue to be caught in tests, especially because 
> classes like AssertingIndexSearcher check for these invariants. As part of 
> this fix I'll look into improvements to the Asserting* wrapper framework.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to