Skip to content

Commit

Permalink
Correct jvm options per c* cersion
Browse files Browse the repository at this point in the history
  • Loading branch information
rzvoncek committed Oct 30, 2024
1 parent e63525c commit ddd6140
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,14 +226,17 @@ jobs:
# Write GCS service account credentials to a file
mkdir ~/.aws
# This fake cluster needs to be created first so that the integration tests pass in GH actions. Don't ask me why...
ccm create test_cluster -v binary:3.11.4 -n 1 --vnodes
ccm create test_cluster -v binary:${{ matrix.cassandra-version }} -n 1 --vnodes
ccm node1 updateconf 'storage_port: 7011'
ccm node1 updateconf 'concurrent_reads: 4'
ccm node1 updateconf 'concurrent_writes: 4'
ccm node1 updateconf 'concurrent_counter_writes: 4'
ccm node1 updateconf 'num_tokens: 4'
sed -i 's/#MAX_HEAP_SIZE="4G"/MAX_HEAP_SIZE="256m"/' ~/.ccm/test_cluster/node1/conf/cassandra-env.sh
sed -i 's/#HEAP_NEWSIZE="800M"/HEAP_NEWSIZE="200M"/' ~/.ccm/test_cluster/node1/conf/cassandra-env.sh
# remove the ThreadPriorityPolicy option for cases where we run with java 11
sed -i 's/-XX:ThreadPriorityPolicy=42//' ~/.ccm/test_cluster/node1/conf/jvm.options || true
sed -i 's/-XX:ThreadPriorityPolicy=42//' ~/.ccm/test_cluster/node1/conf/jvm8-serve.options || true
ccm start -v
ccm showlastlog|tail -100
ccm stop
Expand Down
14 changes: 9 additions & 5 deletions tests/integration/features/steps/integration_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def get_client_encryption_opts(keystore_path, trustore_path):
protocol: TLS,algorithm: SunX509,store_type: JKS,cipher_suites: [{cipher_suite}]}}'"""


def tune_ccm_settings(cluster_name, custom_settings=None):
def tune_ccm_settings(cassandra_version, cluster_name, custom_settings=None):
if os.uname().sysname == "Linux":
os.popen(
"""sed -i 's/#MAX_HEAP_SIZE="4G"/MAX_HEAP_SIZE="256m"/' ~/.ccm/"""
Expand All @@ -148,10 +148,14 @@ def tune_ccm_settings(cluster_name, custom_settings=None):
+ cluster_name
+ """/node1/conf/cassandra-env.sh"""
).read()
if cassandra_version.startswith("4") or cassandra_version.startswith("5"):
jvm_options_file = "jvm8-server.options"
else:
jvm_options_file = "jvm.options"
os.popen(
"""sed -i 's/-XX:ThreadPriorityPolicy=42//' ~/.ccm/"""
+ cluster_name
+ """/node1/conf/jvm.options"""
+ """/node1/conf/""" + jvm_options_file
)

# sed on some macos needs `-i .bak` instead of just `-i`
Expand Down Expand Up @@ -290,7 +294,7 @@ def _i_have_a_fresh_ccm_cluster_running(context, cluster_name, client_encryption
os.popen(update_client_encrytion_opts).read()

custom_settings = context.custom_settings if hasattr(context, 'custom_settings') else None
tune_ccm_settings(context.cluster_name, custom_settings)
tune_ccm_settings(context.cassandra_version, context.cluster_name, custom_settings)

context.session = connect_cassandra(is_client_encryption_enable)

Expand Down Expand Up @@ -340,7 +344,7 @@ def _i_have_a_fresh_ccm_cluster_with_jolokia_running(context, cluster_name, clie
)
shutil.copyfile("resources/grpc/jolokia-jvm-1.6.2-agent.jar", "/tmp/jolokia-jvm-1.6.2-agent.jar")

tune_ccm_settings(context.cluster_name)
tune_ccm_settings(context.cassandra_version, context.cluster_name)
context.session = connect_cassandra(is_client_encryption_enable)


Expand Down Expand Up @@ -375,7 +379,7 @@ def _i_have_a_fresh_ccm_cluster_with_mgmt_api_running(context, cluster_name, cli
update_client_encrytion_opts = get_client_encryption_opts(keystore_path, trustore_path)
os.popen(update_client_encrytion_opts).read()

tune_ccm_settings(context.cluster_name)
tune_ccm_settings(context.cassandra_version, context.cluster_name)
context.session = connect_cassandra(is_client_encryption_enable)
# stop the node via CCM as it needs to be started by the Management API
os.popen(CCM_STOP).read()
Expand Down

0 comments on commit ddd6140

Please sign in to comment.