iamorchid opened a new issue, #11751:
URL: https://github.com/apache/lucene/issues/11751

   
https://github.com/apache/lucene/blob/84cae4f27cfd3feb3bb42d5a9f7ce034f7a31573/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java#L5075
   
   For merge, I see that the following logic are used to initialize 
SegmentReader for the merge. Though segments covered in a merge won't be 
deleted in other concurrent merges, DV updates files could still be overridden 
by other concurrent flush and then be deleted after the flush performs 
IndexFileDeleter#checkpoint(). Though for systems like linux, this won't be a 
big issue (as an opened file could still be read in process even if it's been 
deleted). However, for windows, the delete operation would be rejected if the 
file is still open. So I think a more sensible way is increase the refcount in 
IndexFileDeleter for the files reference by the merge.
   ```
         merge.initMergeReaders(
             sci -> {
               final ReadersAndUpdates rld = getPooledInstance(sci, true);
               rld.setIsMerging();
               return rld.getReaderForMerge(context);
             });
   ```


-- 
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-unsubscr...@lucene.apache.org.apache.org

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