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:
parent
73a0cc6488
commit
fe0b9be472
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue