Skip to content

Add a cluster deprecation check for index templates containing multiple types #72540

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

romseygeek
Copy link
Contributor

Using an index template that creates multiple mapping types will already
throw an error in 7.x. This upgrade check should help filter out any unused
templates with multiple types that are still lurking in the cluster state.

@romseygeek romseygeek added >enhancement :Search Foundations/Mapping Index mappings, including merging and defining field types v7.14.0 labels Apr 30, 2021
@romseygeek romseygeek self-assigned this Apr 30, 2021
@elasticmachine elasticmachine added the Team:Search Meta label for search team label Apr 30, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

Copy link
Contributor

@alisonelizabeth alisonelizabeth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this deprecation @romseygeek! The deprecation message LGTM as well as implementation from a high level. I'll defer to an ES engineer if you'd like a more thorough code review.

@romseygeek romseygeek requested a review from jtibshirani April 30, 2021 14:05
@romseygeek
Copy link
Contributor Author

Thanks @alisonelizabeth, I've pinged @jtibshirani to get an ES view on it.

Copy link
Contributor

@jtibshirani jtibshirani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

if (templatesWithMultipleTypes.isEmpty()) {
return null;
}
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for my knowledge, does CRITICAL mean we'll prevent the upgrade from proceeding?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question, I've asked in the core-features channel and will try to find out!

@romseygeek romseygeek merged commit 5d492e8 into elastic:7.x May 4, 2021
@romseygeek romseygeek deleted the templates/multiple-types-cluster-check branch May 4, 2021 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Meta label for search team v7.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants