You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "ChrisHegarty (via GitHub)" <gi...@apache.org> on 2025/08/08 10:57:08 UTC
[PR] Change default ReadAdvice from RANDOM to NORMAL [lucene]
ChrisHegarty opened a new pull request, #15040:
URL: https://github.com/apache/lucene/pull/15040
This commit changes the default ReadAdvice from RANDOM to NORMAL.
After this change MMapDirectory will not set any specific read advice out-of-the-box. Rather there is a straightforward way to enable either previous behaviour ( in 10.2 ), by setting either:
1. `dir.setReadAdvice(MMapDirectory.ADVISE_BY_CONTEXT)`, or
2. setting the system property `-Dorg.apache.lucene.store.defaultReadAdvice=RANDOM`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] Change default ReadAdvice from RANDOM to NORMAL [lucene]
Posted by "thecoop (via GitHub)" <gi...@apache.org>.
thecoop commented on code in PR #15040:
URL: https://github.com/apache/lucene/pull/15040#discussion_r2263129530
##########
lucene/core/src/test/org/apache/lucene/store/TestMMapDirectory.java:
##########
@@ -131,6 +132,57 @@ public void testWithNormal() throws Exception {
}
}
+ public void testAdviseByContextFunc() throws IOException {
+ var func = MMapDirectory.ADVISE_BY_CONTEXT;
+ var flush = IOContext.flush(new FlushInfo(1, 2));
+ var merge = IOContext.merge(new MergeInfo(1, 2, true, 4));
+ var random = new DefaultIOContext(DataAccessHint.RANDOM);
Review Comment:
Can we iterate over the various hint type arrays rather than hard-coding so this doesn't need to be modified if more are added?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] Change default ReadAdvice from RANDOM to NORMAL [lucene]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #15040:
URL: https://github.com/apache/lucene/pull/15040#issuecomment-3167479579
This PR does not have an entry in lucene/CHANGES.txt. Consider adding one. If the PR doesn't need a changelog entry, then add the skip-changelog label to it and you will stop receiving this reminder on future updates to the PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] Change default ReadAdvice from RANDOM to NORMAL [lucene]
Posted by "msokolov (via GitHub)" <gi...@apache.org>.
msokolov commented on PR #15040:
URL: https://github.com/apache/lucene/pull/15040#issuecomment-3167937186
This seems like good progress. I'm also unsure about `Lucene99FlatVectorsReader.finishMerge()` where we call
`this.vectorData.updateReadAdvice(ReadAdvice.RANDOM);` and related code in that class that was added in #13985 -- going back to read that now
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] Change default ReadAdvice from RANDOM to NORMAL [lucene]
Posted by "ChrisHegarty (via GitHub)" <gi...@apache.org>.
ChrisHegarty commented on code in PR #15040:
URL: https://github.com/apache/lucene/pull/15040#discussion_r2263191215
##########
lucene/core/src/test/org/apache/lucene/store/TestMMapDirectory.java:
##########
@@ -131,6 +132,57 @@ public void testWithNormal() throws Exception {
}
}
+ public void testAdviseByContextFunc() throws IOException {
+ var func = MMapDirectory.ADVISE_BY_CONTEXT;
+ var flush = IOContext.flush(new FlushInfo(1, 2));
+ var merge = IOContext.merge(new MergeInfo(1, 2, true, 4));
+ var random = new DefaultIOContext(DataAccessHint.RANDOM);
Review Comment:
Good idea. Done. 5cfe3fe
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] Change default ReadAdvice from RANDOM to NORMAL [lucene]
Posted by "ChrisHegarty (via GitHub)" <gi...@apache.org>.
ChrisHegarty merged PR #15040:
URL: https://github.com/apache/lucene/pull/15040
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] Change default ReadAdvice from RANDOM to NORMAL [lucene]
Posted by "msokolov (via GitHub)" <gi...@apache.org>.
msokolov commented on PR #15040:
URL: https://github.com/apache/lucene/pull/15040#issuecomment-3167973800
Yeah, I worry that this now conflicts with what we did in the vectors reader, since the default will be normal, but after merging any vectors segments we will switch back to random?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] Change default ReadAdvice from RANDOM to NORMAL [lucene]
Posted by "ChrisHegarty (via GitHub)" <gi...@apache.org>.
ChrisHegarty commented on PR #15040:
URL: https://github.com/apache/lucene/pull/15040#issuecomment-3168057096
@msokolov I agree - there is more needed here. Let's get #14844 in first, then we can revaluate if/how to do this properly in this PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org