Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug that can cause get_docids_for_value_range to panic. #2295

Merged
merged 2 commits into from
Jan 9, 2024

Conversation

fulmicoton
Copy link
Collaborator

@fulmicoton fulmicoton commented Jan 9, 2024

When selected_docid_range.end == num_rows, we would get a panic as we try to access a non-existing blockmeta.

This PR accepts calls to rank with any value.
For any value above num_rows we simply return non_null_rows.

Fixes #2293

@fulmicoton fulmicoton requested a review from PSeitz January 9, 2024 10:16
@fulmicoton fulmicoton force-pushed the bugfix-rank-allowed-for-any-rows branch from f488112 to 2579dc6 Compare January 9, 2024 10:17
@PSeitz PSeitz marked this pull request as ready for review January 9, 2024 11:14
fulmicoton and others added 2 commits January 9, 2024 21:25
When `selected_docid_range.end == num_rows`, we would get a panic
as we try to access a non-existing blockmeta.

This PR accepts calls to rank with any value.
For any value above num_rows we simply return non_null_rows.

Fixes #2293
@PSeitz PSeitz force-pushed the bugfix-rank-allowed-for-any-rows branch from 8ba5068 to ba5030e Compare January 9, 2024 13:26
@PSeitz PSeitz merged commit 014328e into main Jan 9, 2024
4 checks passed
@PSeitz PSeitz deleted the bugfix-rank-allowed-for-any-rows branch January 9, 2024 13:52
@williamho
Copy link

thanks for the quick fix! I can confirm that I'm not seeing the panic anymore after this change.

PSeitz added a commit that referenced this pull request Apr 10, 2024
* Fix bug that can cause `get_docids_for_value_range` to panic.

When `selected_docid_range.end == num_rows`, we would get a panic
as we try to access a non-existing blockmeta.

This PR accepts calls to rank with any value.
For any value above num_rows we simply return non_null_rows.

Fixes #2293

* add tests, merge variables

---------

Co-authored-by: Pascal Seitz <pascal.seitz@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Range query for optional fast field panics with Index out of bounds in 0.21.1
3 participants