Skip to content

Detecting hidden indices takes nontrivial time #77974

@DaveCTurner

Description

@DaveCTurner

Metadata$Builder#build is called on every node in every cluster state update that changes the cluster metadata. In a busy cluster with many shards, this means it's on a fairly hot path. Profiling cluster state updates in such a cluster indicates that this method spends about 23% of its time calling Setting#get:

image

The only such call is this one:

final boolean visible = IndexMetadata.INDEX_HIDDEN_SETTING.get(indexMetadata.getSettings()) == false;

Frequently-accessed settings in IndexMetadata are generally made into fields to avoid having to do the lookup work on each access. We can make a substantial time saving in this method by moving the index.hidden setting to a field.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions