Browse Source

Use the known project in ClusterInfoSimulator.simulateShardStarted

Replace getProject call with the actual project resolved earlier.
Yang Wang 8 months ago
parent
commit
1b1e81a113

+ 1 - 4
server/src/main/java/org/elasticsearch/cluster/ClusterInfoSimulator.java

@@ -108,10 +108,7 @@ public class ClusterInfoSimulator {
                 if (shouldReserveSpaceForInitializingShard(shard, allocation.metadata())) {
                     modifyDiskUsage(shard.currentNodeId(), -size);
                 }
-                shardSizes.put(
-                    shardIdentifierFromRouting(shard),
-                    allocation.metadata().getProject().getIndexSafe(shard.index()).ignoreDiskWatermarks() ? 0 : size
-                );
+                shardSizes.put(shardIdentifierFromRouting(shard), project.getIndexSafe(shard.index()).ignoreDiskWatermarks() ? 0 : size);
             }
         }
     }