Netflix / Priam

Co-Process for backup/recovery, Token Management, and Centralized Configuration management for Cassandra.
Apache License 2.0
1.03k stars 294 forks source link

inject jvm options #1089

Closed jrwest closed 4 months ago

jrwest commented 5 months ago

upsert uses commas as the delimiter between options which doesn't work for a few C* options that use commas in the value.

Inject works by taking the string and adding it to the end of the jvm-server.options file verbatim. While the comments in that file say it expects one option per line there is nothing that actually enforces that rule. The line only needs to start with a '-'

Code that parses the options file:

JVM_OPTS_FILE=$CASSANDRA_CONF/jvm${jvmoptions_variant:--clients}.options if [ $JAVA_VERSION -ge 11 ] ; then
    JVM_DEP_OPTS_FILE=$CASSANDRA_CONF/jvm11${jvmoptions_variant:--clients}.options
else
    JVM_DEP_OPTS_FILE=$CASSANDRA_CONF/jvm8${jvmoptions_variant:--clients}.options
fi

for opt in `grep "^-" $JVM_OPTS_FILE` `grep "^-" $JVM_DEP_OPTS_FILE` do
  JVM_OPTS="$JVM_OPTS $opt"
done