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

local repo format migrations #537

Closed
jbenet opened this issue Jan 11, 2015 · 4 comments
Closed

local repo format migrations #537

jbenet opened this issue Jan 11, 2015 · 4 comments
Labels
topic/repo Topic repo

Comments

@jbenet
Copy link
Member

jbenet commented Jan 11, 2015

though this should rarely happen, sometimes we'll need to change formats of the repository files; this includes config key changes, and data inside leveldb. we should never break people's objects, so that means we need to handle these upgrades with great care.

We probably should use something like a repo-version with migrations. one possible way to do this is: we have a single repo version, every time we make format change we increment the repo version, and add a tool repo_migrate_<old>2<new> that performs the update. We should then be able to apply each script in sequence.

It would be easiest to write these in go, given much of the formatting will have to do with datastore keys or protobufs. things that would make this easier:

  • a datastore tool (cli tool to manipulate arbitrary datastores)
  • a repo tool (standalone tool that understands config, datastore, blockstore, + merkledag) and can manipulate them.
@jbenet
Copy link
Member Author

jbenet commented Jan 12, 2015

I wrote down some generalized thoughts on repos + migrations here: jbenet/random-ideas#33 -- i'd like to see go-ipfs have something like this:

> ls ipfs/bin/repo-migrations
1-to-2
2-to-3
3-to-4
4-to-5
5-to-6
6-to-7

> ipfs/bin/repo-migrations/1-to-2
repository version: 3
already up to date.

> ipfs/bin/repo-migrations/3-to-4
repository version: 3
applying path: 3-to-4
repository version: 4

> ipfs/bin/repo-migrations/3-to-4 --revert
repository version: 4
applying patch: 4-to-3
repository version: 3

> ipfs/bin/repo-migrations/run 1-to-7
repository version: 3
applying patch: 3-to-4
applying patch: 4-to-5
applying patch: 5-to-6
applying patch: 6-to-7
repository version: 7

@whyrusleeping
Copy link
Member

i dont care about migrations until we alpha

@jbenet
Copy link
Member Author

jbenet commented Mar 12, 2015

From now on we need to do migrations when changing the repo layout.

@whyrusleeping
Copy link
Member

we do migrations now, it works: https://github.com/ipfs/fs-repo-migrations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/repo Topic repo
Projects
None yet
Development

No branches or pull requests

2 participants