Add node name to decider trace logging (#20437)

Adds the entire DiscoveryNode object to the trace log in AllocationDeciders.
The allocation decider logging at TRACE level can sometimes be helpful to determine why a shard is not getting allocated on specific nodes. Currently, we only log the node id for these messages. It will be helpful to also include the node name (esp. when dealing with a lot of nodes in the cluster).
This commit is contained in:
makeyang 2016-09-13 17:17:39 +08:00 committed by Simon Willnauer
parent 567093cf78
commit 1ae8d6123f
1 changed files with 1 additions and 1 deletions

View File

@ -74,7 +74,7 @@ public class AllocationDeciders extends AllocationDecider {
// short track if a NO is returned. // short track if a NO is returned.
if (decision == Decision.NO) { if (decision == Decision.NO) {
if (logger.isTraceEnabled()) { if (logger.isTraceEnabled()) {
logger.trace("Can not allocate [{}] on node [{}] due to [{}]", shardRouting, node.nodeId(), allocationDecider.getClass().getSimpleName()); logger.trace("Can not allocate [{}] on node [{}] due to [{}]", shardRouting, node.node(), allocationDecider.getClass().getSimpleName());
} }
// short circuit only if debugging is not enabled // short circuit only if debugging is not enabled
if (!allocation.debugDecision()) { if (!allocation.debugDecision()) {