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.
This commit is contained in:
Jason Tedor 2015-12-05 11:20:23 -05:00
parent 73a0cc6488
commit fe0b9be472
2 changed files with 2 additions and 8 deletions

View File

@ -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);
}
}

View File

@ -292,13 +292,7 @@ public class IndexingMemoryController extends AbstractLifecycleComponent<Indexin
*/
protected boolean checkIdle(IndexShard shard) {
try {
boolean idle = shard.checkIdle();
if (idle && logger.isDebugEnabled()) {
logger.debug("marking shard {} as inactive (inactive_time[{}]) indexing wise",
shard.shardId(),
shard.getInactiveTime());
}
return idle;
return shard.checkIdle();
} catch (EngineClosedException | FlushNotAllowedEngineException e) {
logger.trace("ignore [{}] while marking shard {} as inactive", e.getClass().getSimpleName(), shard.shardId());
return true;