You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by is...@apache.org on 2017/01/06 19:09:45 UTC

lucene-solr:jira/solr-5944: SOLR-5944: Fixing AtomicUpdatesTest failure; populating the defaults and copy fields at the end of resolve during RTG call

Repository: lucene-solr
Updated Branches:
  refs/heads/jira/solr-5944 7c0ec19e6 -> df8669b48


SOLR-5944: Fixing AtomicUpdatesTest failure; populating the defaults and copy fields at the end of resolve during RTG call


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/df8669b4
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/df8669b4
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/df8669b4

Branch: refs/heads/jira/solr-5944
Commit: df8669b48f6d839c813865bb77bbccfab40b9309
Parents: 7c0ec19
Author: Ishan Chattopadhyaya <is...@apache.org>
Authored: Sat Jan 7 00:38:01 2017 +0530
Committer: Ishan Chattopadhyaya <is...@apache.org>
Committed: Sat Jan 7 00:38:01 2017 +0530

----------------------------------------------------------------------
 .../apache/solr/handler/component/RealTimeGetComponent.java   | 7 +++++++
 .../org/apache/solr/update/processor/AtomicUpdatesTest.java   | 3 ---
 2 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/df8669b4/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java b/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java
index 97973a7..138f294 100644
--- a/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java
+++ b/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java
@@ -238,6 +238,13 @@ public class RealTimeGetComponent extends SearchComponent
                  // For in-place update case, we have obtained the partial document till now. We need to
                  // resolve it to a full document to be returned to the user.
                  doc = (SolrDocument) resolveFullDocument(core, idBytes.get(), rsp.getReturnFields(), doc, entry, null);
+
+                 // Since the partial doc from the tlog was obtained and resolved without ever having populated all
+                 // the defaults and the copy fields before, we need to do it before returning. The call to toSolrDoc()
+                 // here achieves that.
+                 // nocommit: Is it possible to refactor these methods cleanly so that this double conversion (SD->SID->(Document->)SD)
+                 // nocommit: can be avoided?
+                 doc = toSolrDoc(toSolrInputDocument(doc, core.getLatestSchema()), core.getLatestSchema(), false);
                  if (doc == null) {
                    break;
                  }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/df8669b4/solr/core/src/test/org/apache/solr/update/processor/AtomicUpdatesTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/update/processor/AtomicUpdatesTest.java b/solr/core/src/test/org/apache/solr/update/processor/AtomicUpdatesTest.java
index dd97912..2d07af7 100644
--- a/solr/core/src/test/org/apache/solr/update/processor/AtomicUpdatesTest.java
+++ b/solr/core/src/test/org/apache/solr/update/processor/AtomicUpdatesTest.java
@@ -1138,9 +1138,6 @@ public class AtomicUpdatesTest extends SolrTestCaseJ4 {
   }
 
   public void testFieldsWithDefaultValuesWhenAtomicUpdatesAgainstTlog() {
-    // nocommit: all of these assumptions/assertions work for stored ints...
-    // nocommit: ...but DVO atomic updates against tlog are losing other schema defaults
-    
     for (String fieldToUpdate : Arrays.asList("field_to_update_i1", "field_to_update_i_dvo")) {
       clearIndex();