mikemccand commented on PR #13206: URL: https://github.com/apache/lucene/pull/13206#issuecomment-2020444316
> > The bigger problem is when the file is still open in an NRTReader and gets deleted. > > Hmm does it actually happen? I thought index files were ref-counted so that files would only get deleted when the NRT reader gets closed? This is what `StandardDirectoryReader#doClose` suggests. NRT readers pulled from `IndexWriter` indeed do this ref counting so delete is not attempted until all readers still using that segment/file are closed. But in the NRT segment replication case, I think this may still happen? I.e. segments are replicated out to a node that has an open `DirectoryReader`. That reader is refreshed to switch to the new segments, but the old reader is still alive to finish any in-flight queries or stay open for any long-term leases for deep scrolling purposes. Oh, nevermind, even in the NRT segment replication case we have `ReplicaFileDeleter` to do the right ref counting. So yeah I think we don't need to worry about this case either! Phew, complicated. -- 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 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