Skip to content

Conversation

gzimin
Copy link
Contributor

@gzimin gzimin commented Jan 28, 2025

  • make all fields as strings, in other cases boolean values with "false" skipped as zero value.
  • fix configuration name for jmx remote port
Q A
Bug fix? [x]
New feature? []
API breaks? []
Deprecations? []
Related tickets fixes #X, partially #Y, mentioned in #Z
License Apache 2.0

What's in this PR?

Fixes for previous pull-request with new JXM parameters.

Why?

Previous patch has some issues

Additional context

Checklist

  • [ x] Implementation tested
  • Logging code meets the guideline
  • User guide and development docs updated (if needed)
  • Append changelog

@gzimin
Copy link
Contributor Author

gzimin commented Jan 28, 2025

var JMXConfigurationMap = map[string]string{
"JMXRemote": "-Dcom.sun.management.jmxremote=",
"JMXRemotePort": "-Dcom.sun.management.jmxremote.port=",
"JMXRemotePort": "-Dcom.sun.management.jmxremote.rmi.port=",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why change it to rmi, can you point to some documentation that shows it's required ?

Copy link
Contributor Author

@gzimin gzimin Jan 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From cassandra-env.sh file:

else
JVM_OPTS="$JVM_OPTS -Dcassandra.jmx.remote.port=$JMX_PORT"

if ssl is enabled the same port cannot be used for both jmx and rmi so either

pick another value for this property or comment out to use a random port (though see CASSANDRA-7087 for origins)

JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.rmi.port=$JMX_PORT"

I didn't have a connection if I specified only jmxremote.port. It worked for me only with jmxremote.rmi.port

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update the patch where we specify both parameters with the same port.

Comment on lines 828 to 830
JMXRemotePort string `json:"jmxRemotePort,omitempty"`
// JXMRemoteSSL defines is SSL for JMX connections enabled or not
JXMRemoteSSL string `json:"jmxRemoteSSL,omitempty"`
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change those types ? why can't you make it work with the current types which make more sense ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with you, but with boolean types and with using omitempty when we specify these params as false they will be omitted. If we remove omitempty it will have default value as false.
We can use pointers here, but I thought that string values would be a more convenient way.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I think it makes more sense to keep it strongly typed and use pointers, thanks !

@AKamyshnikova AKamyshnikova self-requested a review January 29, 2025 10:26
* use pointers for bool fields to prevent omitting "false" values.
* add jmx RMI port parameter
@gzimin
Copy link
Contributor Author

gzimin commented Jan 29, 2025

I've updated patch, new e2e tests run - https://github.com/gzimin/casskop/actions/runs/13030664236

@gzimin gzimin requested a review from cscetbon January 29, 2025 12:20
@cscetbon cscetbon merged commit e3587af into cscetbon:master Feb 4, 2025
7 checks passed
@cscetbon
Copy link
Owner

cscetbon commented Feb 4, 2025

thank you @gzimin for your contributions !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants