You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ds...@apache.org on 2019/10/23 21:52:29 UTC

[lucene-solr] branch branch_8_3 updated: SOLR-13855: DistributedZkUpdateProcessor needs to propagate URP.finish() Important since Run URP finish() propagates to updateLog to fsync()! Closes #969

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

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


The following commit(s) were added to refs/heads/branch_8_3 by this push:
     new 79dc140  SOLR-13855: DistributedZkUpdateProcessor needs to propagate URP.finish() Important since Run URP finish() propagates to updateLog to fsync()! Closes #969
79dc140 is described below

commit 79dc14078b6ccfd4844f8b7fa86e6a9023b1b68f
Author: David Smiley <ds...@salesforce.com>
AuthorDate: Wed Oct 23 12:11:52 2019 -0400

    SOLR-13855: DistributedZkUpdateProcessor needs to propagate URP.finish()
    Important since Run URP finish() propagates to updateLog to fsync()!
    Closes #969
    
    (cherry picked from commit 3ae820424809baa4e5a85d8bbdb0294cf6fe5b9b)
---
 solr/CHANGES.txt                                             |  4 ++++
 .../solr/update/processor/DistributedUpdateProcessor.java    | 12 +++++++-----
 .../solr/update/processor/DistributedZkUpdateProcessor.java  | 12 +++---------
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 0a48b41..72c3873 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -231,6 +231,10 @@ Bug Fixes
 
 * SOLR-13677: All Metrics Gauges should be unregistered by components that registered them. (noble, ab)
 
+* SOLR-13855: DistributedZkUpdateProcessor should have been propagating URP.finish() lifecycle like it used to before
+  8.1 (a regression).  Impacts integrity since Run URP's finish() propagates this to the updateLog to fsync.
+  (David Smiley)
+
 Other Changes
 ----------------------
 
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 5e04077..72021b1 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
@@ -1089,15 +1089,17 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
   }
 
   @Override
-  public void finish() throws IOException {
-    assertNotFinished();
+  public final void finish() throws IOException {
+    assert ! finished : "lifecycle sanity check";
+    finished = true;
+
+    doDistribFinish();
 
     super.finish();
   }
 
-  protected void assertNotFinished() {
-    assert ! finished : "lifecycle sanity check";
-    finished = true;
+  protected void doDistribFinish() throws IOException {
+    // no-op for derived classes to implement
   }
 
   /**
diff --git a/solr/core/src/java/org/apache/solr/update/processor/DistributedZkUpdateProcessor.java b/solr/core/src/java/org/apache/solr/update/processor/DistributedZkUpdateProcessor.java
index a76b6be..569f877 100644
--- a/solr/core/src/java/org/apache/solr/update/processor/DistributedZkUpdateProcessor.java
+++ b/solr/core/src/java/org/apache/solr/update/processor/DistributedZkUpdateProcessor.java
@@ -1045,17 +1045,10 @@ public class DistributedZkUpdateProcessor extends DistributedUpdateProcessor {
     super.processRollback(cmd);
   }
 
-  @Override
-  public void finish() throws IOException {
+  // TODO: optionally fail if n replicas are not reached...
+  protected void doDistribFinish() {
     clusterState = zkController.getClusterState();
 
-    assertNotFinished();
-
-    doFinish();
-  }
-
-  // TODO: optionally fail if n replicas are not reached...
-  private void doFinish() {
     boolean shouldUpdateTerms = isLeader && isIndexChanged;
     if (shouldUpdateTerms) {
       ZkShardTerms zkShardTerms = zkController.getShardTerms(cloudDesc.getCollectionName(), cloudDesc.getShardId());
@@ -1195,6 +1188,7 @@ public class DistributedZkUpdateProcessor extends DistributedUpdateProcessor {
     if (0 < errorsForClient.size()) {
       throw new DistributedUpdatesAsyncException(errorsForClient);
     }
+
   }
 
   /**