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

[UA] Low hanging fruit to improve reindexing performance #201605

Open
jloleysens opened this issue Nov 25, 2024 · 1 comment · May be fixed by #205055
Open

[UA] Low hanging fruit to improve reindexing performance #201605

jloleysens opened this issue Nov 25, 2024 · 1 comment · May be fixed by #205055
Assignees
Labels
Feature:Upgrade Assistant Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@jloleysens
Copy link
Contributor

jloleysens commented Nov 25, 2024

Today when upgrading indices through reindexing we make the following requests to (1) create an index and (2) request a reindex:

Index creation request

      createIndex = await esClient.indices.create({
        index: newIndexName,
        body: {
          settings,
          mappings,
        },
      });

Regardless of current index settings, create indices with:

  • number_of_replicas: 0 (docs)
  • refresh_interval: -1 (docs) turn off refresh since we don't expect to be servicing search on the new index at this time

After reindexing is done, before creating aliases, we can use the index update API to make the settings the same as the original index (or default)

Reindexing request

    const startReindexResponse = await esClient.reindex({
      refresh: true,
      wait_for_completion: false,
      body: {
        source: { index: indexName },
        dest: { index: reindexOp.attributes.newIndexName },
      },
    });
  • slices: auto - (docs) possibly less low hanging fruit but could speed up reindexing by handling (more) shards in parallel. "Indexing performance scales linearly across available resources with the number of slices"

This has a few potential issues we should consider:

  • No longer 1 task: 1 task that splits into N tasks. Completed tasks will by reported by the "parent" task returned from the original request. How much impact will this have on existing code? It appears that "cancel" logic will remain unchanged but the contents of the "reindex" task my be quite different.
  • "Reindexing from remote clusters does not support manual or automatic slicing." - will this be an issue for UA?

Resources

@botelastic botelastic bot added the needs-team Issues missing a team label label Nov 25, 2024
@jloleysens jloleysens removed the needs-team Issues missing a team label label Nov 25, 2024
@botelastic botelastic bot added the needs-team Issues missing a team label label Nov 25, 2024
@jloleysens jloleysens added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Feature:Upgrade Assistant labels Nov 25, 2024
@elasticmachine
Copy link
Contributor

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

@botelastic botelastic bot removed the needs-team Issues missing a team label label Nov 25, 2024
@afharo afharo self-assigned this Dec 11, 2024
@afharo afharo linked a pull request Dec 20, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Upgrade Assistant Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants