You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "davidzollo (via GitHub)" <gi...@apache.org> on 2026/04/21 15:00:10 UTC

[I] [STIP-25][Feature][CDC] Introduce PG base CDC abstraction for Postgres and OpenGauss [seatunnel]

davidzollo opened a new issue, #10803:
URL: https://github.com/apache/seatunnel/issues/10803

   ### Search before asking
   
   - [x] I had searched in the feature issues and found no similar feature requirement.
   
   ### Description
   
   This STIP proposes introducing a shared PG base CDC abstraction for Apache SeaTunnel CDC connectors.
   
   Apache SeaTunnel currently provides `Postgres-CDC` and `Opengauss-CDC`. These connectors share the same CDC model and many common responsibilities, including source lifecycle, source config creation, catalog table discovery, dialect operations, snapshot split reading, WAL streaming, offset loading, and checkpoint restore. However, the shared logic is not represented as a dedicated PG base module today, which makes long-term maintenance harder as the CDC implementation evolves.
   
   The proposal is to add a new internal module:
   
   ```text
   seatunnel-connectors-v2/connector-cdc/connector-cdc-pg-base
   ```
   
   This module should not be a user-facing connector. It should provide common implementation building blocks for PG-based CDC connectors, while `connector-cdc-postgres` and `connector-cdc-opengauss` remain the user-facing connector modules.
   
   The proposed design includes:
   
   - Add `connector-cdc-pg-base` as a shared internal module depending on `connector-cdc-base`.
   - Keep `Postgres-CDC` and `Opengauss-CDC` connector identifiers unchanged.
   - Keep existing user-facing options and default behaviors unchanged.
   - Introduce `PgBaseProfile` to describe product-specific differences such as driver class, Debezium connector class, table include formatting, and exactly-once support.
   - Introduce `PgBaseSourceConfigFactory` and `PgBaseSourceConfig` based on the existing `JdbcSourceConfig` model.
   - Introduce `PgBaseIncrementalSource` for common source lifecycle logic.
   - Introduce `PgBaseDialect` and dialect adapters for table discovery, schema query, replica identity checks, snapshot task creation, WAL task creation, and offset commit.
   - Introduce `PgBaseSourceFetchTaskContext` and Debezium adapters to keep Postgres-specific Debezium classes outside the PG base module.
   - Introduce shared snapshot and WAL fetch task templates, while keeping product-specific Debezium objects in connector-specific adapters.
   
   Compatibility is a hard requirement for this proposal:
   
   - Existing connector identifiers must remain unchanged.
   - Existing options and default values must remain unchanged.
   - Existing checkpoint and savepoint restore paths must remain compatible.
   - Existing split and enumerator state classes must keep their package names, class names, field semantics, and serializer behavior.
   - Existing offset map keys and LSN conversion semantics must remain unchanged.
   - Existing Postgres exactly-once behavior must not regress.
   - OpenGauss should not implicitly inherit unsupported capability declarations from Postgres.
   
   The first implementation PR should prove compatibility by tests, especially:
   
   - Restore from an existing `HybridPendingSplitsState` and continue assigning snapshot splits.
   - Restore from an existing `IncrementalPhaseState` and continue WAL/incremental reading.
   - Restore offsets where LSN values are stored as strings.
   - Compare generated Debezium properties before and after the refactor.
   - Verify Postgres snapshot, incremental, schema change, and exactly-once behavior do not regress.
   
   Suggested PR split:
   
   1. Introduce `connector-cdc-pg-base` and migrate Postgres internals without user-facing behavior changes.
   2. Migrate OpenGauss from depending on Postgres concrete source classes to depending on PG base abstractions.
   3. Add developer documentation for extending PG base CDC connectors.
   
   ### Usage Scenario
   
   This feature is mainly for maintainability and long-term connector evolution.
   
   When a bug is fixed in common PG CDC logic, such as snapshot split reading, WAL offset handling, table discovery, or checkpoint restore, the fix should be implemented once in PG base instead of being repeated in multiple connector modules.
   
   For users, the expected behavior is that existing `Postgres-CDC` and `Opengauss-CDC` jobs continue to work with the same configuration and restore semantics.
   
   ### Related issues
   
   N/A
   
   ### Are you willing to submit a PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's Code of Conduct.
   


-- 
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: commits-unsubscribe@seatunnel.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [STIP-25][Feature][CDC] Introduce PG base CDC abstraction for PostgreSQL-based databases [seatunnel]

Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo commented on issue #10803:
URL: https://github.com/apache/seatunnel/issues/10803#issuecomment-4293084631

   I noticed that https://github.com/apache/seatunnel/pull/10799 is working on adding support for multiple Debezium versions. STIP-25 needs to wait until this is completed before it can begin. If anyone has suggestions, feel free to leave a comment.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [STIP-25][Feature][CDC] Introduce PG base CDC abstraction for Postgres and OpenGauss [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on issue #10803:
URL: https://github.com/apache/seatunnel/issues/10803#issuecomment-4289747793

   Thanks for writing this STIP. I checked the current PG CDC / OpenGauss module boundary, and this is a real design topic rather than only a code cleanup.
   
   Today `connector-cdc-opengauss` still imports Postgres CDC options, returns `PostgresIncrementalSource`, and depends directly on `connector-cdc-postgres`. So introducing an internal PG base layer can reduce coupling, but only if the compatibility boundary is kept very strict.
   
   I would support evaluating this as a STIP with these hard constraints:
   
   1. `connector-cdc-pg-base` should stay internal and must not become a user-facing connector.
   2. Existing `Postgres-CDC` / `Opengauss-CDC` identifiers, options, defaults, split state classes, checkpoint serializers, offset keys, and LSN semantics must remain unchanged.
   3. Product-specific behavior should stay behind explicit profile/adapters, including driver class, Debezium connector class, plugin/slot/publication behavior, table include formatting, and exactly-once support.
   4. OpenGauss must not implicitly inherit unsupported Postgres capability declarations.
   5. The first PR should be behavior-preserving and prove compatibility through restore/state tests and generated Debezium property comparisons.
   
   The PR split proposed here looks reasonable. Before implementation, please also make the non-goals explicit: no checkpoint state format change, no connector identifier change, no cross-engine behavior change, and no new user-facing options in phase 1 unless they are strictly necessary.
   


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [STIP-25][Feature][CDC] Introduce PG base CDC abstraction for PostgreSQL-based databases [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on issue #10803:
URL: https://github.com/apache/seatunnel/issues/10803#issuecomment-4324343352

   Thanks for the follow-up on the prerequisite. I rechecked this STIP again together with the current `dev` state on April 27, 2026, and I think the direction still makes sense, but the ordering matters more now.
   
   The PG-base motivation is real: OpenGauss still imports Postgres CDC options and currently returns `PostgresIncrementalSource`, so the shared boundary is indeed too implicit today. But I would not start the `connector-cdc-pg-base` extraction until the Debezium version boundary work is more settled.
   
   At the moment, PR #10799 is still open, and that work is still deciding how much of the CDC runtime boundary can safely move away from one shared Debezium lock point.
   
   So my current recommendation is:
   1. keep this STIP open and in review;
   2. explicitly treat #10799 (or an equivalent prerequisite refactor) as the dependency before implementation starts;
   3. once that boundary is stable, keep phase 1 of this STIP strictly behavior-preserving: no connector identifier changes, no option/default changes, no checkpoint/savepoint format changes, and no implicit capability changes for OpenGauss.
   
   That ordering will make the review much safer and much easier for the community to evaluate.
   


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org