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

[BUG] Time Series Desc Optimisation gets skipped with Lucene 10 Upgrade #17386

Open
expani opened this issue Feb 18, 2025 · 0 comments
Open

[BUG] Time Series Desc Optimisation gets skipped with Lucene 10 Upgrade #17386

expani opened this issue Feb 18, 2025 · 0 comments
Assignees
Labels
bug Something isn't working Search:Performance

Comments

@expani
Copy link
Contributor

expani commented Feb 18, 2025

Describe the bug

Description

We override IndexSearcher#search(List<LeafReaderContext> leaves, Weight weight, Collector collector) and it contains the logic to apply time series desc optimisation for scanning segments in reverse for descending sort use-cases.

Existing Lucene 9.12.1 and OS 2.19 call flow

Screenshot 2025-02-11 at 2 40 05 PM

Lucene 10.1.0 and OS 3.0 call flow

Screenshot 2025-02-11 at 2 40 52 PM

With Lucene 10 changes, the new replacement method

search(LeafReaderContextPartition[] partitions, Weight weight, Collector collector)

only gets invoked via IndexSearcher#search(Query, CollecterManager) which is not used by OpenSearch in QueryPhase#searchWithCollector.

So, it was never getting called causing the time series desc optimization to be skipped.

My changes ensure it will be called in the same way that IndexSearcher does for CollectorManager variant.

Related Issues

PR for the fix #17329

Related component

Search:Performance

To Reproduce

Execute asc_sort_timestamp and compare the latency it will be slower with OS 3.0 compared to OS 2.19

Expected behavior

Time Series Desc Optimisation should be invoked for sort queries.

Additional Details

Meta

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Search:Performance
Projects
Status: 🆕 New
Development

No branches or pull requests

2 participants