Skip to content

[Flink] Fix Flink 2.x Flink SQL on Yarn/K8s Application mode - #4509

Open
shangeyao wants to merge 2 commits into
apache:devfrom
shangeyao:fix/flink-2x-yarn-k8s-application-sql
Open

[Flink] Fix Flink 2.x Flink SQL on Yarn/K8s Application mode#4509
shangeyao wants to merge 2 commits into
apache:devfrom
shangeyao:fix/flink-2x-yarn-k8s-application-sql

Conversation

@shangeyao

Copy link
Copy Markdown
Contributor

Summary

  • Build and upload a per-application fat jar for Yarn Application Flink SQL jobs, pointing flinkUserJar at the app workspace artifact instead of the shared SqlClient jar.
  • Bundle snakeyaml into Yarn/K8s Application build pipelines so Flink SQL YAML parsing works in container images.
  • Add FlinkParameterToolBridge so SqlClient resolves ParameterTool across Flink 1.x (org.apache.flink.api.java.utils) and Flink 2.x (org.apache.flink.util) package relocations.
  • Fix StreamParkLoggerFactory to load logback XML from classpath URL streams and rewrite shaded class names, avoiding file-path failures under parent-first classloading on K8s Application mode.
  • Introduce ShimJarMergeOrder and update MavenTool so Flink 2.x shims win over 1.x entries when merging fat jars.
  • Stop adding shims artifacts to Yarn Application provided.lib.dirs in YarnApplicationClient.
  • Treat Kubernetes Session clusters as HTTP-remotable in FlinkClusterWatcher for REST health checks.
  • Increase Kubernetes session cluster deploy/shutdown timeout from 60s to 300s for slow cluster startup.

Closes #4508.

Test plan

  • Verified FlinkSQL200OnYarnTest (Flink 2.0.2 Yarn Application + Session) locally — 10/10 passed
  • Manual: create/release/start/cancel a Flink SQL app on Yarn Application mode with Flink 2.x
  • Manual: create/release/start/cancel a Flink SQL app on Kubernetes Application mode with Flink 2.x
  • ./mvnw -pl streampark-flink/streampark-flink-sqlclient,streampark-flink/streampark-flink-packer -am test -DskipTests (compile)

Made with Cursor

Build per-app fat jars for Yarn Application SQL jobs, bundle snakeyaml for
Yarn/K8s images, add ParameterTool and logback compatibility for Flink 2.x,
and fix Yarn shims classpath ordering. Closes apache#4508.

Co-authored-by: Cursor <cursoragent@cursor.com>
Align FlinkDockerfileTemplateTest with COPY lib/. change and extract
shared Flink SQL snakeyaml resolution into FlinkSqlDependencySupport.

Co-authored-by: Cursor <cursoragent@cursor.com>
@sonarqubecloud

sonarqubecloud Bot commented Sep 2, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
6.3% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix Flink 2.x Flink SQL deployment on Yarn and Kubernetes Application mode

1 participant