You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Skip data stream reference check in some cases (#135457)
During component and composable template validation we check if any data
streams become unreferenced if the composite template would be added to
the project metadata. We currently do this regardless of what changed in
the component or composable template. This check is quite expensive if
the cluster has many index templates or many data streams, mostly
because the regex matching on index patterns in `findV2Template` is
expensive.
We know that only a few properties of the composite template can affect
data stream references. Specifically, we know that the index patterns,
the `hidden` index setting, the priority, and the presence of the
`data_stream` field in the template are used to determine the template
that a data stream is based on.
By checking if only one of those properties changed, we can avoid
running the expensive checks in a great deal of template updates. For
example, mapping updates, `_meta` updates, any index settings other than
`hidden` are all irrelevant to this check, and we can thus skip it for
those updates. Especially component template updates will benefit from
this change, as they aren't even able to influence the index patterns,
data stream template, or priority of the composite template.
The main downside of this change is that we have an implicit dependency
from this new check on the implementation of `findV2Template`. We try
to mitigate that risk by doing the expensive/original check in an
assertion.
0 commit comments