Skip to content

Commit

Permalink
Assert for empty routing table when hiding state
Browse files Browse the repository at this point in the history
Routing table should always be empty when hiding cluster state for
not-recovered block. This PR adds an explicit assertion for it.
  • Loading branch information
ywangd committed Dec 3, 2024
1 parent 4a9f632 commit e1c5187
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ public static ClusterState hideStateIfNotRecovered(ClusterState state) {
.coordinationMetadata(state.metadata().coordinationMetadata())
.build();

assert state.routingTable().indicesRouting().isEmpty() : "routing table is not empty: " + state.routingTable().indicesRouting();
return ClusterState.builder(state).metadata(metadata).blocks(blocks.build()).build();
}
return state;
Expand Down

0 comments on commit e1c5187

Please sign in to comment.