You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "cjw0810 (via GitHub)" <gi...@apache.org> on 2026/09/09 06:36:29 UTC

[I] [Feature][Connector-V2][Oracle-CDC] Support OpenLogReplicator as Oracle CDC adapter [seatunnel]

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

   ### Search before asking
   
   - [x] I had searched in the [feature](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22Feature%22) and found no similar feature requirement.
   
   
   ### Description
   
   ## Background
   
   The current SeaTunnel Oracle CDC connector mainly relies on Oracle LogMiner for change data capture.
   
   OpenLogReplicator (OLR) is an open-source Oracle redo log parser that reads and parses Oracle redo and archive logs directly.
   
   The Debezium Oracle Connector already provides an OpenLogReplicator ingestion adapter through:
   
   ```properties
   database.connection.adapter=olr
   ```
   
   and connects to the OpenLogReplicator network endpoint using properties such as:
   
   ```properties
   openlogreplicator.source
   openlogreplicator.host
   openlogreplicator.port
   ```
   
   SeaTunnel Oracle CDC currently does not expose OpenLogReplicator as an available connection adapter.
   
   This feature proposes integrating the existing Debezium OpenLogReplicator adapter into SeaTunnel Oracle CDC, while keeping the existing LogMiner implementation unchanged.
   
   ---
   
   ## Motivation
   
   OpenLogReplicator directly parses Oracle redo logs outside the Oracle database and streams change events to downstream clients.
   
   Supporting OLR in SeaTunnel would provide an additional Oracle CDC ingestion option for environments where redo logs are accessible to OpenLogReplicator.
   
   Compared with relying only on LogMiner, this provides users with another CDC architecture that can:
   
   - Reduce dependency on database-side LogMiner processing
   - Reduce Oracle-side CDC processing overhead in suitable deployment environments
   - Provide another option for high-throughput Oracle CDC workloads
   - Reuse the OpenLogReplicator integration already available in Debezium Oracle Connector
   - Keep compatibility with SeaTunnel's existing snapshot and incremental CDC framework
   
   The goal is not to replace LogMiner, but to provide an additional Oracle CDC adapter that users can choose based on their deployment environment.
   
   ---
   
   ## Proposed Configuration
   
   The proposed configuration follows the existing Debezium Oracle Connector adapter model.
   
   Example:
   
   ```hocon
   source {
       Oracle-CDC {
           database.connection.adapter = "olr"
   
           openlogreplicator.host = "192.168.190.249"
           openlogreplicator.port = 5000
           openlogreplicator.source = "ORACLE"
       }
   }
   ```
   
   The main new configuration options are:
   
   ```text
   database.connection.adapter
   openlogreplicator.host
   openlogreplicator.port
   openlogreplicator.source
   ```
   
   When:
   
   ```text
   database.connection.adapter = "olr"
   ```
   
   SeaTunnel Oracle CDC uses OpenLogReplicator as the incremental redo-log ingestion adapter.
   
   The existing LogMiner behavior remains unchanged when OLR is not configured.
   
   ---
   
   ## Proposed Implementation
   
   The implementation adds OpenLogReplicator support to the Oracle CDC connector and integrates it with SeaTunnel's existing CDC source framework.
   
   The main implementation includes:
   
   - OpenLogReplicator network client integration
   - OpenLogReplicator protocol request and response handling
   - Incremental redo change event streaming
   - INSERT event support
   - UPDATE_BEFORE / UPDATE_AFTER event support
   - DELETE event support
   - `latest` startup mode
   - `initial` snapshot followed by incremental streaming
   - SCN-based startup position
   - Checkpoint recovery
   - Snapshot-to-incremental transition
   - Compatibility with SeaTunnel snapshot split processing
   
   The implementation reuses the Debezium OpenLogReplicator integration where possible instead of implementing a new Oracle redo parser inside SeaTunnel.
   
   ---
   
   ## Initial Snapshot and Incremental Streaming
   
   One important part of the implementation is correctly handling change events that occur while an initial snapshot is still running.
   
   The expected workflow is:
   
   ```text
   Initial Snapshot
          |
          | concurrent INSERT / UPDATE / DELETE
          |
          v
   Snapshot completed
          |
          v
   Continue incremental streaming from snapshot watermark SCN
          |
          v
   No CDC events should be lost
   ```
   
   During testing, an issue was found in the transition from snapshot mode to incremental streaming.
   
   When OpenLogReplicator was already running, the incremental reader sent a `CONTINUE` request.
   
   The request must carry:
   
   ```text
   c_scn = requested startup SCN
   c_idx = checkpoint index
   ```
   
   instead of using the SCN field that is only used by the `START` request.
   
   Without this handling, OpenLogReplicator could receive an invalid SCN value instead of the expected incremental startup SCN.
   
   For example, before the fix, OpenLogReplicator could receive:
   
   ```text
   client requested scn: 18446744073709551615
   ```
   
   instead of the actual snapshot watermark SCN.
   
   This caused UPDATE / DELETE events generated during the initial snapshot phase to be skipped when switching to incremental streaming.
   
   After correcting the `CONTINUE` request, OpenLogReplicator receives the expected SCN and checkpoint index, and the CDC events generated during the snapshot phase are correctly replayed after the snapshot completes.
   
   ---
   
   ## Supported Startup Modes
   
   The current implementation has been validated with:
   
   ### latest
   
   Start directly from the current Oracle redo position and continuously capture:
   
   - INSERT
   - UPDATE
   - DELETE
   
   ### initial
   
   Perform a full snapshot first, and then automatically switch to incremental redo streaming.
   
   The implementation also handles DML operations occurring during the snapshot window.
   
   For example:
   
   ```text
   Snapshot is reading existing rows
   
   At the same time:
   
   UPDATE low-key row
   DELETE low-key row
   UPDATE high-key row
   DELETE high-key row
   
   Snapshot completes
   
   Incremental streaming starts from the corresponding watermark SCN
   
   The final target state remains consistent with Oracle
   ```
   
   ---
   
   ## Validation
   
   The current implementation has been tested with the following environment:
   
   ```text
   SeaTunnel:           2.3.12
   Oracle Database:     Oracle 19c
   OpenLogReplicator:   1.9.0
   Sink:                Console / Apache Doris
   ```
   
   The following scenarios have been validated:
   
   - OLR network connection
   - `latest` mode startup
   - `latest` mode INSERT
   - `latest` mode UPDATE
   - `latest` mode DELETE
   - `initial` snapshot
   - Initial snapshot followed by incremental streaming
   - INSERT executed after snapshot startup
   - UPDATE executed while snapshot is still running
   - DELETE executed while snapshot is still running
   - UPDATE on rows already read by snapshot
   - UPDATE on rows not yet read by snapshot
   - DELETE on rows already read by snapshot
   - DELETE on rows not yet read by snapshot
   - Snapshot watermark SCN transition
   - OLR `CONTINUE` request using SCN and checkpoint index
   - Console Sink validation
   - Doris Sink validation
   - Final Oracle / Doris data consistency verification
   
   For the tested scenarios, the final Oracle and Doris data are consistent.
   
   ---
   
   ## Compatibility
   
   This feature is intended to be backward compatible.
   
   Existing Oracle CDC configurations that do not enable the OLR adapter continue to use the existing behavior.
   
   OpenLogReplicator is enabled only when explicitly configured, for example:
   
   ```hocon
   database.connection.adapter = "olr"
   ```
   
   Therefore, existing LogMiner users should not be affected by this change.
   
   ---
   
   ## Initial Scope
   
   The initial implementation focuses on Oracle environments where OpenLogReplicator can directly access the required Oracle redo and archive log files.
   
   The following deployment scenarios are not part of the initial scope:
   
   - RAC + ASM specific redo access
   - Oracle Downstream Mining
   - Direct ASM redo access from a remote OpenLogReplicator deployment
   - Automatic RAC/ASM redo transport management
   
   These scenarios involve additional deployment and storage considerations and can be discussed separately.
   
   The first goal of this feature is to provide a stable OpenLogReplicator ingestion adapter for the standard Oracle CDC workflow.
   
   ---
   
   ## References
   
   - Debezium Oracle Connector OpenLogReplicator ingestion adapter
   - OpenLogReplicator project
   
   ### Usage Scenario
   
   OpenLogReplicator can be used as an alternative Oracle CDC adapter when users want to capture changes by directly parsing Oracle redo logs instead of relying only on the existing LogMiner-based path.
   
   A typical deployment is:
   Oracle Database
         |
         | redo logs
         v
   OpenLogReplicator
         |
         | streaming protocol
         v
   SeaTunnel Oracle CDC Source
         |
         v
   Doris / Kafka / other sinks
   
   ### Related issues
   
   None.
   
   ### 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](https://www.apache.org/foundation/policies/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] [Feature][Connector-V2][Oracle-CDC] Support OpenLogReplicator as Oracle CDC adapter [seatunnel]

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

   One licensing/provenance point came up while preparing the draft PR.
   
   The Java OLR adapter code that is backported/adapted from Debezium carries the original Debezium Apache-2.0 headers, which I will preserve.
   
   However, the protobuf protocol class currently used by the prototype is generated from `OraProtoBuf.proto`. I noticed that the protocol source in Debezium carries a GPLv3 header (and the current upstream OpenLogReplicator project is AGPL licensed).
   
   Since GPL/AGPL content is Category X for ASF distributions, I do not want to include the generated protocol source in the SeaTunnel PR without agreeing on the correct boundary first.
   
   The OLR server itself remains an optional external process; no OpenLogReplicator binary or source code would be distributed by SeaTunnel.
   
   Would you prefer the first PR to use an independently implemented protocol client/codec without bundling the GPL/AGPL proto source, or is there another preferred protocol boundary for this adapter?
   
   Once this is clarified, I can publish the draft implementation branch immediately.


-- 
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] [Feature][Connector-V2][Oracle-CDC] Support OpenLogReplicator as Oracle CDC adapter [seatunnel]

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

   Thank you for pausing before publishing the prototype. The GPLv3 OraProtoBuf.proto, generated output from it, and AGPL OpenLogReplicator source or artifacts must not be included, copied into, or used as vendored protocol material in an Apache SeaTunnel distribution.
   
   Please do not publish the current prototype as a draft PR yet. First establish a clean, reviewable provenance boundary: identify a protocol specification or copyright-holder permission that is compatible with Apache distribution, and document exactly which independently available materials define the wire contract. An independently implemented codec is only a possible path if its behavior can be derived from that permissible contract, without copying GPL/AGPL source or generated code. The external OLR process may remain optional, but that fact does not make its non-permissive protocol source distributable.
   
   Once that provenance is settled, publish the adapter seam and the explicit protocol/retry/failure contract; deterministic fake-endpoint coverage can then proceed against that contract. No second source type, LogMiner-path change, or test-only PR should be opened before this boundary is resolved.


-- 
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] [Feature][Connector-V2][Oracle-CDC] Support OpenLogReplicator as Oracle CDC adapter [seatunnel]

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

   This is an interesting direction for Oracle CDC, especially for deployments where LogMiner is not suitable. Before implementation, I suggest making the first slice explicit around a few compatibility boundaries:\n\n- **Dependency/licensing:** can the existing Debezium OLR adapter be reused directly, and which module should own the optional dependency so LogMiner users do not pull it in?\n- **Source contract:** should OLR be an adapter behind the current Oracle-CDC source, with unchanged snapshot split/checkpoint interfaces, rather than a separate source type?\n- **Consistency gate:** define the snapshot watermark and `CONTINUE(c_scn, c_idx)` recovery contract, including restart after a checkpoint and the case where the OLR process is unavailable.\n- **Event mapping:** specify how OLR records map to SeaTunnel INSERT/UPDATE_BEFORE/UPDATE_AFTER/DELETE events and how schema changes or malformed records fail.\n- **Test boundary:** a protocol-level fake OLR endpoint plus deterministic s
 napshot-to-incremental tests would make the first PR reviewable without requiring Oracle 19c and a real OLR deployment in CI.\n\nIf maintainers agree, I would be interested in helping with the adapter contract and protocol-level regression tests before the full environment-specific E2E coverage.


