-
Notifications
You must be signed in to change notification settings - Fork 296
Fix setting jvm heap size params #1107
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
Fix setting jvm heap size params #1107
Conversation
Signed-off-by: patelsmit32123 <[email protected]>
cdcef6d to
9f6753d
Compare
|
@prudhvigodithi can you please review? |
| func AppendJvmHeapSizeSettings(jvm string, heapSizeSettings string) string { | ||
| if strings.Contains(jvm, "Xms") || strings.Contains(jvm, "Xmx") { | ||
| return jvm | ||
| } | ||
| if jvm == "" { | ||
| return heapSizeSettings | ||
| } | ||
| return fmt.Sprintf("%s %s", jvm, heapSizeSettings) | ||
| } |
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.
@patelsmit32123 This change works as expected. I tested it in my local lab.
Btw, I think this change causes the default heap size configuration to be ignored when either -Xms or -Xmx is already defined in JAVA_OPTS.
In other words, if a user sets a custom JAVA_OPTS containing -Xms or -Xmx, the operator won’t apply the default heap size anymore. That might be fine if intentional, but it also means users who only partially override Java options (e.g., setting -Xmx but not -Xms) will lose the default configuration for the missing value.
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.
yes, its intentional considering usually people provide both params
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.
@patelsmit32123 it would be good to consider all cases.
769cb91 to
9f6753d
Compare
|
Seeing the documentation https://github.com/opensearch-project/opensearch-k8s-operator/blob/main/docs/userguide/main.md
We can leverage jvm only to control the |
@prudhvigodithi Thank you for the suggestion. With this new approach, we’ll need to clearly define which configuration should take precedence. In particular, if users already specify heap size options under |
My opinion is also to not have multiple fields to handle jvm options. Also, there won't be any backward compatibility issues with approach of having just 1 field. |
|
@prudhvigodithi @josedev-union can we please finalize on the approach? |
|
After adding the jvm flag in our production Opensearch environment, the Heap setting was fixed to 1GB. I suffered from this issue. I'm glad it will be fix soon. |
### Issues Resolved Fixes opensearch-project#1106 ### Check List - [ ] Commits are signed per the DCO using --signoff - [ ] Unittest added for the new/changed functionality and all unit tests are successful - [ ] Customer-visible features documented - [ ] No linter warnings (`make lint`) If CRDs are changed: - [ ] CRD YAMLs updated (`make manifests`) and also copied into the helm chart - [ ] Changes to CRDs documented Please refer to the [PR guidelines](https://github.com/opensearch-project/opensearch-k8s-operator/blob/main/docs/developing.md#submitting-a-pr) before submitting this pull request. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check [here](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin). Signed-off-by: patelsmit32123 <[email protected]>
### Issues Resolved Fixes opensearch-project#1106 ### Check List - [ ] Commits are signed per the DCO using --signoff - [ ] Unittest added for the new/changed functionality and all unit tests are successful - [ ] Customer-visible features documented - [ ] No linter warnings (`make lint`) If CRDs are changed: - [ ] CRD YAMLs updated (`make manifests`) and also copied into the helm chart - [ ] Changes to CRDs documented Please refer to the [PR guidelines](https://github.com/opensearch-project/opensearch-k8s-operator/blob/main/docs/developing.md#submitting-a-pr) before submitting this pull request. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check [here](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin). Signed-off-by: patelsmit32123 <[email protected]>
Issues Resolved
Fixes #1106
Check List
make lint)If CRDs are changed:
make manifests) and also copied into the helm chartPlease refer to the PR guidelines before submitting this pull request.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.