diff --git a/lucene/src/java/org/apache/lucene/index/BufferedDeletes.java b/lucene/src/java/org/apache/lucene/index/BufferedDeletes.java index 6b9ebcfe908..8be325a64a9 100644 --- a/lucene/src/java/org/apache/lucene/index/BufferedDeletes.java +++ b/lucene/src/java/org/apache/lucene/index/BufferedDeletes.java @@ -229,7 +229,9 @@ class BufferedDeletes { if (mergedDeletes == null) { mergedDeletes = getDeletes(segmentInfos.info(firstIdx-1)); numTerms.addAndGet(-mergedDeletes.numTermDeletes.get()); + assert numTerms.get() >= 0; bytesUsed.addAndGet(-mergedDeletes.bytesUsed.get()); + assert bytesUsed.get() >= 0; } mergedDeletes.update(deletes, true);