Skip to content

Commit 9c3149c

Browse files
asce0705DaveCTurner
authored andcommitted
Fix assertShardStats in RoutingNodes (#66835)
The last shard id is ignored while asserting the assigned shardRoutings in RoutingNodes.
1 parent e9dc17f commit 9c3149c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1058,7 +1058,7 @@ public static boolean assertShardStats(RoutingNodes routingNodes) {
10581058

10591059
for (final Map.Entry<Index, Integer> e : entries) {
10601060
final Index index = e.getKey();
1061-
for (int i = 0; i < e.getValue(); i++) {
1061+
for (int i = 0; i <= e.getValue(); i++) {
10621062
final ShardId shardId = new ShardId(index, i);
10631063
final HashSet<ShardRouting> shards = shardsByShardId.get(shardId);
10641064
final List<ShardRouting> mutableShardRoutings = routingNodes.assignedShards(shardId);

0 commit comments

Comments
 (0)