-
Notifications
You must be signed in to change notification settings - Fork 23
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
Upgrade badger dependency #12
Comments
Hey @francislavoie in order to support this I think we'd need badgerv3 support in nosql. I just tried doing a simple upgrade and it seems that the API has changed in some breaking ways (which is to be expected). If someone who understands the new Badger options wanted to take a look to porting our codebase to work with the new API we'd be very grateful. Otherwise it will be some time until we have the cycles to explore ourselves. Specific questions I have:
This is the current code. How should it be updated to work with the new options?
|
I reached out in https://discuss.dgraph.io/t/use-pure-go-zstd-implementation/8670/19 in case they're able to help. |
Awesome! That would be great. |
Implementing this would help on 3rd party projects smallstep/certificates#358. |
Hey @dopey, badger v3 is not compatible with v2 as mentioned in the release notes . There are changes in the on-disk format.
|
Hey @NamanJain8 thanks for the quick reply and apologies for my radio silence.
I'm not sure if this will be an issue for us. We introduced a That's the only attribute we explicitly map from our With regards to a migration script - it's a nice to have, but not a blocker. |
Hey @dopey.
No, we can't use FileIO mode in badger v3. The value log loading mode was removed from badger in dgraph-io/badger#1555. @jarifibrahim do you know why it was removed? I think it was because it was affecting the changed flow of how badger handles writes. |
@dopey @NamanJain8 instead of supporting multiple versions of badger at the same time with all the problems that it has, we might want to only support one and create a program that migrates v1, v2 to the supported version, v3 for example. For example starting with 0.16 we can say that we only support v3, and perhaps in 0.19 we can use a v4. |
@NamanJain8 Do you know what this would mean for users who currently require this mode due to memory constrained environments? If badgerv3 won't support those environments, then @maraino we will need to keep badgerv2 around to support those users. |
I think we can just support an option in Badger to disable value log completely. Dgraph largely doesn't use value log anymore anyway, because the disk requirements with value log are unpredictable. That'd then allow people with resource constrained environments to run Badger. Feel free to open an issue in Badger for this. |
Not to be a bother, but would it be possible to move this along? Some users of Caddy are seeing issues build Caddy with specific plugins because of strange issues like this:
The PR #13 to upgrade to a more recent v2 would at minimum help move this in the right direction, fixing some of the issues we've seen. Upgrading to badger v3 would be the ultimate fix, in that it would finally remove the |
I'm testing the V2 PR as we speak. With regards to upgrading to V3, without the valuelogloading mode change in Badger this would be a backwards incompatible change for |
Fair enough. In that case, @manishrjain is there any chance that the |
Making a new release of smallstep/certificates now. edit: Unless you'd prefer I wait on the |
Considering there's no PR for backporting |
v0.16.1 smallstep/certificates is building. As a dependency, you should already be able to reference it. Most of the release packages and binaries won't be available for another 15 minutes. |
Thanks @dopey! We'll update Caddy shortly. I wrote a quick backport PR dgraph-io/badger#1736 since it looked pretty easy (combining the changes from two other PRs, the code hadn't diverged significantly between v2 and v3 when it came to zstd) |
See smallstep/nosql#12 for context.
See smallstep/nosql#12 for context.
…std (#1736) Backports the changes from #1706 and #1709 to the v2 branch of badger. For context, https://github.com/caddyserver/caddy uses https://github.com/smallstep/certificates which uses https://github.com/smallstep/nosql which uses badger. See smallstep/nosql#12 for the discussion. It's not currently viable for smallstep to upgrade from v2 to v3 of badger, so it would be nice to backport this zstd change to the v2 branch to remove the implicit (yet optional) CGO dependency on Caddy. I targeted the release/v2.2007 branch, I couldn't really see a more relevant branch to target, so I hope that's okay.
@dopey https://github.com/dgraph-io/badger/releases/tag/v2.2007.4 has been tagged, which backports the zstd change and a fix for building on Plan9. Could you bump the dependency in |
@francislavoie Just tagged v0.16.3. Edit 1: Actually, hold off. Forgot to bump the version of nosql when I did that :<. Gimme another minute. Edit 2: Ok, v0.16.4 pushed. |
Awesome!! I'll update Caddy now! |
See smallstep/nosql#12 for context.
See smallstep/nosql#12 for context.
For the purpose of Caddy, this is satisfied at this point! I'll close this I suppose. Thanks for the help everyone! |
On https://github.com/caddyserver/caddy, we've had trouble in the past with having to explicitly set
CGO_ENABLED=0
to build Caddy, since we've hadDataDog/zstd
as an indirect dependency throughsmallstep/nosql
->dgraph-io/badger/v2
->DataDog/zstd
, because thatzstd
implementation is not pure-Go.Just today, badger has merged a PR to replace
DataDog/zstd
with a pure-Gozstd
inklauspost/compress
, so this should no longer be an issue. See the discussion on dgraph-io/badger#1383, followed by the full replacement (merged today) in dgraph-io/badger#1709.So it would be great if
smallstep/nosql
could update its dependency on badger to the latest, so that projects like Caddy that depend on it can get rid of this last non-pure-Go dependency.The text was updated successfully, but these errors were encountered: