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

[Migrations] Systematically wait for newly created indices to turn green #157973

Merged

Conversation

gsoldevila
Copy link
Contributor

@gsoldevila gsoldevila commented May 17, 2023

Tackles #157968

When creating new indices during SO migrations, we used to rely on the res.acknowledged && res.shardsAcknowledged of the esClient.indices.create(...) to determine that the indices are ready to use.

However, we believe that due to certain race conditions, this can cause Kibana migrations to fail (refer to the related issue).

This PR aims at fixing recent CI failures by adding a systematic waitForIndexStatus after creating an index.

@gsoldevila gsoldevila added bug Fixes for quality problems that affect the customer experience Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc release_note:skip Skip the PR/issue when compiling release notes Feature:Migrations backport:prev-minor Backport to (9.0) the previous minor version (i.e. one version back from main) v8.8.0 v8.9.0 v8.8.1 labels May 17, 2023
@gsoldevila gsoldevila requested a review from a team as a code owner May 17, 2023 10:16
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

@gsoldevila gsoldevila changed the title Systematically wait for newly created indices to turn green [Migrations] Systematically wait for newly created indices to turn green May 17, 2023
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
securitySolution 400 404 +4
total +6

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
securitySolution 480 484 +4
total +6

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

@gsoldevila gsoldevila merged commit 71125b1 into elastic:main May 17, 2023
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request May 17, 2023
…een (elastic#157973)

Tackles elastic#157968

When creating new indices during SO migrations, we used to rely on the
`res.acknowledged && res.shardsAcknowledged` of the
`esClient.indices.create(...)` to determine that the indices are ready
to use.

However, we believe that due to certain race conditions, this can cause
Kibana migrations to fail (refer to the [related
issue](elastic#157968)).

This PR aims at fixing recent CI failures by adding a systematic
`waitForIndexStatus` after creating an index.

(cherry picked from commit 71125b1)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.8

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request May 17, 2023
…urn green (#157973) (#157993)

# Backport

This will backport the following commits from `main` to `8.8`:
- [[Migrations] Systematically wait for newly created indices to turn
green (#157973)](#157973)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Gerard
Soldevila","email":"gerard.soldevila@elastic.co"},"sourceCommit":{"committedDate":"2023-05-17T13:34:51Z","message":"[Migrations]
Systematically wait for newly created indices to turn green
(#157973)\n\nTackles
https://github.com/elastic/kibana/issues/157968\r\n\r\nWhen creating new
indices during SO migrations, we used to rely on
the\r\n`res.acknowledged && res.shardsAcknowledged` of
the\r\n`esClient.indices.create(...)` to determine that the indices are
ready\r\nto use.\r\n\r\nHowever, we believe that due to certain race
conditions, this can cause\r\nKibana migrations to fail (refer to the
[related\r\nissue](https://github.com/elastic/kibana/issues/157968)).\r\n\r\nThis
PR aims at fixing recent CI failures by adding a
systematic\r\n`waitForIndexStatus` after creating an
index.","sha":"71125b192e86ddc3d6747c5b14b92e669eba360f","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","Team:Core","release_note:skip","Feature:Migrations","backport:prev-minor","v8.8.0","v8.9.0","v8.8.1"],"number":157973,"url":"https://github.com/elastic/kibana/pull/157973","mergeCommit":{"message":"[Migrations]
Systematically wait for newly created indices to turn green
(#157973)\n\nTackles
https://github.com/elastic/kibana/issues/157968\r\n\r\nWhen creating new
indices during SO migrations, we used to rely on
the\r\n`res.acknowledged && res.shardsAcknowledged` of
the\r\n`esClient.indices.create(...)` to determine that the indices are
ready\r\nto use.\r\n\r\nHowever, we believe that due to certain race
conditions, this can cause\r\nKibana migrations to fail (refer to the
[related\r\nissue](https://github.com/elastic/kibana/issues/157968)).\r\n\r\nThis
PR aims at fixing recent CI failures by adding a
systematic\r\n`waitForIndexStatus` after creating an
index.","sha":"71125b192e86ddc3d6747c5b14b92e669eba360f"}},"sourceBranch":"main","suggestedTargetBranches":["8.8"],"targetPullRequestStates":[{"branch":"8.8","label":"v8.8.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/157973","number":157973,"mergeCommit":{"message":"[Migrations]
Systematically wait for newly created indices to turn green
(#157973)\n\nTackles
https://github.com/elastic/kibana/issues/157968\r\n\r\nWhen creating new
indices during SO migrations, we used to rely on
the\r\n`res.acknowledged && res.shardsAcknowledged` of
the\r\n`esClient.indices.create(...)` to determine that the indices are
ready\r\nto use.\r\n\r\nHowever, we believe that due to certain race
conditions, this can cause\r\nKibana migrations to fail (refer to the
[related\r\nissue](https://github.com/elastic/kibana/issues/157968)).\r\n\r\nThis
PR aims at fixing recent CI failures by adding a
systematic\r\n`waitForIndexStatus` after creating an
index.","sha":"71125b192e86ddc3d6747c5b14b92e669eba360f"}}]}]
BACKPORT-->

Co-authored-by: Gerard Soldevila <gerard.soldevila@elastic.co>
@rudolf rudolf added the Epic:ScaleMigrations Scale upgrade migrations to millions of saved objects label Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (9.0) the previous minor version (i.e. one version back from main) bug Fixes for quality problems that affect the customer experience Epic:ScaleMigrations Scale upgrade migrations to millions of saved objects Feature:Migrations release_note:skip Skip the PR/issue when compiling release notes Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v8.8.0 v8.8.1 v8.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants