From 8ba1607af36fadee289038a76c3bc7e2bead7c68 Mon Sep 17 00:00:00 2001 From: Michael McCandless Date: Tue, 6 Jan 2015 09:17:16 +0000 Subject: [PATCH] LUCENE_6119: disable merge throttling on close git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1649755 13f79535-47bb-0310-9956-ffa450edef68 --- .../lucene/index/ConcurrentMergeScheduler.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lucene/core/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java b/lucene/core/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java index 586b2a0c5e6..328a460684f 100644 --- a/lucene/core/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java +++ b/lucene/core/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java @@ -89,6 +89,9 @@ public class ConcurrentMergeScheduler extends MergeScheduler { /** Floor for IO write rate limit (we will never go any lower than this) */ private static final double MIN_MERGE_MB_PER_SEC = 5.0; + /** Ceiling for IO write rate limit (we will never go any higher than this) */ + private static final double MAX_MERGE_MB_PER_SEC = 10240.0; + /** Initial value for IO write rate limit when doAutoIOThrottle is true */ private static final double START_MB_PER_SEC = 20.0; @@ -409,6 +412,12 @@ public class ConcurrentMergeScheduler extends MergeScheduler { initDynamicDefaults(writer); + if (trigger == MergeTrigger.CLOSING) { + // Disable throttling on close: + targetMBPerSec = MAX_MERGE_MB_PER_SEC; + updateMergeThreads(); + } + // First, quickly run through the newly proposed merges // and add any orthogonal merges (ie a merge not // involving segments already pending to be merged) to @@ -681,8 +690,8 @@ public class ConcurrentMergeScheduler extends MergeScheduler { if (newBacklog) { // This new merge adds to the backlog: increase IO throttle by 20% targetMBPerSec *= 1.20; - if (targetMBPerSec > 10000) { - targetMBPerSec = 10000; + if (targetMBPerSec > MAX_MERGE_MB_PER_SEC) { + targetMBPerSec = MAX_MERGE_MB_PER_SEC; } if (verbose()) { if (curMBPerSec == targetMBPerSec) {