lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r898469 - /lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java
Date Tue, 12 Jan 2010 19:09:13 GMT
Author: mikemccand
Date: Tue Jan 12 19:09:13 2010
New Revision: 898469

URL: http://svn.apache.org/viewvc?rev=898469&view=rev
Log:
throw CorruptIndexException when deleted docs bit vector size does not match segment info
size

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java?rev=898469&r1=898468&r2=898469&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java Tue Jan 12 19:09:13
2010
@@ -610,6 +610,9 @@
       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;
   }



Mime
View raw message