-
-
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
more configurable datastore configs #3575
Conversation
4d1bef1
to
0c224c7
Compare
06e62c3
to
10eabf3
Compare
@Kubuxu could I get some early review on this? |
10eabf3
to
b962c86
Compare
This branch allows for usage for new experimental datastore (sbs). To use it you have to create new fresh repo. ipfs init --empty-repo
ipfs config --json Datastore.Spec '{"mounts":[{"child":{"path":"blocks","type":"sbs"},"mountpoint":"/blocks","prefix":"flatfs.datastore","type":"measure"},{"child":{"compression":"none","path":"datastore","type":"levelds"},"mountpoint":"/","prefix":"leveldb.datastore","type":"measure"}],"type":"mount"}' |
@Kubuxu nice work so far :) As an aside, we should look at adding json omitempty tags to the config fields we're deprecating, and start planning a migration path. I think we can pretty easily migrate people from the current format forward into the new format with an fs-repo-migration. At the same time we should adjust for 'new defaults' like the CORS thing that people who init'ed with old nodes might not have. Perhaps with this migration, we even move the private key out of the config?? |
Idea: Maybe try and ship this code in 0.4.8 (perhaps minus the sbs stuff for now) but keep the default config the same. Then in 0.4.9 we can have a migration to update everyone to the new format |
sigh this keeps slipping. I really want to get it in soon... |
@whyrusleeping is there anything I can do to help here? |
@whyrusleeping @Kubuxu Should I should drop the "--wip--" commit also? |
a23eb2a
to
4cd09ce
Compare
repo/config/datastore.go
Outdated
type FlatDS struct { | ||
Path string | ||
ShardFunc string | ||
Sync bool |
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.
So we changed this from NoSync to Sync, was this intentional? Is the default now not to enable Sync?
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.
And and closer inspection it appears that this data structure isn't even used...
repo/config/init.go
Outdated
"child": map[string]interface{}{ | ||
"type": "flatfs", | ||
"path": "blocks", | ||
"nosync": false, |
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.
I might be misunderstanding something, but should't this be "sync": true
now?
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.
yeah, this should probably be sync true now
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.
except we still check for "nosync" still in the code, one sec, I leave a comment by that code.
I dropped the last two commits, they are saved on |
A few notes before I am ready to finish this:
|
@kevina yeah, i think we can remove the datastore specific structs. I wrote those before i figured out how this was gonna work. We can just use the interface map stuff. Checking for 'disallowed keys' might be nice, though not super simple to do. If you want to, go ahead and add this checking, otherwise leave it unchecked. your '3' SGTM |
repo/fsrepo/datastores.go
Outdated
return nil, err | ||
} | ||
|
||
return flatfs.CreateOrOpen(p, shardFun, params["nosync"].(bool)) |
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.
Okay so here is where we check for "nosync" except that CreateOrOpen parameter is to sync, no "nosync" so this is a bug as written and I am okay with changing it to "sync".
@whyrusleeping oops, forgot about that will push a fix shortly and update the conversion code |
@whyrusleeping I am not sure I agree that "Spec" should be lowercase, the config now looks like this:
If you think that is better I will go ahead and push the change and fix the conversion code. |
I don't think it is better because all the other fields under the Datastore config are title case (i.e capitalized) with just "spec" being lower case. |
@kevina hrm.... yeah... youre right. We definitely should (at some point in the future) make the config look nicer. |
So leave things as they are for now, with "Spec" being capitalized? |
@kevina yeah. This PR is RFM, would be nice to get an approval from @Kubuxu and @Stebalien, but once we have a release ready for the fs-repo-migrations (pending some config changes @lgierth wanted to add) we can ship this finally :) |
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.
LGTM (sorry, I thought I checked the approve checkbox before).
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com> make things super customizable License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com> better json format License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com> Migrate to new flatfs License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
…ault License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
7e4bcae
to
19730d4
Compare
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
ea4ce27
to
2c30002
Compare
Closes #3575