Skip to content

Commit 88a0bbe

Browse files
committed
fix tests
1 parent 3f69b4a commit 88a0bbe

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

server/src/main/java/org/elasticsearch/cluster/routing/allocation/allocator/DesiredBalanceComputer.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,14 @@ public DesiredBalance compute(
295295
final var rerouteExplanation = command.execute(routingAllocation, false);
296296
assert rerouteExplanation.decisions().type() != Decision.Type.NO;
297297
if (rerouteExplanation.decisions().type() != Decision.Type.NO) {
298-
final ShardRouting[] initializingShards = routingNodes.node(command.toNode()).initializing();
299-
assert initializingShards.length == 1 && command.fromNode().equals(initializingShards[0].relocatingNodeId())
298+
final ShardRouting[] initializingShards = routingNodes.node(
299+
routingAllocation.nodes().resolveNode(command.toNode()).getId()
300+
).initializing();
301+
assert initializingShards.length == 1
302+
&& routingAllocation.nodes()
303+
.resolveNode(command.fromNode())
304+
.getId()
305+
.equals(initializingShards[0].relocatingNodeId())
300306
: "expect one relocating shard, but got : " + List.of(initializingShards);
301307
Arrays.stream(initializingShards).forEach(shard -> {
302308
clusterInfoSimulator.simulateShardStarted(shard);

0 commit comments

Comments
 (0)