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

[SO Migration] increasing performance by getting rid of the temporary index #104080

Closed
pgayvallet opened this issue Jul 1, 2021 · 4 comments
Closed
Labels
discuss 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

@pgayvallet
Copy link
Contributor

Given that

I think we don’t have any more reason to use a temporary index between the source and the target. We need some further investigation to confirm that this hypothesis is correct, but if so, we could just read batches of documents from the source, and index them in the target, then proceed with the mapping update as we’re already doing. It would allow us to get rid of the whole clone + refresh target operations.

Note that the time complexity would remain linear in that case, but it could still be a non-negligible improvement.

@pgayvallet pgayvallet added discuss Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Feature:Saved Objects project:ResilientSavedObjectMigrations Reduce Kibana upgrade failures by making saved object migrations more resilient labels Jul 1, 2021
@elasticmachine
Copy link
Contributor

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

@joshdover
Copy link
Contributor

Worth noting that after #105213 merges, we will be continuing to allow unknown types to be migrated until 8.0. So we cannot make this change (or #103731) until that behavior changes.

@pgayvallet
Copy link
Contributor Author

pgayvallet commented Jul 13, 2021

Yea. also given #105115 (comment), it's possible that we may need the temporary index anyway for some migration improvement.

That, plus the fact that the 'one index per type' approach is a better perf improvement anyway long-term, make me think that we could ignore this one.

@rudolf
Copy link
Contributor

rudolf commented Feb 8, 2022

We need need the temporary index + clone steps to avoid lost deletes. Otherwise, one instance completes the migration, acknowledges a delete, and then the second instance reindexes the deleted document and restores it.

The alternative is to implement soft deletes so that the second instance's reindex will get a write conflict. I feel like there was some kind of gotcha which soft deletes didn't solve. But all-in-all I agree with the conclusion that migrations per type would be a better performance gain.

I'll close this for now. If we do one day identify the cloning step as a big performance cost, we could investigate soft deletes.

@rudolf rudolf closed this as completed Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss 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

No branches or pull requests

4 participants