-- 
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] [Feature][Connector-V2][Oracle-CDC] Support OpenLogReplicator as Oracle CDC adapter [seatunnel]

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

   Thanks for confirming the first-slice boundaries and the real Oracle/OLR validation. I can take the protocol-level test slice so the implementation can be reviewed independently of Oracle 19c:
   
   - a deterministic fake OLR endpoint for INFO/START/CONTINUE;
   - assertions that the snapshot watermark and checkpoint index are carried in CONTINUE rather than START fields;
   - INSERT/UPDATE/DELETE event mapping and snapshot-to-incremental transition cases;
   - disconnect/reconnect and malformed-response cases with explicit retry/failure expectations.
   
   I will keep this limited to the existing Oracle-CDC adapter contract and avoid introducing a new source type or changing LogMiner behavior. Do you already have a branch or target module for the implementation? Also, is there a maintainer-preferred test-server utility in the connector module that this first PR should reuse?
   


-- 
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] [Feature][Connector-V2][Oracle-CDC] Support OpenLogReplicator as Oracle CDC adapter [seatunnel]

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

   The proposed boundary is reasonable, but it needs one owner and one testable adapter contract. I checked the current Oracle CDC module and the open PR set: there is no existing OpenLogReplicator adapter or competing OLR PR.
   
   @cjw0810, please publish the implementation as a draft PR or a branch with the adapter seam and the exact protocol contract before separate test work starts. The first implementation remains an adapter behind `Oracle-CDC`; it must not add a second source type or alter the LogMiner path.
   
   @CryoThrust, the focused fake-endpoint coverage is useful, but please do not open an independent test-only PR against an unpublished protocol shape. Once the adapter contract is visible, keep the test slice to deterministic INFO, START, and CONTINUE framing; snapshot-watermark and checkpoint-index recovery; INSERT, UPDATE_BEFORE, UPDATE_AFTER, and DELETE mapping; disconnect/reconnect; and malformed responses. The contract must explicitly state retry and failure behavior, and it must preserve the existing source split and checkpoint interfaces. Oracle 19c and real OLR verification remains environment-specific evidence, not a substitute for this deterministic coverage.
   


