-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
migration: scope key migration to stores #9005
Conversation
@tychoish can you add a description of the PR and possibly link the reference issue (which I believe is the automating upgrades one) |
Done! |
Does this fix allow the problem of key migration collisions to completely go away? |
I believe so. The caveats/risks of key migration remain:
There aren't a case of systemic migration bugs that are dependent on the input data, which was the case before. While this change does not automate the run of the migration script, doing so is still not without costs:
|
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.
👍
This would be nice to achieve for automatic migrations |
Co-authored-by: Callum Waters <cmwaters19@gmail.com>
Definitely. Shouldn't block this PR, and maybe would be a good ramping project for someone. |
(cherry picked from commit cc07318)
(cherry picked from commit cc07318)
(cherry picked from commit cc07318)
(cherry picked from commit cc07318)
The original migration script assumed that there was essentially one store and that keys with any prefix could appear in any store, which while not apparent from the code, is not true. As a result the initial implementation of the migration was too flexible and would attempt to faithfully migrate code with any prefix in any collection.
The challenge with this approach, is that some keys can appear to to have prefixes that don't apply. In particularly the indexed data could appear to be evidence or another key, and be migrated into the (relative) unknown, resulting in apparent data loss. The inverse, would be much less likely but theoretically possible.
Thankfully, if we only attempt to migrate keys in stores with the corresponding prefix. This change restructures the migration so that we pass the name of the store into the migration function, and then define migrations with store names so we can correlate and scope migrations appropriately.
Additional follow on work will integrate migrations into database constructors as part of node construction.
Addresses: #8889