Skip to content

Conversation

@martijnvg
Copy link
Member

@martijnvg martijnvg commented Oct 26, 2021

Backporting #79004 to 7.16 branch.

In cases when indices, aliases and data streams aren't modified then
the indices lookup can be reused.

For example in:

  • The IndexMetadataUpdater#applyChanges(...) method builds a new metadata
    instance, but only primary term or insync allocations may be updated.
    No new indices, aliases or data streams are added, so re-building indices
    lookup is not necessary.
  • MasterService#patchVersions

Additionally the logic that checks when indices lookup can be reused,
this logic also checks the hidden and system flags of indices/datastreams.

In clusters with many indices the cost of building indices lookup is
non-neglectable and should be avoided in this case.

Closes #78980
Partially addresses #77888

Backporting elastic#79004 to 7.x branch.

In cases when indices, aliases and data streams aren't modified then
the indices lookup can be reused.

For example in:
* The IndexMetadataUpdater#applyChanges(...) method builds a new metadata
instance, but only primary term or insync allocations may be updated.
No new indices, aliases or data streams are added, so re-building indices
lookup is not necessary.
* MasterService#patchVersions

Additionally the logic that checks when indices lookup can be reused,
this logic also checks the hidden and system flags of indices/datastreams.

In clusters with many indices the cost of building indices lookup is
non-neglectable and should be avoided in this case.

Closes elastic#78980
Partially addresses elastic#77888
@martijnvg martijnvg merged commit 7e9b8cd into elastic:7.16 Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants