From fe0b9be472559ed84706d0d9d8103b26a5daa204 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Sat, 5 Dec 2015 11:20:23 -0500 Subject: [PATCH 1/2] Simplify shard inactive logging This commit simplifies shard inactive debug logging to only log when the physical shard is marked as inactive. This eliminates duplicate logging that existed in IndexShard#checkIdle and IndexingMemoryController#checkIdle, and eliminates excessive logging that was occurring when the shard was already inactive as a result of the work in #15252. --- .../java/org/elasticsearch/index/shard/IndexShard.java | 2 +- .../indices/memory/IndexingMemoryController.java | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/index/shard/IndexShard.java b/core/src/main/java/org/elasticsearch/index/shard/IndexShard.java index b8bbb65c495..7804b50c390 100644 --- a/core/src/main/java/org/elasticsearch/index/shard/IndexShard.java +++ b/core/src/main/java/org/elasticsearch/index/shard/IndexShard.java @@ -1034,7 +1034,7 @@ public class IndexShard extends AbstractIndexShardComponent { boolean wasActive = active.getAndSet(false); if (wasActive) { updateBufferSize(IndexingMemoryController.INACTIVE_SHARD_INDEXING_BUFFER, IndexingMemoryController.INACTIVE_SHARD_TRANSLOG_BUFFER); - logger.debug("shard is now inactive"); + logger.debug("marking shard as inactive (inactive_time=[{}]) indexing wise", inactiveTime); indexEventListener.onShardInactive(this); } } diff --git a/core/src/main/java/org/elasticsearch/indices/memory/IndexingMemoryController.java b/core/src/main/java/org/elasticsearch/indices/memory/IndexingMemoryController.java index fa418b8966a..2788da3c52c 100644 --- a/core/src/main/java/org/elasticsearch/indices/memory/IndexingMemoryController.java +++ b/core/src/main/java/org/elasticsearch/indices/memory/IndexingMemoryController.java @@ -292,13 +292,7 @@ public class IndexingMemoryController extends AbstractLifecycleComponent Date: Sat, 5 Dec 2015 11:29:28 -0500 Subject: [PATCH 2/2] Remove logging statement when no shards are active --- .../elasticsearch/indices/memory/IndexingMemoryController.java | 1 - 1 file changed, 1 deletion(-) diff --git a/core/src/main/java/org/elasticsearch/indices/memory/IndexingMemoryController.java b/core/src/main/java/org/elasticsearch/indices/memory/IndexingMemoryController.java index 2788da3c52c..d9c08431ef8 100644 --- a/core/src/main/java/org/elasticsearch/indices/memory/IndexingMemoryController.java +++ b/core/src/main/java/org/elasticsearch/indices/memory/IndexingMemoryController.java @@ -254,7 +254,6 @@ public class IndexingMemoryController extends AbstractLifecycleComponent