Skip to content
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

Fix rollover alias definition in templates validation #70259

Merged
merged 2 commits into from
Mar 11, 2021

Conversation

andreidan
Copy link
Contributor

This fixes the case where a valid composable template overrides/shadows a
legacy template that defines the rollover alias. This is a valid configuration
and rollover should not fail.

Fixes #70258

This fixes the case where a valid composable template overrides/shadows a
legacy template that defines the rollover alias. This is a valid configuration
and rollover should not fail.
@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Mar 10, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (Team:Core/Features)

@andreidan andreidan requested a review from dakrone March 10, 2021 18:18
Copy link
Member

@dakrone dakrone left a comment

Choose a reason for hiding this comment

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

LGTM, I left one minor comment, thanks for fixing this Andrei!

MetadataRolloverService.checkNoDuplicatedAliasInIndexTemplate(metadata, indexName, aliasName, randomBoolean());
// success
} catch (Exception e) {
fail("the valid v2 template takes priority over the v1 template. was not expecting a failure but got: " + e.getMessage());
Copy link
Member

Choose a reason for hiding this comment

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

We probably don't need to catch this exception, since uncaught exceptions would cause the test to fail anyway. This also swallows the stacktrace which would make it slightly harder to investigate for someone triaging a failure.

@andreidan andreidan merged commit 3ea34bf into elastic:master Mar 11, 2021
andreidan added a commit to andreidan/elasticsearch that referenced this pull request Mar 11, 2021
This fixes the case where a valid composable template overrides/shadows a
legacy template that defines the rollover alias. This is a valid configuration
and rollover should not fail.

(cherry picked from commit 3ea34bf)
Signed-off-by: Andrei Dan <[email protected]>
andreidan added a commit to andreidan/elasticsearch that referenced this pull request Mar 11, 2021
This fixes the case where a valid composable template overrides/shadows a
legacy template that defines the rollover alias. This is a valid configuration
and rollover should not fail.

(cherry picked from commit 3ea34bf)
Signed-off-by: Andrei Dan <[email protected]>
andreidan added a commit to andreidan/elasticsearch that referenced this pull request Mar 11, 2021
This fixes the case where a valid composable template overrides/shadows a
legacy template that defines the rollover alias. This is a valid configuration
and rollover should not fail.

(cherry picked from commit 3ea34bf)
Signed-off-by: Andrei Dan <[email protected]>
andreidan added a commit that referenced this pull request Mar 11, 2021
This fixes the case where a valid composable template overrides/shadows a
legacy template that defines the rollover alias. This is a valid configuration
and rollover should not fail.

(cherry picked from commit 3ea34bf)
Signed-off-by: Andrei Dan <[email protected]>
andreidan added a commit that referenced this pull request Mar 11, 2021
This fixes the case where a valid composable template overrides/shadows a
legacy template that defines the rollover alias. This is a valid configuration
and rollover should not fail.

(cherry picked from commit 3ea34bf)
Signed-off-by: Andrei Dan <[email protected]>
andreidan added a commit that referenced this pull request Mar 11, 2021
…#70301)

This fixes the case where a valid composable template overrides/shadows a
legacy template that defines the rollover alias. This is a valid configuration
and rollover should not fail.

(cherry picked from commit 3ea34bf)
Signed-off-by: Andrei Dan <[email protected]>
probakowski pushed a commit to probakowski/elasticsearch that referenced this pull request Mar 15, 2021
This fixes the case where a valid composable template overrides/shadows a
legacy template that defines the rollover alias. This is a valid configuration
and rollover should not fail.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Data Management/Indices APIs APIs to create and manage indices and templates Team:Data Management Meta label for data/management team v7.11.3 v7.12.1 v7.13.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rollover fails if legacy template defines rollover alias, even if shadowed by valid composable template
4 participants