-
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
Increase stability when initializing the Elasticsearch index for the event log #57465
Increase stability when initializing the Elasticsearch index for the event log #57465
Conversation
…d at the same time
Pinging @elastic/kibana-alerting-services (Team:Alerting Services) |
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.
love it! obvs LGTM :-)
} | ||
|
||
public async indexDocument(doc: any): Promise<void> { | ||
await this.callEs('index', doc); |
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.
interesting that we don't need a result here!
|
||
interface AddTemplateOpts { | ||
ilmExists: boolean; | ||
await steps.createIlmPolicyIfNotExists(); |
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.
so awesome!
@elasticmachine merge upstream |
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
@elasticmachine merge upstream |
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
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
…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>
…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>
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.