While working on #9203 we noticed (see comment) that many checkBlock() methods were checking blocks on an empty index like this:
protected ClusterBlockException checkBlock(PutIndexTemplateRequest request, ClusterState state) {
return state.blocks().indexBlockedException(ClusterBlockLevel.METADATA, "");
}
I think most of this kind of calls can be replaced by a global block check like:
return state.blocks().globalBlockedException(ClusterBlockLevel.METADATA);