-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Only provide obsoleteIndexTemplatePattern to the default index migrator to avoid race conditions #42016
Conversation
…or to avoid race conditions
Pinging @elastic/kibana-operations |
There was a problem hiding this 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?
@joshdover done, just pushed a commit with a test 👍 |
…solete-index-template
💔 Build Failed |
src/core/server/saved_objects/migrations/kibana/kibana_migrator.ts
Outdated
Show resolved
Hide resolved
src/core/server/saved_objects/migrations/kibana/kibana_migrator.ts
Outdated
Show resolved
Hide resolved
@tylersmalley thanks for reviewing, I applied the suggestion in the latest commit. |
💚 Build Succeeded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
…or to avoid race conditions (elastic#42016) * Only provide obsoleteIndexTemplatePattern to the default index migrator to avoid race conditions * Add test * Apply PR feedback
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.