guojialiang92 opened a new issue, #13015: URL: https://github.com/apache/lucene/issues/13015
### Description DV update files referenced by merge will be deleted by concurrent flush. For example, according to the following execution sequence, the DV update file referenced by merge will be deleted. 1. `IndexWriter#addDocument` doc1 = {"id": "1", "version": "1"} 2. `IndexWriter#flush`, which will produce segment0 = {_0.cfe, _0.cfs, _0.si} 3. `IndexWriter#addDocument` = {"id": "2", "version": "1"} 4. `IndexWriter#softUpdateDocument` updates doc2 to {"id": "2", "version": "2"} 5. `IndexWriter#flush`, which will produce segment1 = {_1.cfe, _1.cfs, _1.si, _1_1.fnm, _1_1_Lucene80_0.dvd, _1_1_Lucene80_0.dvm} 6. `IndexWriter#forceMerge`, merge segment0 and segment1 into segment2. The merge process will reference segment0 = {_0.cfe, _0.cfs, _0.si} and segment1 = {_1.cfe, _1.cfs, _1.si, _1_1.fnm, _1_1_Lucene80_0.dvd, _1_1_Lucene80_0.dvm} 7. During merge, `IndexWriter#softUpdateDocument` updates doc2 to {"id": "2", "version": "3"} 8. `IndexWriter#flush`,which will produce segment3 = {_3.cfe, _3.cfs, _3.si},and update segment1 to {_1.cfe, _1.cfs, _1.si, _1_2.fnm, _1_2_Lucene80_0.dvd, _1_2_Lucene80_0.dvm} 9. The files = {_1_1.fnm, _1_1_Lucene80_0.dvd, _1_1_Lucene80_0.dvm} referenced by merge is deleted In the Linux environment, an open file is still readable after being deleted, so it does not cause file reading exception. However, in other environment that do not have the above guarantee, an exception will be caused because the file does not exist. Later I will file a PR for this. Add related tests and fix the problem. ### Version and environment details I found the problem in releases/lucene-solr/8.7.0, and confirmed that the problem still exists in main branch. -- 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