-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Conversation
@@ -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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)
8857567
to
1366795
Compare
License: MIT Signed-off-by: Jeromy <why@ipfs.io>
Alright, here goes |
CHANGELOG: |
License: MIT
Signed-off-by: Jeromy why@ipfs.io