You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ji...@apache.org on 2019/03/14 13:00:25 UTC

[lucene-solr] branch master updated: Add 8.0.0 back compat test indexes and reenable backward compatibility tests for 9

This is an automated email from the ASF dual-hosted git repository.

jimczi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/master by this push:
     new 2afa6cb  Add 8.0.0 back compat test indexes and reenable backward compatibility tests for 9
2afa6cb is described below

commit 2afa6cb00a2933a15e65d714b3c564c314059466
Author: jimczi <ji...@apache.org>
AuthorDate: Thu Mar 14 14:00:13 2019 +0100

    Add 8.0.0 back compat test indexes and reenable backward compatibility tests for 9
---
 .../lucene/index/TestBackwardsCompatibility.java   |  43 +++------------------
 .../org/apache/lucene/index/dvupdates.8.0.0.zip    | Bin 0 -> 13396 bytes
 .../test/org/apache/lucene/index/empty.8.0.0.zip   | Bin 0 -> 376 bytes
 .../org/apache/lucene/index/index.8.0.0-cfs.zip    | Bin 0 -> 15594 bytes
 .../org/apache/lucene/index/index.8.0.0-nocfs.zip  | Bin 0 -> 15593 bytes
 .../org/apache/lucene/index/moreterms.8.0.0.zip    | Bin 0 -> 82427 bytes
 .../test/org/apache/lucene/index/sorted.8.0.0.zip  | Bin 0 -> 133026 bytes
 7 files changed, 6 insertions(+), 37 deletions(-)

diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java b/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
index a7cbdf7..d208e4c 100644
--- a/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
+++ b/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
@@ -287,7 +287,8 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
   }
 
   final static String[] oldNames = {
-
+    "8.0.0-cfs",
+    "8.0.0-nocfs"
   };
 
   public static String[] getOldNames() {
@@ -295,7 +296,7 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
   }
   
   final static String[] oldSortedNames = {
-
+    "sorted.8.0.0"
   };
 
   public static String[] getOldSortedNames() {
@@ -352,6 +353,7 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
       "3.6.2-cfs",
       "3.6.2-nocfs",
       "4.0.0-cfs",
+      "4.0.0-cfs",
       "4.0.0-nocfs",
       "4.0.0.1-cfs",
       "4.0.0.1-nocfs",
@@ -819,7 +821,7 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
         Directory targetDir2 = newDirectory();
         IndexWriter w = new IndexWriter(targetDir2, newIndexWriterConfig(new MockAnalyzer(random())));
         IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> TestUtil.addIndexesSlowly(w, reader));
-        assertEquals(e.getMessage(), "Cannot merge a segment that has been created with major version 7 into this index which has been created by major version 8");
+        assertEquals(e.getMessage(), "Cannot merge a segment that has been created with major version 8 into this index which has been created by major version 9");
         w.close();
         targetDir2.close();
 
@@ -1503,14 +1505,13 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
   public static final String emptyIndex = "empty.8.0.0.zip";
 
   public void testUpgradeEmptyOldIndex() throws Exception {
-    assumeTrue("Reenable when 8.0 is released", false);
     Path oldIndexDir = createTempDir("emptyIndex");
     TestUtil.unzip(getDataInputStream(emptyIndex), oldIndexDir);
     Directory dir = newFSDirectory(oldIndexDir);
 
     newIndexUpgrader(dir).upgrade();
 
-    checkAllSegmentsUpgraded(dir, 7);
+    checkAllSegmentsUpgraded(dir, 8);
     
     dir.close();
   }
