Details
Description
A spinoff from LUCENE-8381. If a soft-deletes docvalues was applied to PendingSoftDeletes already, newDelCount should be less than the softDelCount recorded in SegmentInfo. The attached test trips an assertion in PendingSoftDeletes. I think we need to relax that assertion.
java.lang.AssertionError: softDeleteCount doesn't match 1 != 0 at __randomizedtesting.SeedInfo.seed([BAC2AFC59AFF8806:167825A6261D33F0]:0) at org.apache.lucene.index.PendingSoftDeletes.onNewReader(PendingSoftDeletes.java:87) at org.apache.lucene.index.ReadersAndUpdates.createNewReaderWithLatestLiveDocs(ReadersAndUpdates.java:651) at org.apache.lucene.index.ReadersAndUpdates.swapNewReaderWithLatestLiveDocs(ReadersAndUpdates.java:663) at org.apache.lucene.index.ReadersAndUpdates.writeFieldUpdates(ReadersAndUpdates.java:619) at org.apache.lucene.index.ReaderPool.writeAllDocValuesUpdates(ReaderPool.java:228) at org.apache.lucene.index.IndexWriter.writeReaderPool(IndexWriter.java:3313) at org.apache.lucene.index.IndexWriter.getReader(IndexWriter.java:517) at org.apache.lucene.index.StandardDirectoryReader.doOpenFromWriter(StandardDirectoryReader.java:288) at org.apache.lucene.index.StandardDirectoryReader.doOpenIfChanged(StandardDirectoryReader.java:263) at org.apache.lucene.index.StandardDirectoryReader.doOpenIfChanged(StandardDirectoryReader.java:253) at org.apache.lucene.index.DirectoryReader.openIfChanged(DirectoryReader.java:140) at org.apache.lucene.search.SearcherManager.refreshIfNeeded(SearcherManager.java:156) at org.apache.lucene.search.SearcherManager.refreshIfNeeded(SearcherManager.java:58) at org.apache.lucene.search.ReferenceManager.doMaybeRefresh(ReferenceManager.java:176) at org.apache.lucene.search.ReferenceManager.maybeRefreshBlocking(ReferenceManager.java:253) at org.apache.lucene.index.TestSoftDeletesRetentionMergePolicy.testSoftDeleteWithTryUpdateDocValue(TestSoftDeletesRetentionMergePolicy.java:586)