Apache Lucene open-source search software
SOLR-6776: only clear changesSinceCommit on a hard commit so tlog will still be flushed on a softCommit
Yonik Seeley564aed06e90e
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 63f484525c7..0c5031e25a8 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -509,6 +509,10 @@ Bug Fixes* SOLR-6796: distrib.singlePass does not return correct set of fields for multi-fl-parameterrequests. (Per Steffensen via shalin)+* SOLR-6776: Transaction log was not flushed at the end of update requests with softCommit+ specified, which could lead to data loss if the server were killed immediately after the+ update finished. (Jeffery Yuan via yonik)+Other Changes----------------------diff --git a/solr/core/src/java/org/apache/solr/update/processor/RunUpdateProcessorFactory.java b/solr/core/src/java/org/apache/solr/update/processor/RunUpdateProcessorFactory.javaindex c893f28d189..625f5c79751 100644--- a/solr/core/src/java/org/apache/solr/update/processor/RunUpdateProcessorFactory.java+++ b/solr/core/src/java/org/apache/solr/update/processor/RunUpdateProcessorFactory.java@@ -94,7 +94,10 @@ class RunUpdateProcessor extends UpdateRequestProcessor{updateHandler.commit(cmd);super.processCommit(cmd);- changesSinceCommit = false;+ if (!cmd.softCommit) {+ // a hard commit means we don't need to flush the transaction log+ changesSinceCommit = false;+ }}/**