Skip to content

Commit 9f103e1

Browse files
comment on maybeUpdateTargetMBPerSec
1 parent 4fdd97f commit 9f103e1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

server/src/main/java/org/elasticsearch/index/engine/ThreadPoolMergeQueue.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ private void maybeUpdateTargetMBPerSec() {
127127
double currentTargetMBPerSec = targetMBPerSec.get();
128128
double newTargetMBPerSec = newTargetMBPerSec(currentTargetMBPerSec, activeIOThrottledMergeTasksCount.get(), maxConcurrentMerges);
129129
if (currentTargetMBPerSec != newTargetMBPerSec && targetMBPerSec.compareAndSet(currentTargetMBPerSec, newTargetMBPerSec)) {
130-
// supports iterating on running merges as they come in and complete out
130+
// it's OK to have this method update merge tasks concurrently, with different targetMBPerSec values,
131+
// as it's not important that all merge tasks are throttled to the same IO rate at all time.
132+
// For performance reasons, we don't synchronize the updates to targetMBPerSec values with the update of running merges.
131133
currentlyRunningMergeTasks.forEach(mergeTask -> {
132134
if (mergeTask.supportsIOThrottling()) {
133135
mergeTask.setIORateLimit(newTargetMBPerSec);

0 commit comments

Comments
 (0)