throw CorruptIndexException when deleted docs bit vector size does not match segment info size

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@898469 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2010-01-12 19:09:13 +00:00
parent 260d294111
commit aba4c8bed4
1 changed files with 3 additions and 0 deletions

View File

@ -610,6 +610,9 @@ public class SegmentReader extends IndexReader implements Cloneable {
deletedDocs = new BitVector(directory(), si.getDelFileName());
deletedDocsRef = new AtomicInteger(1);
assert checkDeletedCounts();
if (deletedDocs.size() != si.docCount) {
throw new CorruptIndexException("document count mismatch: deleted docs count " + deletedDocs.size() + " vs segment doc count " + si.docCount);
}
} else
assert si.getDelCount() == 0;
}