-
Notifications
You must be signed in to change notification settings - Fork 59
Add support for Consul as store engine #240
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
Conversation
@borismartinovic01 Thanks for your contribution. The CI failed due to forgetting to add Another concern is [1] https://github.com/hashicorp/consul?tab=License-1-ov-file#readme |
Awesome, we use kvrocks at consul+nomad cluster and very need this feature |
Okay, I wasn't aware of the license issues. |
Yeah it seems https://github.com/hashicorp/consul is licensed under BSL, which is not an open-source license and not allowed by ASF to be used as a direct dependency of an ASF project. (Ahh sorry, the However, I think there may be several ways to workaround it (one of these two below):
I'm not an expert in this area. See if @tisonkun has any comment. |
Sorry for clicking wrong button : ) |
After carefully reading the content of Category B, it appears that the main restriction is that our source releases should not include MPL source files. As kvrocks-controller is a golang project, we typically do not include these dependent source files in the source release, but instead we only specify the version and origin of dependencies through |
Hmm.. I think we can continue to review this PR, and merge it after approving by reviewers. We'll handle further issues if there's any concern from the ASF. @borismartinovic01 Thank you for your contribution, and I think for now you don't need to remove these MPL dependencies. But you can review these newly introduced dependencies again to prevent other issues. |
go.mod
Outdated
@@ -45,6 +46,15 @@ require ( | |||
github.com/goccy/go-json v0.10.2 // indirect | |||
github.com/gogo/protobuf v1.3.2 // indirect | |||
github.com/golang/protobuf v1.5.4 // indirect | |||
github.com/hashicorp/consul/api v1.31.0 // indirect |
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.
It shouldn't be an "indirect" dependency.
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.
Could you also add an example config file in https://github.com/apache/kvrocks-controller/tree/unstable/config?
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## unstable #240 +/- ##
============================================
+ Coverage 43.38% 46.77% +3.39%
============================================
Files 37 43 +6
Lines 2971 3878 +907
============================================
+ Hits 1289 1814 +525
- Misses 1544 1873 +329
- Partials 138 191 +53
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
PTAL @git-hulk
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
Raft tests failed. This is not very clear to me. Do you have any information on why this is happening? |
@borismartinovic01 No worry about this. I have rerun the CI since it's not related to this PR: #245 |
Thank you for your contribution! |
This PR introduces
Consul
as a store engine and tries to align the implementation with the implementations ofetcd
andzookeeper
as much as possible.Constants description:
sessionTTL = 10 seconds
- Minimum required by ConsullockDelay = 1 millisecond
- Consul defines a default lock delay of 15 seconds. In the docs it is mentioned that this can be disabled by setting this param to zero value but looking at the source code of Consul's session.go implementation this is not possible, so it is set to the minimum that's bigger than zero valuedefaultElectPath = "kvrocks/controller/leader"
- Removed the backslash from the beginning since Consul requires keys not to start with a backslash.Testing
Tests were kept almost the same as for etcd and zookeeper except the backslash was removed from keys due to limitation mentioned above and wait duration was increased from 15 to 25 seconds in the second test since the sessionTTL is a bit bigger.