Skip to content

Commit d07a60d

Browse files
committed
Add another note to maybeValidateDataStreamsStillReferenced
I realized that this might not be obvious and is worthy of an explanation. Follow-up of elastic#135457.
1 parent 305a1d7 commit d07a60d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

server/src/main/java/org/elasticsearch/cluster/metadata/MetadataIndexTemplateService.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,9 @@ private static void maybeValidateDataStreamsStillReferenced(
965965
// We check whether anything relevant has changed that could affect data stream coverage and return early if not.
966966
// These checks are based on the implementation of findV2Template and the data stream template check in this method.
967967
// If we're adding a new template, we do the full check in case this template's priority changes coverage.
968+
// Note that this method is also run for component templates, and that component templates can configure the
969+
// `index.hidden` setting. In that case, we'd never take this shortcut as we're comparing a composite template
970+
// with a composable template (i.e. we don't take component templates into account for the existing template).
968971
if (existingTemplate != null
969972
&& Objects.equals(existingTemplate.indexPatterns(), newTemplate.indexPatterns())
970973
&& Objects.equals(existingSettings.get(IndexMetadata.SETTING_INDEX_HIDDEN), newSettings.get(IndexMetadata.SETTING_INDEX_HIDDEN))

0 commit comments

Comments
 (0)