@@ -1518,7 +1519,6 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
   public static final String moreTermsIndex = "moreterms.8.0.0.zip";
 
   public void testMoreTerms() throws Exception {
-    assumeTrue("Reenable when 8.0 is released", false);
     Path oldIndexDir = createTempDir("moreterms");
     TestUtil.unzip(getDataInputStream(moreTermsIndex), oldIndexDir);
     Directory dir = newFSDirectory(oldIndexDir);
@@ -1563,7 +1563,6 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
   }
 
   public void testDocValuesUpdates() throws Exception {
-    assumeTrue("Reenable when 8.0 is released", false);
     Path oldIndexDir = createTempDir("dvupdates");
     TestUtil.unzip(getDataInputStream(dvUpdatesIndex), oldIndexDir);
     Directory dir = newFSDirectory(oldIndexDir);
@@ -1592,7 +1591,6 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
   }
 
   public void testSoftDeletes() throws Exception {
-    assumeTrue("Reenable when 8.0 is released", false);
     Path oldIndexDir = createTempDir("dvupdates");
     TestUtil.unzip(getDataInputStream(dvUpdatesIndex), oldIndexDir);
     Directory dir = newFSDirectory(oldIndexDir);
@@ -1613,7 +1611,6 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
   }
 
   public void testDocValuesUpdatesWithNewField() throws Exception {
-    assumeTrue("Reenable when 8.0 is released", false);
     Path oldIndexDir = createTempDir("dvupdates");
     TestUtil.unzip(getDataInputStream(dvUpdatesIndex), oldIndexDir);
     Directory dir = newFSDirectory(oldIndexDir);
@@ -1722,34 +1719,6 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
     }
   }
 
-  /**
-   * Tests that {@link CheckIndex} can detect invalid sort on sorted indices created
-   * before https://issues.apache.org/jira/browse/LUCENE-8592.
-   */
-  public void testSortedIndexWithInvalidSort() throws Exception {
-    assumeTrue("Reenable when 8.0 is released", false);
-    Path path = createTempDir("sorted");
-    String name = "sorted-invalid.8.0.0.zip";
-    InputStream resource = TestBackwardsCompatibility.class.getResourceAsStream(name);
-    assertNotNull("Sorted index index " + name + " not found", resource);
-    TestUtil.unzip(resource, path);
-
-    Directory dir = FSDirectory.open(path);
-
-    DirectoryReader reader = DirectoryReader.open(dir);
-    assertEquals(1, reader.leaves().size());
-    Sort sort = reader.leaves().get(0).reader().getMetaData().getSort();
-    assertNotNull(sort);
-    assertEquals("<long: \"dateDV\">! missingValue=-9223372036854775808", sort.toString());
-    reader.close();
-    CheckIndex.Status status = TestUtil.checkIndex(dir);
-    assertEquals(1, status.segmentInfos.size());
-    assertNotNull(status.segmentInfos.get(0).indexSortStatus.error);
-    assertEquals(status.segmentInfos.get(0).indexSortStatus.error.getMessage(),
-        "segment has indexSort=<long: \"dateDV\">! missingValue=-9223372036854775808 but docID=4 sorts after docID=5");
-    dir.close();
-  }
-  
   static long getValue(BinaryDocValues bdv) throws IOException {
     BytesRef term = bdv.binaryValue();
     int idx = term.offset;
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/dvupdates.8.0.0.zip b/lucene/backward-codecs/src/test/org/apache/lucene/index/dvupdates.8.0.0.zip
new file mode 100644
index 0000000..38c5428
Binary files /dev/null and b/lucene/backward-codecs/src/test/org/apache/lucene/index/dvupdates.8.0.0.zip differ
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/empty.8.0.0.zip b/lucene/backward-codecs/src/test/org/apache/lucene/index/empty.8.0.0.zip
new file mode 100644
index 0000000..91a9e92
Binary files /dev/null and b/lucene/backward-codecs/src/test/org/apache/lucene/index/empty.8.0.0.zip differ
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/index.8.0.0-cfs.zip b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.8.0.0-cfs.zip
new file mode 100644
index 0000000..c96c1ae
Binary files /dev/null and b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.8.0.0-cfs.zip differ
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/index.8.0.0-nocfs.zip b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.8.0.0-nocfs.zip
new file mode 100644
index 0000000..b574486
Binary files /dev/null and b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.8.0.0-nocfs.zip differ
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/moreterms.8.0.0.zip b/lucene/backward-codecs/src/test/org/apache/lucene/index/moreterms.8.0.0.zip
new file mode 100644
index 0000000..82b0f14
Binary files /dev/null and b/lucene/backward-codecs/src/test/org/apache/lucene/index/moreterms.8.0.0.zip differ
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/sorted.8.0.0.zip b/lucene/backward-codecs/src/test/org/apache/lucene/index/sorted.8.0.0.zip
new file mode 100644
index 0000000..8fd974d
Binary files /dev/null and b/lucene/backward-codecs/src/test/org/apache/lucene/index/sorted.8.0.0.zip differ