Skip to content

Commit 8075bb6

Browse files
Less RoutingNodes allocations
No longer create as many RoutingNodes, since they are expensive. Closes elastic#74325
1 parent 588fe5c commit 8075bb6

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderService.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,9 @@ public static class AllocationState {
224224
}
225225

226226
public long storagePreventsAllocation() {
227-
RoutingNodes routingNodes = new RoutingNodes(state, false);
228227
RoutingAllocation allocation = new RoutingAllocation(
229228
allocationDeciders,
230-
routingNodes,
229+
state.getRoutingNodes(),
231230
state,
232231
info,
233232
shardSizeInfo,
@@ -241,10 +240,9 @@ public long storagePreventsAllocation() {
241240
}
242241

243242
public long storagePreventsRemainOrMove() {
244-
RoutingNodes routingNodes = new RoutingNodes(state, false);
245243
RoutingAllocation allocation = new RoutingAllocation(
246244
allocationDeciders,
247-
routingNodes,
245+
state.getRoutingNodes(),
248246
state,
249247
info,
250248
shardSizeInfo,

0 commit comments

Comments
 (0)