[kafka] Upgrade Cruise Control to 3.0.4 for Java 17 and Java 21 support - #1403
jitender-goyal wants to merge 1 commit into
Conversation
jitender-goyal
commented
Sep 9, 2026
- Upgraded default CRUISE_CONTROL_VERSION to 3.0.4
- Added Java 21 and Gradle 8.5 compatibility
- Replaced hardcoded reporter jar path with wildcard cruise-control-metrics-reporter-*.jar
- Added --add-opens JVM options to KAFKA_OPTS for runtime reflection on Java 17+
- Preserved legacy build.gradle injection only for older 2.0.x branches
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request updates the default Cruise Control version to 3.0.4 to support Java 17 and 21, conditionally applies legacy build patches for older versions, and adds JVM reflection options for modern Java runtimes. The review feedback suggests ensuring backward compatibility with Java 8 by conditionally applying the --add-opens JVM options, broadening the legacy version check regex to support all 2.x versions, and using a more specific file selection instead of a wildcard to avoid copying auxiliary jars to the Kafka classpath.
641adc3 to
311dab3
Compare
| readonly ROLE="$(/usr/share/google/get_metadata_value attributes/dataproc-role)" | ||
| readonly CRUISE_CONTROL_VERSION="$(/usr/share/google/get_metadata_value attributes/cruise-control-version || echo 2.0.37)" | ||
| # Default to 3.0.4 for Java 17 and Java 21 compatibility (Gradle 8.5, Scala 2.13, Kafka 3.5+) | ||
| readonly CRUISE_CONTROL_VERSION="$(/usr/share/google/get_metadata_value attributes/cruise-control-version || echo 3.0.4)" |
There was a problem hiding this comment.
will this version work for older dataproc versions ?
| reports { | ||
| xml.enabled (project.hasProperty('xmlFindBugsReport')) | ||
| html.enabled (!project.hasProperty('xmlFindBugsReport')) | ||
| xml.enabled = false |
There was a problem hiding this comment.
earlier this value was fetched from project.hasProperty('xmlFindBugsReport'), how do we that this value will always be false.
| cp ${CRUISE_CONTROL_HOME}/cruise-control-metrics-reporter/build/libs/cruise-control-metrics-reporter-2.0.38-SNAPSHOT.jar \ | ||
| ${KAFKA_HOME}/libs | ||
| cat >>${KAFKA_CONFIG_FILE} <<EOF | ||
| find "${CRUISE_CONTROL_HOME}"/cruise-control-metrics-reporter/build/libs/ -name "cruise-control-metrics-reporter-*.jar" ! -name "*-sources.jar" ! -name "*-javadoc.jar" ! -name "*-tests.jar" -exec cp {} "${KAFKA_HOME}/libs" \; |
There was a problem hiding this comment.
earlier 2.0.38 was used, is the new version working for ld dataproc versions
There was a problem hiding this comment.
This is backward compatible, Will pick the jar according to the cruise control version
| echo "Start Cruise Control server on ${HOSTNAME}." | ||
| pushd ${CRUISE_CONTROL_HOME} | ||
| pushd "${CRUISE_CONTROL_HOME}" | ||
| # Ensure necessary opens for modern Java (Java 9+) runtime reflection |
There was a problem hiding this comment.
is this required for older dataproc versions
311dab3 to
bb9c9d8
Compare
- Upgraded default CRUISE_CONTROL_VERSION to 3.0.4 (Gradle 8.5, Scala 2.13, Kafka 3.5+) - Conditionally applied legacy build patches only for older 2.x releases - Filtered auxiliary jars (sources, javadoc, tests) when copying metrics reporter jar to Kafka classpath - Conditionally added --add-opens JVM options to KAFKA_OPTS for Java 9+ runtimes
bb9c9d8 to
323f4e4
Compare