Skip to content

Commit

Permalink
Fix place-holder in allocation decider messages (#27436)
Browse files Browse the repository at this point in the history
Allocation decider messages were using the wrong place-holder, which resulted in output of the form "no allocations are allowed due to {}" when showing diagnostics information in the explain API.
  • Loading branch information
ywelsch committed Nov 17, 2017
1 parent d9959d0 commit 8ed0120
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public Decision canForceAllocatePrimary(ShardRouting shardRouting, RoutingNode n
// On a NO decision, by default, we allow force allocating the primary.
return allocation.decision(Decision.YES,
decision.label(),
"primary shard [{}] allowed to force allocate on node [{}]",
"primary shard [%s] allowed to force allocate on node [%s]",
shardRouting.shardId(), node.nodeId());
} else {
// On a THROTTLE/YES decision, we use the same decision instead of forcing allocation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,20 +116,20 @@ public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, Routing
case ALL:
return allocation.decision(Decision.YES, NAME, "all allocations are allowed");
case NONE:
return allocation.decision(Decision.NO, NAME, "no allocations are allowed due to {}", setting(enable, usedIndexSetting));
return allocation.decision(Decision.NO, NAME, "no allocations are allowed due to %s", setting(enable, usedIndexSetting));
case NEW_PRIMARIES:
if (shardRouting.primary() && shardRouting.active() == false &&
shardRouting.recoverySource().getType() != RecoverySource.Type.EXISTING_STORE) {
return allocation.decision(Decision.YES, NAME, "new primary allocations are allowed");
} else {
return allocation.decision(Decision.NO, NAME, "non-new primary allocations are forbidden due to {}",
return allocation.decision(Decision.NO, NAME, "non-new primary allocations are forbidden due to %s",
setting(enable, usedIndexSetting));
}
case PRIMARIES:
if (shardRouting.primary()) {
return allocation.decision(Decision.YES, NAME, "primary allocations are allowed");
} else {
return allocation.decision(Decision.NO, NAME, "replica allocations are forbidden due to {}",
return allocation.decision(Decision.NO, NAME, "replica allocations are forbidden due to %s",
setting(enable, usedIndexSetting));
}
default:
Expand Down

0 comments on commit 8ed0120

Please sign in to comment.