File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
server/src/main/java/org/elasticsearch/index/engine Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -178,14 +178,16 @@ private void maybeExecuteNextMerge() {
178178 }
179179
180180 private void maybeActivateThrottling () {
181- int numActiveMerges = activeMergeTasksExecutingOnLocalSchedulerList .size ();
181+ // both currently running and enqueued count as "active" for throttling purposes
182+ int numActiveMerges = activeMergeTasksExecutingOnLocalSchedulerList .size () + activeMergeTasksLocalSchedulerQueue .size ();
182183 if (numActiveMerges > config .getMaxMergeCount () && isThrottling .getAndSet (true ) == false ) {
183184 activateThrottling (numActiveMerges );
184185 }
185186 }
186187
187188 private void maybeDeactivateThrottling () {
188- int numActiveMerges = activeMergeTasksExecutingOnLocalSchedulerList .size ();
189+ // both currently running and enqueued count as "active" for throttling purposes
190+ int numActiveMerges = activeMergeTasksExecutingOnLocalSchedulerList .size () + activeMergeTasksLocalSchedulerQueue .size ();
189191 if (numActiveMerges <= config .getMaxMergeCount () && isThrottling .getAndSet (false )) {
190192 deactivateThrottling (numActiveMerges );
191193 }
You can’t perform that action at this time.
0 commit comments