-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Create an utility for IPFS Repo migrations #1115
Comments
I don't necessarily agree with the automatically part since that a bad repo migration might lead to data corruption. Of course, we will always strive to make it correct, but the user should be informed and make the decision. This wasn't an issue before because there is a tool just for that -- https://github.com/ipfs/fs-repo-migrations --, but know that we have long-running browser applications such as PeerPad, we do need one in JavaScript as well 👍 |
A separate migration tool can be created, but we'll end up with these apps always including this if they want to be able to survive repo upgrades.. |
A good idea would be auto-migration and adding an option such as "disableAutoMigration" that would make IPFS throw an error if it needs to migrate such that the application could ask the user to backup the data first, etc. |
I was just coming here to also give the flag idea :) thanks @mkg20001 :) |
I'm a big +1 on this. We're working on adding js-ipfs to ipfs-companion and we're going to want to upgrade js-ipfs regularly. Any app developer that uses js-ipfs as a dep is going to need repo migration for existing users. I'd rather ask js-ipfs to do that migration than have to hand roll it with less context at the app level. |
Hey there, My proposal is to create a separate package (for example "js-ipfs-repo-migrator"?) which will hold all the migrations and ability to execute them. These are the following features/requirements I thought of:
Let me know if there are more requirements from your side and if I can start working on it. |
Just noticed that @achingbrain is assigned to this. What is the status of it @achingbrain ? Are you working on it? |
Any update? Go/no-go please? |
I am working on this here https://github.com/AuHau/js-ipfs-repo-migrations Hopefully next week there will be a first version to review. |
@AuHau ❤️ thanks for picking this up! Apologies for the lack of responses - I somehow missed the notifications on this thread. We had this on our list for Q1 2019 but so far no progress. I think your list of requirements is great and I'm glad you have knowledge of the go-ipfs repo migration implementation as I was going to suggest that where possible it should have the same or similar functionality. In addition to your requirements I'd add:
Requirements I need to double check on but if you have opinions I'm interested to hear:
Can I also request that when you add code to |
Yey, thanks for the reply! ❤️ Most of the additional requirements are already incorporated or are planned, so I think we are in sync here! There are few questions&comments from my side. Currently, how I have designed it is that the migration will receive Regarding the bundle size, definitely, agree. There is one somehow related thing. The go-ipfs migration tool requires to have all dependencies bundled with the migration to ensure functional migrations in the future. I can completely understand the point of view and I have laid out a similar concept for the JS version, but this methodology might increase the bundle size quite significantly (well depends a bit on point of view). Currently, every migration has its own +1 on tests and documentation, that will be definitely part of it! Regarding the ability to migrate go-ipfs repo, I feel that the js-repo and go-repo are still quite diverse for supporting this (I don't have so deep understanding of the differences, but for example, the key management is very different in go-land from js-land). So I would not aim for that. I understand this tool as mean how to get to the point where the full interop will happen... From interop point of view, the versioning of the migrations should be same in both lands. But I feel like this will require some cooperation from the go-team as well, because I can imagine that there might be a point where there is something to migrate in js-land but nothing really to migrate in go-land or vice versa. Should there be then support for "empty migrations" which will just bump the version up, to match the other's land versioning? Lastly, I planned to create the PR when it is ready for review, is that alright or do you want me to create right away so you can track the advance? Also if you would like I can transfer the GitHub repo under IPFS org... PS.: I am developing it already against the async branches of the dependencies. |
Hmm now when I am thinking bit more about passing the
In some way, I like the simplicity of 2nd option, but it bit defers another rule from go-migration tool, that makes sense: "freeze migrations after publishing them" as it might happen that with js-ipfs-repo updates the (breaking) changes will have to be propagated to the old migrations... Any ideas? |
Well after some more work and thinking, I can reply to the previous question - having a dependency on js-ipfs-repo does not seem like a good idea and it does not make really sense. New question is, can the migrations depends on datastore interface? Eq. the migration would get either datastore-fs or datastore-level instance of the root of the repo folder? |
Hey there! You can find the PR here: ipfs/js-ipfs-repo-migrations#1 @alanshaw @achingbrain I have invited you to the repo so I could add you as reviewers. |
Also to see example of how migration will look like see: ipfs/js-ipfs-repo-migrations#2 |
@alanshaw @achingbrain so all PRs are ready for review: #2044 Fyi, I will be offline big part of June, so I can work on your remarks before cca June 10th or then in July. |
@AuHau gave you write access so that in the future you can do PRs from branches within the repo :) |
The current state of this small endeavor:
|
Resolves: #1115 Supersedes: #2044 Depends on: * [x] ipfs/js-ipfs-repo#202
chore: update ipld-dag-pb to the latest version
Repo migrations should, if possible, happen automatically.
This would minimize disruption on projects that are using long-running js-ipfs repos, like peerpad.
The text was updated successfully, but these errors were encountered: