Skip to content

Template validation is slow #138878

@flash1293

Description

@flash1293

Component template calculation can be really slow within Elasticsearch because it creates a temporary index to check whether everything is compatible.

This is what happens when a component template is changed that is used in >300 index templates, which can easily happen when using wired streams.

This is caused by a PUT _component_template/[email protected] call:

│ info [o.e.c.m.MetadataIndexTemplateService] [localhost] updating component template [[[email protected]](mailto:[email protected])]
│ info [o.e.c.s.MasterService] [localhost] took [2.1m/128172ms] to compute cluster state update for [create-component-template [[[email protected]](mailto:[email protected])], cause [api][org.elasticsearch.cluster.metadata.MetadataIndexTemplateService$3@760a9545]], which exceeds the warn threshold of [10s]

Streams creates one index template per stream, with a stack of component templates made up of its own one and all the parents - so logs.a.b.c.d has a component template stack of:

For a large hierarchy, there will be lots of index templates using logs.a - if changed, all of them need to be "remerged", which apparently takes a long time. Looks like this could be optimized.

This is not actually failing, but it takes a long time, so the request from the user to Kibana times out in the meantime and a timeout error is reported, even though Kibana server keeps working in the background until everything is done (it's also keeping the lock up for this time)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions