You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "tlrx (via GitHub)" <gi...@apache.org> on 2026/06/16 12:20:52 UTC

[PR] Check if merge is aborted before executing file integrity checks [lucene]

tlrx opened a new pull request, #16264:
URL: https://github.com/apache/lucene/pull/16264

   This pull request adds `OneMerge` to the `MergeState` so that merge writers and consumers can check the abort flag before starting each reader's checkIntegrity(). This avoids kicking off costly full-file checksums on segments when the merge has already been aborted.
   
   Relates #16086


-- 
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] Check if merge is aborted before executing file integrity checks [lucene]

Posted by "romseygeek (via GitHub)" <gi...@apache.org>.
romseygeek merged PR #16264:
URL: https://github.com/apache/lucene/pull/16264


-- 
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] Check if merge is aborted before executing file integrity checks [lucene]

Posted by "tlrx (via GitHub)" <gi...@apache.org>.
tlrx commented on code in PR #16264:
URL: https://github.com/apache/lucene/pull/16264#discussion_r3426304453


##########
lucene/core/src/java/org/apache/lucene/index/MergeState.java:
##########
@@ -91,14 +91,22 @@ public class MergeState {
   /** Indicates if the index needs to be sorted * */
   public boolean needsIndexSort;
 
+  /**
+   * The merge that this state is associated with, or {@code null} if this merge state is not
+   * associated with an {@link IndexWriter} merge (e.g. for addIndexes).
+   */
+  public final MergePolicy.OneMerge oneMerge;

Review Comment:
   Thanks, that's a valid point.
   
   I added the `@lucene.internal` annotation in db5d68462ecc831cf3102e4f3a8691d407026618 since `org.apache.lucene.codecs.perfield.PerFieldMergeState` sits in a different package and requires `oneMerge` to be public in order to propagate it when creating a restricted `MergeState`.



-- 
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] Check if merge is aborted before executing file integrity checks [lucene]

Posted by "iprithv (via GitHub)" <gi...@apache.org>.
iprithv commented on code in PR #16264:
URL: https://github.com/apache/lucene/pull/16264#discussion_r3422687506


##########
lucene/core/src/java/org/apache/lucene/index/MergeState.java:
##########
@@ -91,14 +91,22 @@ public class MergeState {
   /** Indicates if the index needs to be sorted * */
   public boolean needsIndexSort;
 
+  /**
+   * The merge that this state is associated with, or {@code null} if this merge state is not
+   * associated with an {@link IndexWriter} merge (e.g. for addIndexes).
+   */
+  public final MergePolicy.OneMerge oneMerge;

Review Comment:
   oneMerge is public, do we really want to expose the raw OneMerge on MergeState's public API? checkAborted() method is all the codecs need, and that's already public..making the field package-private (or at least @lucene.internal) would avoid leaking merge internals to custom codec implementations!
   
   



-- 
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] Check if merge is aborted before executing file integrity checks [lucene]

Posted by "tlrx (via GitHub)" <gi...@apache.org>.
tlrx commented on PR #16264:
URL: https://github.com/apache/lucene/pull/16264#issuecomment-4749366895

   Thanks for the review @romseygeek ! I pushed 4ee6459c213aa3188b6a070196bb836191f747a0 for the change log.


-- 
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