msfroh commented on a change in pull request #1552:
URL: https://github.com/apache/lucene-solr/pull/1552#discussion_r442326229



##########
File path: lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
##########
@@ -3226,15 +3235,53 @@ private long prepareCommitInternal() throws IOException 
{
               // sneak into the commit point:
               toCommit = segmentInfos.clone();
 
+              if (anyChanges && maxCommitMergeWaitSeconds > 0) {
+                SegmentInfos committingSegmentInfos = toCommit;
+                onCommitMerges = updatePendingMerges(new 
OneMergeWrappingMergePolicy(config.getMergePolicy(), toWrap ->
+                    new MergePolicy.OneMerge(toWrap.segments) {
+                      @Override
+                      public void mergeFinished(boolean committed) throws 
IOException {

Review comment:
       Oh -- I guess one minor complaint about moving this into 
`prepareCommitInternal` is that we won't be able to reuse it (without moving 
it) if we decide to apply the same logic to `IndexWriter.getReader()`.
   
   That said, moving it if/when someone gets around to applying the logic there 
isn't a big deal. (I think the real work there is reconciling logic from 
StandardDirectoryReader.open() with logic in 
IndexWriter.prepareCommitInternal(), since the functionality is kind of 
duplicated.)




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to