diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/indices/memory/IndexingMemoryBufferController.java b/modules/elasticsearch/src/main/java/org/elasticsearch/indices/memory/IndexingMemoryBufferController.java index 2c62cb68142..d696e6eda89 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/indices/memory/IndexingMemoryBufferController.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/indices/memory/IndexingMemoryBufferController.java @@ -142,7 +142,7 @@ public class IndexingMemoryBufferController extends AbstractLifecycleComponent inactiveTime.millis() && ((InternalIndexShard) indexShard).mergeScheduler().stats().current() == 0) { + if ((time - status.time) > inactiveTime.millis() && indexShard.mergeStats().current() == 0) { try { ((InternalIndexShard) indexShard).engine().updateIndexingBufferSize(Engine.INACTIVE_SHARD_INDEXING_BUFFER); } catch (EngineClosedException e) {