From 564aed06e90edec26787406a27e8707ebbbfb34f Mon Sep 17 00:00:00 2001 From: Yonik Seeley Date: Tue, 2 Dec 2014 16:46:05 +0000 Subject: [PATCH] SOLR-6776: only clear changesSinceCommit on a hard commit so tlog will still be flushed on a softCommit git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1642946 13f79535-47bb-0310-9956-ffa450edef68 --- solr/CHANGES.txt | 4 ++++ .../solr/update/processor/RunUpdateProcessorFactory.java | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 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-parameter requests. (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.java index 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; + } } /**