mikemccand commented on pull request #2088: URL: https://github.com/apache/lucene-solr/pull/2088#issuecomment-731222134
> > As long as FieldNumbers.clear() is only called from IndexWriter.deleteAll(), my understanding is that the safety is provided by the try (Closeable finalizer = docWriter.lockAndAbortAll()) { block, which (I think) guarantees that any concurrent indexing is blocked until the lock is released. > > Thanks, maybe there is a way to improve the testing of `deleteAll` to better enforce this? Lucene is not testing this method much, but I know some users (e.g. Solr) are using it often. My concern is some race condition that ultimately creates segments with unaligned field numbers. This would be a disaster and definitely result in corruption (think, stored fields merging etc which copies binary/compressed data directly). Maybe a new unit test that randomly calls `deleteAll()` and other IW APIs across threads? Hmm, actually, it looks like `TestIndexWriter.testThreadInterruptDeadlock` is doing just that already. `TestIndexWriterDelete` tests specific interesting cases. `TestIndexWriterMergePolicy` seems to test the interaction of `deleteAll` and merge-on-commit. ---------------------------------------------------------------- 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