-- 
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] [Feature][Connector-V2][Oracle-CDC] Support OpenLogReplicator as Oracle CDC adapter [seatunnel]

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

   Thanks for the detailed feedback. I agree that defining a smaller and explicit first slice would make the implementation easier to review and maintain.
   
   I already have a working implementation, and its current design is close to the boundaries you suggested. For the first PR, I would propose the following scope.
   
   ### 1. Dependency / licensing
   
   The implementation is based on the OpenLogReplicator integration approach already available in the Debezium Oracle connector.
   
   I agree that OLR-specific dependencies should remain isolated and should not affect users who continue to use LogMiner.
   
   Before submitting the PR, I will review the dependency layout carefully and determine whether the existing Debezium OLR implementation can be reused directly or whether only the required OLR-specific implementation should live inside the Oracle CDC connector.
   
   The goal is that users who do not enable OLR should not pull in unnecessary OLR-specific dependencies or experience any behavior change.
   
   ### 2. Source contract
   
   Yes, my intention is to keep OLR as an adapter behind the existing `Oracle-CDC` source rather than introducing a separate SeaTunnel source type.
   
   Conceptually:
   
   ```text
   Oracle-CDC
       ├── LogMiner
       └── OpenLogReplicator
   ```
   
   The existing snapshot split, checkpoint, and source interfaces should remain unchanged.
   
   The adapter can be selected explicitly through configuration such as:
   
   ```hocon
   database.connection.adapter = "olr"
   
   openlogreplicator.host = "192.168.190.249"
   openlogreplicator.port = 5000
   openlogreplicator.source = "ORACLE"
   ```
   
   Existing LogMiner configurations should continue to work unchanged.
   
   ### 3. Snapshot / incremental consistency and recovery
   
   This is one of the main areas I have already tested.
   
   The intended flow is:
   
   ```text
   snapshot low/high watermark
           ↓
   initial snapshot
           ↓
   snapshot completes
           ↓
   incremental reader starts from the snapshot watermark SCN
           ↓
   OLR CONTINUE(c_scn, c_idx)
   ```
   
   During testing, I found an issue in the snapshot-to-incremental transition.
   
   When OpenLogReplicator was already running, SeaTunnel sent a `CONTINUE` request, but the requested SCN was previously written to the field used by `START` instead of the `CONTINUE` fields.
   
   As a result, OpenLogReplicator could receive:
   
   ```text
   client requested scn: 18446744073709551615
   ```
   
   instead of the expected snapshot watermark SCN.
   
   This caused UPDATE / DELETE events generated while the initial snapshot was running to be skipped after switching to incremental streaming.
   
   The current implementation fixes this by sending:
   
   ```text
   c_scn = requested startup SCN
   c_idx = checkpoint index
   ```
   
   for the `CONTINUE` request.
   
   After this fix, I verified UPDATE and DELETE operations executed while the initial snapshot was still running, including rows that had already been read by the snapshot and rows that had not yet been read.
   
   The final source and sink states remained consistent.
   
   For the first PR, I agree that the recovery contract should also explicitly cover:
   
   - restart from a SeaTunnel checkpoint
   - reconnect after the OLR network connection is interrupted
   - behavior when the OLR process is temporarily unavailable
   - continuing from the persisted SCN / checkpoint index without duplicate or lost events
   
   These recovery scenarios should be covered by deterministic tests before the first PR is considered complete.
   
   ### 4. Event mapping
   
   The current event mapping is:
   
   ```text
   OLR INSERT
       -> SeaTunnel INSERT
   
   OLR UPDATE
       -> SeaTunnel UPDATE_BEFORE
       -> SeaTunnel UPDATE_AFTER
   
   OLR DELETE
       -> SeaTunnel DELETE
   ```
   
   These mappings have already been validated with both Console Sink and Doris Sink.
   
   For the first PR, I suggest keeping schema evolution outside the initial scope.
   
   The initial scope can focus on stable DML CDC behavior first:
   
   ```text
   INSERT
   UPDATE
   DELETE
   ```
   
   For malformed or unsupported OLR records, I agree that the expected failure behavior should be clearly defined and covered by tests rather than silently ignoring such records.
   
   ### 5. Test boundary
   
   I agree that requiring a real Oracle 19c + OpenLogReplicator environment in CI would make the first PR difficult to review and maintain.
   
   A protocol-level fake OLR endpoint sounds like a good approach.
   
   For example:
   
   ```text
   Fake OLR endpoint
           ↓
   OlrNetworkClient
           ↓
   SeaTunnel Oracle CDC
   ```
   
   It could provide deterministic regression tests for:
   
   - INFO / START / CONTINUE protocol handling
   - propagation of SCN and checkpoint index
   - INSERT / UPDATE / DELETE event mapping
   - snapshot-to-incremental transition
   - checkpoint recovery
   - disconnect / reconnect behavior
   - invalid or malformed protocol messages
   
   This would allow the core adapter behavior to be tested in CI without requiring Oracle 19c or a real OpenLogReplicator deployment.
   
   The real environment can remain as environment-specific E2E coverage.
   
   ### Current validation
   
   I already have a working implementation and have tested it with:
   
   ```text
   SeaTunnel:          2.3.12
   Oracle Database:    19c
   OpenLogReplicator:  1.9.0
   Sink:               Console / Apache Doris
   ```
   
   The following scenarios have been validated in the real environment:
   
   ```text
   latest mode:
   - INSERT
   - UPDATE
   - DELETE
   
   initial mode:
   - initial snapshot
   - snapshot -> incremental transition
   - INSERT during/after snapshot
   - UPDATE during snapshot
   - DELETE during snapshot
   - low-key rows already read by snapshot
   - high-key rows not yet read by snapshot
   
   sink:
   - Console Sink
   - Doris Sink
   - final Oracle / Doris consistency verification
   ```
   
   For the first PR, I am happy to keep the scope focused on the adapter contract, snapshot/incremental consistency, event mapping, recovery behavior, and protocol-level regression tests.
   
   RAC/ASM-specific deployment support and schema evolution can remain outside the first PR scope and be discussed separately.
   
   Thanks again for the detailed suggestions, and thanks for offering to help with the adapter contract and protocol-level regression tests. That would be very helpful.


-- 
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