You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2020/07/30 05:53:27 UTC

[lucene-solr] 02/03: @461 Whoops, fix mistake in distrib update add.

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

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

commit 54f2ffc40ec6036d9b2480b3d4947ac68f781a2f
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Thu Jul 30 00:13:42 2020 -0500

    @461 Whoops, fix mistake in distrib update add.
---
 .../update/processor/DistributedUpdateProcessor.java | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java b/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
index c4c1a79..9fb7eea 100644
--- a/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
+++ b/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
@@ -236,6 +236,10 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
       return;
     }
 
+    SolrInputDocument clonedDoc = shouldCloneCmdDoc() ? cmd.solrDoc.deepCopy(): null;
+    if (clonedDoc != null) {
+      cmd.solrDoc = clonedDoc;
+    }
     try (ParWork worker = new ParWork(this)) {
       worker.collect(() -> {
         if (vinfo != null) vinfo.lockForUpdate();
@@ -248,7 +252,8 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
           // force open a realTimeSearcher to trigger a ulog cache refresh.
           // This refresh makes RTG handler aware of this update.q
           if (ulog != null) {
-            if (req.getSchema().isUsableForChildDocs() && shouldRefreshUlogCaches(cmd)) {
+            if (req.getSchema().isUsableForChildDocs()
+                && shouldRefreshUlogCaches(cmd)) {
               ulog.openRealtimeSearcher();
             }
           }
@@ -259,13 +264,16 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
           if (vinfo != null) vinfo.unlockForUpdate();
         }
       });
-      SolrInputDocument clonedDoc = shouldCloneCmdDoc() ? cmd.solrDoc.deepCopy(): null;
-      if (clonedDoc != null) {
-        cmd.solrDoc = clonedDoc;
-      }
       if (req.getCore().getCoreContainer().isZooKeeperAware()) {
-        doDistribAdd(worker, cmd);
+        worker.collect(() -> {
+          try {
+            doDistribAdd(worker, cmd);
+          } catch (IOException e) {
+            throw new SolrException(ErrorCode.SERVER_ERROR, e);
+          }
+        });
       }
+
       worker.addCollect("distUpdate");
     }