LUCENE-6119: fix just arrived merge to throttle correctly

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1650025 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2015-01-07 10:24:16 +00:00
parent b7ddac884e
commit 941f6e64c8
2 changed files with 6 additions and 5 deletions

View File

@ -462,6 +462,7 @@ public class ConcurrentMergeScheduler extends MergeScheduler {
}
merger.start();
updateMergeThreads();
success = true;
} finally {
@ -649,12 +650,12 @@ public class ConcurrentMergeScheduler extends MergeScheduler {
}
/** Tunes IO throttle when a new merge starts. */
private synchronized void updateIOThrottle(OneMerge merge) throws IOException {
private synchronized void updateIOThrottle(OneMerge newMerge) throws IOException {
if (doAutoIOThrottle == false) {
return;
}
double mergeMB = bytesToMB(merge.estimatedMergeBytes);
double mergeMB = bytesToMB(newMerge.estimatedMergeBytes);
if (mergeMB < MIN_BIG_MERGE_MB) {
// Only watch non-trivial merges for throttling; this is safe because the MP must eventually
// have to do larger merges:
@ -666,7 +667,7 @@ public class ConcurrentMergeScheduler extends MergeScheduler {
// Simplistic closed-loop feedback control: if we find any other similarly
// sized merges running, then we are falling behind, so we bump up the
// IO throttle, else we lower it:
boolean newBacklog = isBacklog(now, merge);
boolean newBacklog = isBacklog(now, newMerge);
boolean curBacklog = false;
@ -721,8 +722,8 @@ public class ConcurrentMergeScheduler extends MergeScheduler {
}
}
newMerge.rateLimiter.setMBPerSec(targetMBPerSec);
targetMBPerSecChanged();
updateMergeThreads();
}
/** Subclass can override to tweak targetMBPerSec. */

View File

@ -521,7 +521,7 @@ public final class IndexWriterConfig extends LiveIndexWriterConfig {
@Override
public String toString() {
StringBuilder sb = new StringBuilder(super.toString());
sb.append("writer=").append(writer).append("\n");
sb.append("writer=").append(writer.get()).append("\n");
return sb.toString();
}