You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ho...@apache.org on 2016/12/13 03:45:35 UTC
lucene-solr:jira/solr-5944: SOLR-5944: fix test bug,
RTG against tlog returns -1 for [docid],
so need commits before [docid] assertions,
but we can check (real) field values using RTG first
Repository: lucene-solr
Updated Branches:
refs/heads/jira/solr-5944 020c74eea -> 3f8b7c174
SOLR-5944: fix test bug, RTG against tlog returns -1 for [docid], so need commits before [docid] assertions, but we can check (real) field values using RTG first
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/3f8b7c17
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/3f8b7c17
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/3f8b7c17
Branch: refs/heads/jira/solr-5944
Commit: 3f8b7c174864be4945cb338f34af75dcb61d67ec
Parents: 020c74e
Author: Chris Hostetter <ho...@apache.org>
Authored: Mon Dec 12 20:45:29 2016 -0700
Committer: Chris Hostetter <ho...@apache.org>
Committed: Mon Dec 12 20:45:29 2016 -0700
----------------------------------------------------------------------
.../apache/solr/update/TestInPlaceUpdatesDistrib.java | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/3f8b7c17/solr/core/src/test/org/apache/solr/update/TestInPlaceUpdatesDistrib.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/update/TestInPlaceUpdatesDistrib.java b/solr/core/src/test/org/apache/solr/update/TestInPlaceUpdatesDistrib.java
index 7dd11f4..e8f0e4a 100644
--- a/solr/core/src/test/org/apache/solr/update/TestInPlaceUpdatesDistrib.java
+++ b/solr/core/src/test/org/apache/solr/update/TestInPlaceUpdatesDistrib.java
@@ -417,7 +417,7 @@ public class TestInPlaceUpdatesDistrib extends AbstractFullDistribZkTestBase {
SolrDocument sdoc = LEADER.getById("100"); // RTG straight from the index
assertEquals(sdoc.toString(), (float) inplace_updatable_float, sdoc.get("inplace_updatable_float"));
- assertEquals(sdoc.toString(), "title100", sdoc.get("title_s"));
+ assertEquals(sdoc.toString(), title, sdoc.get("title_s"));
assertEquals(sdoc.toString(), version, sdoc.get("_version_"));
if(random().nextBoolean()) {
@@ -425,6 +425,14 @@ public class TestInPlaceUpdatesDistrib extends AbstractFullDistribZkTestBase {
currentVersion = addDocAndGetVersion("id", 100, "title_s", title, "inplace_updatable_float", inplace_updatable_float); // full indexing
assertTrue(currentVersion > version);
version = currentVersion;
+
+ sdoc = LEADER.getById("100"); // RTG from the tlog
+ assertEquals(sdoc.toString(), (float) inplace_updatable_float, sdoc.get("inplace_updatable_float"));
+ assertEquals(sdoc.toString(), title, sdoc.get("title_s"));
+ assertEquals(sdoc.toString(), version, sdoc.get("_version_"));
+
+ // we've done a full index, so we need to update the [docid] for each replica
+ LEADER.commit(); // can't get (real) [docid] from the tlogs, need to force a commit
docids = getInternalDocIds("100");
}
@@ -456,7 +464,7 @@ public class TestInPlaceUpdatesDistrib extends AbstractFullDistribZkTestBase {
}
// assert that the internal docid for id=100 document remains same, in each replica, as before
- LEADER.commit();
+ LEADER.commit(); // can't get (real) [docid] from the tlogs, need to force a commit
assertTrue("Earlier: "+docids+", now: "+getInternalDocIds("100"), docids.equals(getInternalDocIds("100")));
}