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

Only provide obsoleteIndexTemplatePattern to the default index migrator to avoid race conditions #42016

Merged
merged 4 commits into from
Jul 25, 2019

Conversation

mikecote
Copy link
Contributor

I've noticed my backport PR getting conflicts / race conditions to delete index templates when running migrations. (PR: #42004, Failure: https://kibana-ci.elastic.co/job/elastic+kibana+pull-request/9392/JOB=x-pack-ciGroup6,node=linux-immutable/console).

The PR mentioned above introduces a secondary saved objects index which causes two index migrators to exist. Both are trying to delete any index template following the pattern 'kibana_index_template*'. This would cause missing index_template errors.

What I'm doing to avoid this is to let the default index migrator delete templates following the same pattern and to not provide a obsoleteIndexTemplatePattern to all the other index migrators.

@mikecote mikecote added Team:Operations Team label for Operations Team v8.0.0 v7.4.0 labels Jul 25, 2019
@mikecote mikecote requested a review from a team as a code owner July 25, 2019 19:46
@mikecote mikecote self-assigned this Jul 25, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations

@mikecote mikecote requested a review from a team July 25, 2019 19:46
Copy link
Contributor

@joshdover joshdover left a comment

Choose a reason for hiding this comment

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

Changes LGTM, but seems like we should have a test?

@mikecote
Copy link
Contributor Author

@joshdover done, just pushed a commit with a test 👍

@elasticmachine
Copy link
Contributor

💔 Build Failed

@mikecote
Copy link
Contributor Author

@tylersmalley thanks for reviewing, I applied the suggestion in the latest commit.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@tylersmalley tylersmalley left a comment

Choose a reason for hiding this comment

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

LGTM!

@mikecote mikecote merged commit ef94118 into elastic:master Jul 25, 2019
mikecote added a commit to mikecote/kibana that referenced this pull request Jul 25, 2019
…or to avoid race conditions (elastic#42016)

* Only provide obsoleteIndexTemplatePattern to the default index migrator to avoid race conditions

* Add test

* Apply PR feedback
mikecote added a commit that referenced this pull request Jul 26, 2019
…or to avoid race conditions (#42016) (#42033)

* Only provide obsoleteIndexTemplatePattern to the default index migrator to avoid race conditions

* Add test

* Apply PR feedback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants