File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
server/src/main/java/org/elasticsearch/cluster/routing/allocation/allocator Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff 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 );
You can’t perform that action at this time.
0 commit comments