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

Allow migrations between releases or between different configurations #1172

Closed
kderme opened this issue Jul 2, 2022 · 1 comment
Closed
Assignees
Labels
enhancement New feature or request product-backlog

Comments

@kderme
Copy link
Contributor

kderme commented Jul 2, 2022

So far when there is a new major release, db-sync users have to drop the db and sync everything from genesis, which can be a time-wasting and painful procedure. One of the reasons this is necessary is that there is no concept of backwards compatibility in the ledger and in the ledger events. So on an major upgrade, ledger snapshots become invalid and need to be recreated from genesis. The ledger events also change, making it impossible to predict changes to inserted entries in the db. So dropping and recreating the db has been the way to go.

Two recent changes make it possible to migrate in a better way for future releases:

  • the leger events are much more stable now.
  • we have separated the data that come from ledger/events from the rest of the data, with the intoduction of disable-ledger

For future releases, when disable-ledger is enabled, db-sync users should never have to delete the db.
When it's not, we should still have a way to replay just the ledger rules, without resyncing the db. While replaying, db-sync should only modify the data related to ledger/events. When the ledger reaches the tip of the db, db-sync should continue syncing normally. The same approach can be followed when there is a migration from enabled disable-ledger, which misses some data, to disabled disable-ledger. The additional data should be filled without the need to resync everything.

@kderme kderme added bug Something isn't working enhancement New feature or request and removed bug Something isn't working labels Jul 2, 2022
@marshada
Copy link

Revise this issue, to clarify the work required to put proper migration infrastucture in place. @kderme create a list or summary of the specific work items that are needed to improve migrations, and perhaps then create an epic and identify what improvements are a priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request product-backlog
Projects
None yet
Development

No branches or pull requests

2 participants