Skip to content

Commit e2dd10f

Browse files
Less RoutingNodes allocations (#74911)
No longer create as many RoutingNodes, since they are expensive. Closes #74325
1 parent 413521e commit e2dd10f

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
@@ -225,10 +225,9 @@ public static class AllocationState {
225225
}
226226

227227
public long storagePreventsAllocation() {
228-
RoutingNodes routingNodes = new RoutingNodes(state, false);
229228
RoutingAllocation allocation = new RoutingAllocation(
230229
allocationDeciders,
231-
routingNodes,
230+
state.getRoutingNodes(),
232231
state,
233232
info,
234233
shardSizeInfo,
@@ -242,10 +241,9 @@ public long storagePreventsAllocation() {
242241
}
243242

244243
public long storagePreventsRemainOrMove() {
245-
RoutingNodes routingNodes = new RoutingNodes(state, false);
246244
RoutingAllocation allocation = new RoutingAllocation(
247245
allocationDeciders,
248-
routingNodes,
246+
state.getRoutingNodes(),
249247
state,
250248
info,
251249
shardSizeInfo,

0 commit comments

Comments
 (0)