-
Notifications
You must be signed in to change notification settings - Fork 42
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
Plan proposal for future of fs-repo-migrations #98
Comments
Modifications to the proposal:
The code for the common library described by 4 should live in |
This feature (overhaul of migrations) is implemented in the following PRs:
All tests are currently passing using a temporary IPFS distribution (/ipfs/QmXt92hFRuvQgFhgHoaMxC4wLFcvKsCywQPTNmPYCGfEV4). After the distributions PR is merged, we can then publish a new official distribution, pin that, and point our distribution site at it. |
Work on this feature is completed and deployed. Closing. |
State of the art
fs-repo-migrations
is a binary that knows how to migrate repository versions since version 1 to soon-to-be version 9.Each individual migration is a go-module (and a go executable) but they are all wired together in
fs-repo-migrations
, which is published on dist.ipfs.io and consumed byipfs
andipfs-update
(in very similar ways) when a migration is necessary (either by http-download or by ipfs-download).Each migration module needs to be built offline, and they use vendored dependencies. Due to the long history of migrations, these includes library copy-pastes added as extra modules, gxed-vendored dependencies added as submodules and go-mod vendored dependencies.
Migrations are mostly tested with single, non vendored sharness tests, with some deps depending on iptb.
Current problems
fs-repo-migrations
binary is now 54M (to version 7), soon to growinit()
ed ONCE. Multiple subpackages may vendor different versions and then fail badly. This needs patching across all migrations to prevent init() from happening or to align the libraries./net/trace
(if I remember well) do not allow multiple versions and fail. This requires alignment between all submodules.Proposal
We should make it easy for anyone to drop in and write a migration. Migration code should be fully isolated and testable in isolation. We should prevent having to touch any of the old migrations, or to having to adjust test things which affect all migrations and end up becoming a time sink on the developer.
Thus:
fs-repo-migrations
binary is deprecated and we stop using it. We build migration-specific binaries for all migrations.ipfs-version-to-version
. Tests for new migrations (sharness or not) are added in the submodule directly for new migrationsgo-migrations.ipfs.io
(using the same mechanism as dist.ipfs.io).This is not much work but, I hope, will facilitate the life of anyone needing to write a migration in the future a lot.
The text was updated successfully, but these errors were encountered: