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

Document and use migrations.batchSize in v2 migrations #93155

Closed
kobelb opened this issue Mar 2, 2021 · 3 comments · Fixed by #96290
Closed

Document and use migrations.batchSize in v2 migrations #93155

kobelb opened this issue Mar 2, 2021 · 3 comments · Fixed by #96290
Assignees
Labels
Feature:Saved Objects project:ResilientSavedObjectMigrations Reduce Kibana upgrade failures by making saved object migrations more resilient Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@kobelb
Copy link
Contributor

kobelb commented Mar 2, 2021

The saved-object migrations v1 used the undocumented migrations.batchSize setting to control how many documents are migrated per batch. We found some utility in allowing users to increase this setting to deal with a large number of saved-objects that should be migrated.

However, the saved-object migrations v2 don't use this setting and they're currently hard-coded to migrate 1000 saved-objects at a time. Per @rudolf's suggestion, we should document this setting and consume it for v2 migrations.

Outdated old description The default for `migrations.batchSize` was chosen a long time ago. We've continued to see issues with migrations run against Kibana system-indices that have a very large number of documents. One of the workarounds that have been employed is manually increasing the `migrations.batchSize` setting from `100` to `1000`. Should we consider increasing the default from `100` to `1000`?

Conceptually, this will cause Kibana to consume 10x more heap during migrations. Do we have any idea how large these saved-objects are to determine the real impact this change would have?

Are there any other side-effects we should take into consideration?

@kobelb kobelb added discuss Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Feature:Saved Objects labels Mar 2, 2021
@elasticmachine
Copy link
Contributor

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

@rudolf rudolf added the project:ResilientSavedObjectMigrations Reduce Kibana upgrade failures by making saved object migrations more resilient label Mar 2, 2021
@rudolf rudolf changed the title Increase default for migrations.batchSize Increase default for migrations.batchSize and also use in v2 migrations Mar 2, 2021
@rudolf
Copy link
Contributor

rudolf commented Mar 2, 2021

Some documents like canvas templates can be 10 megabytes, but this is definitely the exception. We won't really be able to come up with a good estimate for how much heap it could consume because the document size could be so different.

When I tested with sample data and 100k saved objects I couldn't see a difference in Kibana's or Elasticsearch's heap consumption between batches of 100 or 1000 documents. So v2 migrations are currently hardcoded to 1000 document batches which is also Elasticsearch's default for the reindex operation.

Given that we can't really choose the perfect value here because of the uncertainty it makes sense that this should also be configurable for v2 migrations and documented.

@kobelb kobelb changed the title Increase default for migrations.batchSize and also use in v2 migrations Document and use migrations.batchSize in v2 migrations Mar 25, 2021
@kobelb kobelb removed the discuss label Mar 25, 2021
@kobelb
Copy link
Contributor Author

kobelb commented Mar 25, 2021

@rudolf I've updated the description to reflect the suggestions that you made and I've removed the discuss label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Saved Objects project:ResilientSavedObjectMigrations Reduce Kibana upgrade failures by making saved object migrations more resilient 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.

4 participants