yzeng1618 opened a new pull request, #12731:
URL: https://github.com/apache/seatunnel/pull/12731
### Purpose of this pull request
PostgreSQL CDC chunk sampling currently sets a fetch size on a forward-only
statement while the JDBC connection remains in auto-commit mode. pgjdbc can
therefore materialize the full split-column result set in the JobManager JVM
instead of fetching it through a cursor, which can cause excessive JobManager
memory usage for large tables.
This change enables cursor-based fetching for the sampling query and
restores the connection's original auto-commit state after sampling completes.
### Does this PR introduce any user-facing change?
No. This is an internal PostgreSQL CDC memory and resource-usage fix. No
configuration option, public API, split-boundary format, or connector setup is
changed.
### How was this patch tested?
- Spotless check passed:
`./mvnw.cmd -pl
seatunnel-connectors-v2/connector-cdc/connector-cdc-postgres spotless:check`
- Full Maven compilation and unit tests could not run in the local
environment because the available JDK is Java 8, while the project compiler
configuration uses the `--release` option unsupported by Java 8.
- The remote branch comparison confirms one commit changing only
`PostgresUtils.java`.
- No new test was added because the change controls pgjdbc's JDBC cursor
execution mode; the existing unit-test setup does not exercise this driver
behavior, and the change preserves the existing sampling and sorting logic.
### Check list
- [x] No new JAR binary package is added, so no license notice is required.
- [x] No documentation update is necessary because this does not add or
change a user-facing option or feature.
- [x] No incompatible change is introduced, so `incompatible-changes.md`
does not need updating.
- [x] This fixes an existing PostgreSQL CDC connector implementation; no new
connector is added, so plugin mapping, `seatunnel-dist` POM, CI label scope,
E2E registration, and `plugin_config` changes are not applicable.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]