Skip to content

Commit bf5b730

Browse files
committed
missing ==false
1 parent 64e37e0 commit bf5b730

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/ThrottlingAllocationDecider.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,14 @@ public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, Routing
128128
// Count the primaries currently doing recovery on the node, to ensure the primariesInitialRecoveries setting is obeyed.
129129
int primariesInRecovery = 0;
130130
final var initializingShardsIterator = node.initializing();
131+
final var returnUnexplainedDecision = allocation.debugDecision() == false;
131132
while (initializingShardsIterator.hasNext()) {
132133
final var shard = initializingShardsIterator.next();
133134
// when a primary shard is INITIALIZING, it can be because of *initial recovery* or *relocation from another node*
134135
// we only count initial recoveries here, so we need to make sure that relocating node is null
135136
if (shard.primary() && shard.relocatingNodeId() == null) {
136137
primariesInRecovery++;
137-
if (allocation.debugDecision() && primariesInRecovery >= primariesInitialRecoveries) {
138+
if (returnUnexplainedDecision && primariesInRecovery >= primariesInitialRecoveries) {
138139
// bail out early if we don't need the final total
139140
return THROTTLE;
140141
}

0 commit comments

Comments
 (0)