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

Increase stability when initializing the Elasticsearch index for the event log #57465

Merged
merged 13 commits into from
Feb 14, 2020

Conversation

mikecote
Copy link
Contributor

As a first part of #55639, this PR increases the stability when initializing Elasticsearch by handling scenarios where multiple Kibana instances try to do the same thing at the same time.

It currently checks existence before creating ILM policy, index template and the initial index but there's a chance two Kibana instances see no existence and try to create them at the same time. This PR will solve these scenarios and swallow errors in those cases in order to move on with the setup phase instead of failing to setup.

@mikecote mikecote added Feature:Alerting v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.7.0 Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) labels Feb 12, 2020
@mikecote mikecote requested review from pmuellr and a team February 12, 2020 16:37
@mikecote mikecote self-assigned this Feb 12, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-alerting-services (Team:Alerting Services)

@mikecote mikecote mentioned this pull request Feb 12, 2020
Copy link
Member

@pmuellr pmuellr left a comment

Choose a reason for hiding this comment

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

love it! obvs LGTM :-)

}

public async indexDocument(doc: any): Promise<void> {
await this.callEs('index', doc);
Copy link
Member

Choose a reason for hiding this comment

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

interesting that we don't need a result here!


interface AddTemplateOpts {
ilmExists: boolean;
await steps.createIlmPolicyIfNotExists();
Copy link
Member

Choose a reason for hiding this comment

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

so awesome!

@mikecote
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Contributor

@YulNaumenko YulNaumenko 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
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Contributor

@peterschretlen peterschretlen left a comment

Choose a reason for hiding this comment

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

LGTM

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@mikecote mikecote merged commit 918c0de into elastic:master Feb 14, 2020
mikecote added a commit to mikecote/kibana that referenced this pull request Feb 14, 2020
…event log (elastic#57465)

* Fix ILM policy creation

* Handle errors thrown in scenario multiple Kibana instances are started at the same time

* Fix tests and cleanup

* Start adding tests

* Refactor tests, add index template failure test

* Create cluster client adapter to facilitate testing and isolation

* Fix places calling callEs still

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
mikecote added a commit that referenced this pull request Feb 18, 2020
…event log (#57465) (#57731)

* Fix ILM policy creation

* Handle errors thrown in scenario multiple Kibana instances are started at the same time

* Fix tests and cleanup

* Start adding tests

* Refactor tests, add index template failure test

* Create cluster client adapter to facilitate testing and isolation

* Fix places calling callEs still

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Alerting release_note:skip Skip the PR/issue when compiling release notes review Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v7.7.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants