lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1633835 - in /lucene/dev/branches/lucene_solr_4_10: ./ lucene/ lucene/core/ lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java
Date Thu, 23 Oct 2014 15:10:18 GMT
Author: mikemccand
Date: Thu Oct 23 15:10:18 2014
New Revision: 1633835

URL: http://svn.apache.org/r1633835
Log:
LUCENE-6019: add more safety during DV flush

Modified:
    lucene/dev/branches/lucene_solr_4_10/   (props changed)
    lucene/dev/branches/lucene_solr_4_10/lucene/   (props changed)
    lucene/dev/branches/lucene_solr_4_10/lucene/core/   (props changed)
    lucene/dev/branches/lucene_solr_4_10/lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java

Modified: lucene/dev/branches/lucene_solr_4_10/lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_10/lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java?rev=1633835&r1=1633834&r2=1633835&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_10/lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java
(original)
+++ lucene/dev/branches/lucene_solr_4_10/lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java
Thu Oct 23 15:10:18 2014
@@ -131,6 +131,10 @@ final class DefaultIndexingChain extends
         PerField perField = fieldHash[i];
         while (perField != null) {
           if (perField.docValuesWriter != null) {
+            if (perField.fieldInfo.hasDocValues() == false) {
+              // BUG
+              throw new AssertionError("segment=" + state.segmentInfo + ": field=\"" + perField.fieldInfo.name
+ "\" has no docValues but wrote them");
+            }
             if (dvConsumer == null) {
               // lazy init
               DocValuesFormat fmt = state.segmentInfo.getCodec().docValuesFormat();
@@ -140,6 +144,9 @@ final class DefaultIndexingChain extends
             perField.docValuesWriter.finish(docCount);
             perField.docValuesWriter.flush(state, dvConsumer);
             perField.docValuesWriter = null;
+          } else if (perField.fieldInfo.hasDocValues()) {
+            // BUG
+            throw new AssertionError("segment=" + state.segmentInfo + ": field=\"" + perField.fieldInfo.name
+ "\" has docValues but did not write them");
           }
           perField = perField.next;
         }
@@ -157,6 +164,16 @@ final class DefaultIndexingChain extends
         IOUtils.closeWhileHandlingException(dvConsumer);
       }
     }
+
+    if (state.fieldInfos.hasDocValues() == false) {
+      if (dvConsumer != null) {
+        // BUG
+        throw new AssertionError("segment=" + state.segmentInfo + ": fieldInfos has no docValues
but wrote them");
+      }
+    } else if (dvConsumer == null) {
+      // BUG
+      throw new AssertionError("segment=" + state.segmentInfo + ": fieldInfos has docValues
but did not wrote them");
+    }
   }
 
   /** Catch up for all docs before us that had no stored



Mime
View raw message