Apache Solr open-source search software
SOLR-13855: DistributedZkUpdateProcessor needs to propagate URP.finish() Important since Run URP finish() propagates to updateLog to fsync()! Closes #969
David Smiley3ae820424809
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 16d4453ff4b..a87bbca54c6 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -348,6 +348,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.javaindex 5e04077fb39..72021b17b27 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.javaindex a76b6be2aac..569f877bb88 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);}+}/**