Skip to content

AMBARI-26641: Separate Ambari and stack JDK configuration after JDK 17 upgrade - #4188

Merged
JiaLiangC merged 10 commits into
apache:trunkfrom
JiaLiangC:AMBARI-26641
Sep 1, 2026
Merged

AMBARI-26641: Separate Ambari and stack JDK configuration after JDK 17 upgrade#4188
JiaLiangC merged 10 commits into
apache:trunkfrom
JiaLiangC:AMBARI-26641

Conversation

@JiaLiangC

@JiaLiangC JiaLiangC commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Issue: AMBARI-26641

What changes were proposed in this pull request?

Separate Java selection into three layers:

  1. ambari.java.home and ambari.java.version for Ambari Server and Ambari-owned Agent Java helpers.
  2. stack.java.home and stack.java.version for the default stack service JDK, with compatibility fallback through the legacy java.home setting.
  3. BIGTOP cluster-env/java_home_overrides for pre-installed service or component JDKs, with component entries taking precedence and invalid entries falling back to the stack JDK.

The patch also migrates existing setup and upgrade properties, validates actual Java feature versions during setup and host checks, keeps database and credential helpers on the Ambari JDK, updates JDK-compatible BIGTOP GC settings, exposes the effective Java metadata, and updates the classic and React installation workflows. Windows behavior is intentionally outside this change.

How was this patch tested?

Static checks passed for git diff --check, the two modified XML files with xmllint --noout, modified Python files with py_compile (excluding the existing Python 2 preinstall checker), modified classic JavaScript files with node --check, the React TypeScript production build, and focused React lint. No Ember tests were run.

Focused Agent Python tests, 6 passed:

docker exec \
  -e PYTHONDONTWRITEBYTECODE=1 \
  -e PYTHONPATH=/workspace/ambari-common/src/main/python:/workspace/ambari-agent/src/main/python:/workspace/ambari-agent/src/main/python/ambari_agent:/workspace/ambari-common/src/main/python/ambari_jinja2:/workspace/ambari-common/src/main/python/ambari_commons:/workspace/ambari-common/src/test/python:/workspace/ambari-agent/src/test/python:/workspace/ambari-agent/src/test/python/ambari_agent:/workspace/ambari-agent/src/main/python/resource_management:/workspace/ambari-agent/src/test/python/resource_management:/workspace/ambari-server/src/test/python:/workspace/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/files \
  ambari-jdk17-focused-tests bash -lc \
  'cd /workspace/ambari-agent/src/test/python/ambari_agent && ambari-builder-python -m unittest TestConfigurationBuilder.TestConfigurationBuilder'

Focused Server setup, upgrade, Java discovery, and host-check Python tests, 10 passed:

docker exec \
  -e PYTHONDONTWRITEBYTECODE=1 \
  -e PYTHONPATH=/workspace/ambari-common/src/main/python:/workspace/ambari-agent/src/main/python:/workspace/ambari-agent/src/main/python/ambari_agent:/workspace/ambari-common/src/main/python/ambari_jinja2:/workspace/ambari-common/src/main/python/ambari_commons:/workspace/ambari-common/src/test/python:/workspace/ambari-server/src/main/python:/workspace/ambari-server/src/main/python/ambari-server-state:/workspace/ambari-server/src/main/resources/custom_actions:/workspace/ambari-server/src/main/resources/custom_actions/scripts:/workspace/ambari-server/src/main/resources/scripts:/workspace/ambari-server/src/test/python:/workspace/ambari-server/src/test/python/custom_actions \
  ambari-jdk17-focused-tests bash -lc \
  'cd /workspace/ambari-server/src/test/python && ambari-builder-python -m unittest TestAmbariServer.TestAmbariServer.test_download_jdk TestAmbariServer.TestAmbariServer.test_check_ambari_java_version_is_valid TestAmbariServer.TestAmbariServer.test_jdk_setup_keeps_ambari_and_stack_java_independent TestAmbariServer.TestAmbariServer.test_jdk_setup_validates_all_java_homes_before_updating_properties TestAmbariServer.TestAmbariServer.test_find_jdk TestAmbariServer.TestAmbariServer.test_find_jdk_skips_versions_below_minimum TestAmbariServer.TestAmbariServer.test_get_java_version TestAmbariServer.TestAmbariServer.test_migrate_java_home_properties custom_actions.TestCheckHost.TestCheckHost.testJavaHomeAvailableCheck custom_actions.TestCheckHost.TestCheckHost.testJavaHomeAvailableCheckRejectsWrongVersion'

Focused Java tests under JDK 17, 93 passed:

mvn -pl ambari-server \
  -Dtest=ConfigurationTest,StageUtilsTest,RootServiceResponseFactoryTest \
  -DfailIfNoTests=false \
  compiler:compile compiler:testCompile surefire:test

Focused React tests, 4 files and 21 tests passed:

npx vitest run \
  src/hooks/useHostChecks.test.tsx \
  src/screens/ClusterWizard/versionSelection.test.ts \
  src/screens/CommonConfigs/TestConnection.test.tsx \
  src/screens/CommonConfigs/testConnectionUtils.test.ts

An Ambari-only Rocky 8 aarch64 RPM build completed successfully from the implementation commit. Its verified manifest contains only ambari-agent and ambari-server; no Hadoop ecosystem package was rebuilt. A three-node BIGTOP 3.3.0 cluster was then deployed from the digest-pinned preloaded runtime image with ZooKeeper, HDFS, YARN, Hive, and HBase. All 13 deploy phases completed successfully.

Live validation confirmed:

  • Ambari Server runs JDK 17 and reports ambari.java.home/version=17 while stack.java.home/version=8.
  • Agent metadata carries both JDK layers, and Agent JCEKS CredentialShell helpers actually executed with the Ambari JDK 17 path.
  • ZooKeeper, HDFS, YARN, Hive, and HBase initially ran on the stack JDK 8.
  • A ZOOKEEPER=JDK 8 service override plus ZOOKEEPER_SERVER=JDK 17 component override moved one restarted ZooKeeper process to JDK 17 while NameNode and DataNode on the same host remained on JDK 8.
  • The structured java_home_check action passed on all three hosts and reported the expected JDK 17 feature version, vendor, runtime, and executable home.

The first local topology included Metrics but deploy generated VICTORIAMETRICS_SERVER, which is not present in current Ambari trunk. Metrics was removed from this JDK-focused deployment; the final supported-stack deployment passed.

Please review Ambari Contributing Guide before opening a pull request.

@JiaLiangC
JiaLiangC marked this pull request as ready for review August 31, 2026 03:42
@JiaLiangC

Copy link
Copy Markdown
Contributor Author

retest this please

@JiaLiangC
JiaLiangC marked this pull request as draft August 31, 2026 03:52
@JiaLiangC
JiaLiangC marked this pull request as ready for review August 31, 2026 03:52
@JiaLiangC

Copy link
Copy Markdown
Contributor Author

retest this please

@JiaLiangC JiaLiangC closed this Aug 31, 2026
@JiaLiangC JiaLiangC reopened this Aug 31, 2026
@JiaLiangC
JiaLiangC merged commit 821de73 into apache:trunk Sep 1, 2026
1 check passed
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.

2 participants