Skip to content

[FLINK-40783][build] Upgrade HikariCP from 4.0.3 to 7.1.0 - #4559

Open
sd4324530 wants to merge 1 commit into
apache:masterfrom
sd4324530:hikaricp-upgrade-7.1.0
Open

sd4324530 wants to merge 1 commit into
apache:masterfrom
sd4324530:hikaricp-upgrade-7.1.0

Conversation

@sd4324530

@sd4324530 sd4324530 commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

What is the purpose of this pull request?

Upgrade the bundled HikariCP connection pool from 4.0.3 to 7.1.0 (latest).
JIRA: https://issues.apache.org/jira/browse/FLINK-40783

Version 4.0.3 was pinned for JDK 8 compatibility, which is no longer a
constraint since the project baseline moved to Java 11. Compatibility of 7.1.0
with this project was verified at the bytecode level before upgrading:

  • 7.1.0 ships Java 11 bytecode (class file major version 55, no multi-release
    variants), matching the project's source/target = 11 baseline.
  • It only calls classic slf4j APIs (Logger.debug/warn/error, LoggerFactory.getLogger),
    so it remains binary compatible with the slf4j-api 1.7.36 used by this project
    and shipped by the Flink runtime — no fluent-API (atInfo() etc.) usage that
    would break on slf4j 1.7.x.
  • Every API this project uses is unchanged in 7.1.0, including the two internal
    classes relied upon: HikariProxyConnection (used by the overridden
    PostgresConnection#connection() for instanceof + unwrap) and
    HikariPool.PoolInitializationException (caught by PooledDataSourceFactory).

Brief change log

  • Bump com.zaxxer:HikariCP from 4.0.3 to 7.1.0.
  • Extract a hikaricp.version property in the root pom; the version was previously
    hardcoded in two places (flink-cdc-base and flink-connector-mysql-cdc).
  • Add the slf4j-api exclusion to the HikariCP dependency in flink-cdc-base,
    consistent with the existing declaration in flink-connector-mysql-cdc.
  • No Java code or shade/relocation configuration changes are required.

Behavior note for reviewers: since HikariCP 6.2.1, keepaliveTime defaults to
2 minutes (previously disabled). Idle pool connections are now probed
periodically, which generally protects long-running CDC jobs from silently
dropped connections; the extra load is one ping per idle connection every
2 minutes.


Verifying this change

This change added no new tests; it was verified with existing test suites plus
manual checks (all on JDK 11):

  • Existing unit tests: flink-cdc-base full test suite passes (31/31).
  • Existing integration tests (Docker/Testcontainers): MySqlSourceITCase
    (64/64, MySQL 5.7) and PostgresSourceITCase (50 run, 0 failures, 1 skipped
    by its own assumeThat guard — PostgreSQL 14) pass. These cover the full
    snapshot + incremental pipeline through the HikariCP 7.1.0 pool, including the
    HikariProxyConnection instanceof/unwrap path in PostgresConnection.
  • Manually tested fat jar outputs: flink-sql-connector-mysql-cdc,
    flink-sql-connector-postgres-cdc and flink-cdc-pipeline-connector-mysql
    bundle HikariCP 7.1.0; the com.zaxxer relocation is correctly applied
    where configured (0 unrelocated leaks), and the module-info.class newly
    added in 7.x is filtered by the existing global shade filter.
  • Manually tested end-to-end runtime: using the shaded classes from the fat
    jar with slf4j-api 1.7.36 on JDK 11 against a real MySQL container — pool
    startup logging, DDL/DML/query, proxy instanceof/unwrap,
    PoolInitializationException path, pool MXBean stats and clean shutdown all
    behave correctly (no NoSuchMethodError).
  • Manually verified the keepalive change: default keepaliveTime reads
    120000 ms, and idle connections do receive periodic COM_PING probes
    (observed via the server-side Com_admin_commands status counter).

Documentation

  • Does this pull request introduce a new feature? (no)

Was generative AI tooling used to co-author this PR?
  • Yes (Claude Code)

Generated-by: Claude Code qwen3.8-max

🤖 Generated with Claude Code

The old 4.0.3 version was pinned for JDK 8 compatibility, which is no
longer required (project baseline is Java 11). HikariCP 7.1.0 ships
Java 11 bytecode and only uses classic slf4j APIs, so it stays binary
compatible with the slf4j-api 1.7.36 used by the project and Flink.

- extract hikaricp.version property in root pom to avoid two hardcoded
  and potentially diverging versions
- add slf4j-api exclusion in flink-cdc-base, consistent with
  flink-connector-mysql-cdc

Behavior note: since HikariCP 6.2.1 keepaliveTime defaults to 2 minutes
(was disabled), idle pool connections are now probed periodically.

Co-Authored-By: Claude Code <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant