From 639515c240a5a26a597d5a3bd60c5a9cd727763e Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Thu, 15 Sep 2011 12:21:12 +0300 Subject: [PATCH] Optimizing inactive (indexing wise) shard to only happen when there are no ongoing merges, closes #1336. --- .../indices/memory/IndexingMemoryBufferController.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 57889bf8702..2c62cb68142 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 @@ -141,7 +141,8 @@ public class IndexingMemoryBufferController extends AbstractLifecycleComponent inactiveTime.millis()) { + // mark it as inactive only if enough time has passed and there are no ongoing merges going on... + if ((time - status.time) > inactiveTime.millis() && ((InternalIndexShard) indexShard).mergeScheduler().stats().current() == 0) { try { ((InternalIndexShard) indexShard).engine().updateIndexingBufferSize(Engine.INACTIVE_SHARD_INDEXING_BUFFER); } catch (EngineClosedException e) { @@ -154,14 +155,14 @@ public class IndexingMemoryBufferController extends AbstractLifecycleComponent