Skip to content

Commit 9d9eed5

Browse files
authored
Assert for empty routing table when hiding state (#117870)
Routing table should always be empty when hiding cluster state for not-recovered block. This PR adds an explicit assertion for it.
1 parent 032b42f commit 9d9eed5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

server/src/main/java/org/elasticsearch/gateway/ClusterStateUpdaters.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ public static ClusterState hideStateIfNotRecovered(ClusterState state) {
143143
.coordinationMetadata(state.metadata().coordinationMetadata())
144144
.build();
145145

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

0 commit comments

Comments
 (0)