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 2026/10/07 09:32:47 UTC
Re: [PR] Map vectors again for every merge, keeping the caller's hints [lucene]
ChrisHegarty commented on code in PR #16769:
URL: https://github.com/apache/lucene/pull/16769#discussion_r4205296782
##########
lucene/core/src/java/org/apache/lucene/codecs/lucene99/Lucene99FlatVectorsReader.java:
##########
@@ -218,42 +224,55 @@ public FlatVectorsReader getMergeInstance() throws IOException {
return mergeInstance;
} finally {
if (success == false) {
- original.releaseMergeVectorData();
+ original.release();
}
}
}
+ /**
+ * Whether a merge has to map the file again: only when searches read it at random. Otherwise the
+ * mapping searches use carries no advice a merge reading front to back would suffer from, and a
+ * reader a merge opened already reads the file the way a merge does.
+ */
+ private boolean mergeNeedsItsOwnMapping() {
+ return dataContext.context() != IOContext.Context.MERGE
+ && dataContext.hints().contains(DataAccessHint.RANDOM);
Review Comment:
The merge no longer always gets the sequential read-ahead and no-reuse benefits that #16749 added. But that should be fine - the point of this change. Should we clarify that in the changelog entry for #16749
--
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