-
Notifications
You must be signed in to change notification settings - Fork 123
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
Make garbage collection configurable #355
Conversation
@@ -80,6 +80,21 @@ cassandra: | |||
size: | |||
newGenSize: | |||
|
|||
gc: |
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.
Why this sort of structure? Now we prevent use of ZGC or Shenandoah. I think I'd rather see a ConfigMap or such to make sure the user has to actually understand what they're doing (by having to define the parameters themselves).
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.
We cannot simply use a ConfigMap. We have to work within the constraints of the config-builder since that is what generate the jvm-options
for 3.11 or the jvm8-server.options
or jvm11-server.options
for 4.0. We will need to update config-builder to support additional garbage collectors.
c2c151d
to
e0da6d7
Compare
This PR only adds support for CMS and G1. Config files are created by cass-config-builder and that is all it currently supports. This PR got a lot more involved than I was expecting. See here for an explanation of the logic. |
Makefile
Outdated
@@ -23,6 +23,9 @@ test: fmt vet | |||
integ-test: | |||
go test -v -test.timeout=5m ./tests/integration/... -coverprofile cover.out | |||
|
|||
test-gc: fmt vet |
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.
Any reason we would need to separate these tests?
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 need to add a comment. I didn't want or need to run all the tests and I didn't want to manually keep typing -args -ginkgo.focus=".*garbage\ collection.*"
. It might be helpful to help additional Makefile targets for running subsets of the tests. I am also fine with removing if you think it is confusing.
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.
Actually, as a total newbie to running these tests for the first time last week I would have loved to at least have an example of how to target the test suite so that I wouldn't have to wait through and sift through the logging for all of them. I think this would be a good add if for nothing else than that purpose.
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 would like to add similar, targets for other tests. The verbose output is painful at times. I looked before briefly at cut down the output to just failures but I was unsuccessful.
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 alternative (while doing development) is to make the test use a F
infront of the test. For example: FContext(..
and then it will only run those focus ones (not others).
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 alternative (while doing development) is to make the test use a F infront of the test
Do I need to remove the F
if I want to remove the focus? If so, that is not a great general solution.
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. It's intended for development time focusing.
# the datacenter level. | ||
gc: | ||
# -- GC configuration for the CMS collector. | ||
cms: {} |
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.
Out of interest, do users have any idea how to configure these in yaml? Or do we need to write documentation to indicate how it's done? I would say it's not clear to the user what the {}
part means in this case. Should it remain? Should it be removed if I enable one parameter? Should the parameters be appended inside the {}
?
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.
This is mostly critique to Helm (and yaml of course), but we'll probably need to explain this - users want to install Cassandra in the end, not learn yaml.
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.
These are good questions. I could have used an empty string instead. I chose {}
because I have seen that in other charts. To me it indicates that the property has child properties. Will that be clear to the k8ssandra users, particularly those with little or no prior Helm experience? Doubtful. We need to document it.
waitDuration: 11000 | ||
|
||
datacenters: | ||
- name: dc1 |
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.
Just a sidenote, but for future we'll probably want to move this sequence to yaml map. Would make those set commands also so much more simple, like changing just --set datacenter.{dc1}.size=5
instead of having to modify the .yaml file to get that size changed if I want modify a single parameter.
datacenters:
"dc1":
size: 3 .. etc
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.
Not related to this PR, but I was wondering if we should do that before 1.0 ..
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 see the upside of a more dynamic approach. In some regards it is less maintenance. The user is free to add arbitrary properties which don't require any code updates in k8ssandra. It gives the user more flexibility and reduces maintenance burden on the code base in some regards.
There are some downsides though. First, the user has to understand what values are supported by cass-config-builder. It does not expect arbitrary values from cassandra.yaml and from jvm.options.
Secondly, a yaml map would make parsing harder. While users could supply arbitrary values, we would need to verify that those values match what is expected/allow by cass-config-builder.
Ultimately I do think we should provide a hook of some sorts to allow users to set arbitrary values even if it does mean understanding cass-config-builder. I would consider this applicable for advanced use cases.
Lastly, I hope we will be able to put some higher level abstractions in place that could free the user from worrying about some of these settings.
Makefile
Outdated
@@ -23,6 +23,9 @@ test: fmt vet | |||
integ-test: | |||
go test -v -test.timeout=5m ./tests/integration/... -coverprofile cover.out | |||
|
|||
test-gc: fmt vet |
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 alternative (while doing development) is to make the test use a F
infront of the test. For example: FContext(..
and then it will only run those focus ones (not others).
@burmanm @adejanovski can you do another review of this? Note that the PR exposes what is available through cass-config-definitions which is a subset of all available options. |
* initial support for configuring GC * refactor GC related code into helper templates * add support for DC-level config and refactor templates * add tests, big refactoring of k8ssandra.configureGc template * update tests * add more tests, add comments, add helper test target in Makefile * add comments and bump chart version * removing Makefile helper target, see k8ssandra#398
What this PR does:
Makes GC configurable
Which issue(s) this PR fixes:
Fixes #220
Checklist