Updated MMapDirectory to use ReadAdviseByContext rather than default readadvise of Lucene#21031
Conversation
|
Failed to generate code suggestions for PR |
|
❌ Gradle check result for c750f0c: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
Failed to generate code suggestions for PR |
|
❌ Gradle check result for 7b79e38: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #21031 +/- ##
============================================
- Coverage 73.24% 73.16% -0.09%
+ Complexity 72811 72761 -50
============================================
Files 5871 5871
Lines 332666 332669 +3
Branches 48014 48014
============================================
- Hits 243660 243381 -279
- Misses 69451 69802 +351
+ Partials 19555 19486 -69 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Failed to generate code suggestions for PR |
andrross
left a comment
There was a problem hiding this comment.
This looks reasonable, but are we concerned at all about potential regressions with using MADV_RANDOM for certain files if MGLRU is enabled? That was the whole reason Lucene reverted its change to the default behavior.
server/src/test/java/org/opensearch/index/store/FsDirectoryFactoryTests.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/opensearch/index/store/FsDirectoryFactoryTests.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/opensearch/index/store/FsDirectoryFactoryTests.java
Show resolved
Hide resolved
By not having this change, we are seeing the regression during search. One thing I can think of here is, if MGLRU is enabled on the Kernel we fallback to NORMAL readadvise, otherwise we can use ADVISE by CONTEXT. @andrross WDYT? |
@navneet1v I honestly don't know. Do we have benchmarks that can tell us the optimal configuration with and without MGLRU? |
@andrross in 2.19 version of OpenSearch we are using Advise by Context. This change is just making those things exactly same. Plus the regression which was observed in Elastic was during merge and during merge we are already making the read advise sequential |
PR Reviewer Guide 🔍(Review updated until commit fb56484)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to fb56484 Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit 5236a7b
Suggestions up to commit d8edef0
|
|
❌ Gradle check result for d8edef0: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
server/src/test/java/org/opensearch/index/store/FsDirectoryFactoryTests.java
Outdated
Show resolved
Hide resolved
|
Persistent review updated to latest commit 5236a7b |
…readadvise of Lucene Signed-off-by: Navneet Verma <navneev@amazon.com>
|
Persistent review updated to latest commit fb56484 |
|
@andrross can we trigger a benchmark run on this PR. In the meanwhile I doing more deep-dive on the issue provided by Lucene to see where and how ES faced issues. Because based on my deep-dive we change the IOContext during merge from RANDOM to SEQUENTIAL so we should face this issue in vectors. |
|
@andrross here is what I am able to trace out. The issue that happened in Elastic Search was with Lucene version 9.12, with Kernel enabled MGLRU. Elastic was always using Random Read advise for their vector files. Ref: elastic/elasticsearch#124499 But with OpenSearch we should not face this issue because:
I can try reproducing the same setup with OpenSearch 2.19(using Lucene 9.12) and OpenSearch 3.x where we override the read advice to showcase that we will not see regression when MGLRU is enabled, is the above pointers not enough. Please let me know your thoughts. |
There was a problem hiding this comment.
Looks good.
Curious where's the search regression coming from?
Is it somewhere you define IOContext with DataAccessHint.RANDOM, but without this change it got ignored?
Also I notice this comment in Lucene saying random hint works badly for vector search. Are you observing contrasting behavior?
Yes, so vectors are stored in |
Description
Updated MMapDirectory to use ReadAdviseByContext rather than default readadvise of Lucene.
More details can be found here: #21012
Related Issues
Resolves #21012
Check List
API changes companion pull request created, if applicable.Public documentation issue/PR created, if applicable.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.