Skip to content

Commit 779e1ad

Browse files
authored
Replace use of 'getProject' in RoutingNodes (#123567)
When #119968 was merged into multi-project we introduced a regression by inserting a call to `.getProject()` within the `RoutingNodes` class that was supposed to be multi-project-aware. This commit replaces those calls with `.indexMetadata` lookups
1 parent 10be77b commit 779e1ad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/src/main/java/org/elasticsearch/cluster/routing/RoutingNodes.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,7 +1340,7 @@ public void resetFailedCounter(RoutingAllocation allocation) {
13401340
if (failedAllocations > 0) {
13411341
try {
13421342
final var maxRetry = SETTING_ALLOCATION_MAX_RETRY.get(
1343-
allocation.metadata().getProject().getIndexSafe(shardRouting.index()).getSettings()
1343+
allocation.metadata().indexMetadata(shardRouting.index()).getSettings()
13441344
);
13451345
if (failedAllocations >= maxRetry) {
13461346
shardsWithMaxFailedAllocations++;
@@ -1378,7 +1378,7 @@ public void resetFailedCounter(RoutingAllocation allocation) {
13781378
try {
13791379
int failedRelocations = shardRouting.relocationFailureInfo().failedRelocations();
13801380
final var maxRetry = SETTING_ALLOCATION_MAX_RETRY.get(
1381-
allocation.metadata().getProject().getIndexSafe(shardRouting.index()).getSettings()
1381+
allocation.metadata().indexMetadata(shardRouting.index()).getSettings()
13821382
);
13831383
if (failedRelocations >= maxRetry) {
13841384
shardsWithMaxFailedRelocations++;

0 commit comments

Comments
 (0)