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

Use newer flatfs sharding scheme #3608

Merged
merged 1 commit into from
Jan 20, 2017
Merged

Conversation

whyrusleeping
Copy link
Member

@whyrusleeping whyrusleeping commented Jan 18, 2017

License: MIT
Signed-off-by: Jeromy why@ipfs.io

@whyrusleeping whyrusleeping added this to the ipfs 0.4.5 milestone Jan 18, 2017
@RichardLitt RichardLitt added the status/in-progress In progress label Jan 18, 2017
@@ -35,7 +35,7 @@ func openDefaultDatastore(r *FSRepo) (repo.Datastore, error) {
syncfs := !r.config.Datastore.NoSync
// 5 bytes of prefix gives us 25 bits of freedom, 16 of which are taken by
// by the Qm prefix. Leaving us with 9 bits, or 512 way sharding
blocksDS, err := flatfs.New(path.Join(r.path, flatfsDirectory), 5, syncfs)
blocksDS, err := flatfs.CreateOrOpen(path.Join(r.path, flatfsDirectory), flatfs.NextToLast(2), syncfs)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment needs to be updated as well. (again)
If I understand correctly, that this is the last two base32 characters, it's 10 bits of sharding.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mateon1 good catch on the comment. Yeah, its the second to last two base32 characters (since the last character doesnt have 10 full bits of entropy)

@whyrusleeping whyrusleeping force-pushed the feat/new-flatfs-sharding branch 4 times, most recently from 8857567 to 1366795 Compare January 19, 2017 22:56
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
@whyrusleeping whyrusleeping requested review from a user and Kubuxu January 19, 2017 23:07
@whyrusleeping
Copy link
Member Author

Alright, here goes

@whyrusleeping whyrusleeping merged commit f09bd5c into master Jan 20, 2017
@whyrusleeping whyrusleeping removed the status/in-progress In progress label Jan 20, 2017
@whyrusleeping
Copy link
Member Author

CHANGELOG:
fsrepo version 5, new flatfs sharding scheme.

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

Successfully merging this pull request may close these issues.

4 participants