Skip to content

Internal: replace empty index block checks with global block checks #10530

@tlrx

Description

@tlrx

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);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions