Skip to content

[Feature][Zeta] Collect CDC progress reports on the coordinator - #11512

Draft
goutamadwant wants to merge 2 commits into
apache:devfrom
goutamadwant:GH-11364-cdc-progress-v2
Draft

goutamadwant wants to merge 2 commits into
apache:devfrom
goutamadwant:GH-11364-cdc-progress-v2

Conversation

@goutamadwant

@goutamadwant goutamadwant commented Jul 21, 2026 •

Copy link
Copy Markdown
Collaborator

Purpose of this pull request

Third slice of STIP-30 (#11364), on top of the API PR (#13239). Collects the reports from sources that implement SupportCdcProgress and keeps the latest one per task on the coordinator.

  • Workers sample reader reports from TaskExecutionService on the print-execution-info-interval cadence, batch them per worker and send them in one operation.
  • The coordinator collects enumerator reports separately: it finds the enumerator task group from the job plan and slot assignments and asks the hosting member. At most one request per worker is outstanding.
  • The store keeps only the latest report per owner and task. Lower execution attempts and non-increasing sequences within an attempt are ignored. Reports are removed with their pipeline, including after a savepoint, and a late report cannot reopen a cleaned-up scope.
  • The wire codec encodes enums by name and bounds entry and field counts.

Nothing is exposed through REST, the CLI or metrics in this slice.

Does this PR introduce any user-facing change?

No. Adds a "Runtime collection in Zeta" section to the developer doc.

How was this patch tested?

  • CdcProgressServiceTest, CoordinatorServiceTest, CoordinatorServicePipelineCleanupTest: ordering, scope lifecycle, cleanup after savepoint, failed initialisation rollback, generation fencing.
  • TaskExecutionServiceTest, CdcReaderProgressReportingTest, SourceSplitEnumeratorTaskTest, JobMasterTest: sampling, provider failure isolation, one outstanding request per worker, non-CDC filtering.
  • ReportCdcProgressOperationSerializationTest: round trip, named wire fixture, malformed and oversized frames.

JDK 11 and 17: the nine affected seatunnel-engine-server test classes, 156 passing.

Check list

  • If necessary, please update the documentation to describe the new feature.

@nzw921rx nzw921rx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I have some questions about the naming convention. With ProgressProvider or Progress* as the top-level interface, it may not be immediately clear to implementers that the interface is intended for CDC observability.

In other words, the name itself does not seem to convey the CDC observability purpose very explicitly. Do you agree with this concern, or could you explain the reasoning behind this naming?

examples:

  • CdcEnumeratorProgressProvider
  • CdcEnumeratorProgressReport

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update. I re-reviewed the complete current-head diff and the affected runtime path from scratch. The direction is useful, but the following items still block merge:

  1. Blocker 1: lastPositionChangeAt is measured at collection time, not when the position changed (seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/source/progress/CdcReaderProgressTracker.java:67-89) — recordEmission() only stores the split state; current() reads the clock later on the metrics collection thread, although the API contract says this is the epoch when the consumed position changed. Please record the timestamp atomically when an emitted offset changes and have current() publish that stored fact.

  2. Blocker 2: Enumerator reports use wall-clock time as their same-attempt ordering key (seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/observability/cdc/CdcProgressService.java:97-104) — Reader reports have a monotonic sequence, but enumerator reports compare only observedAt. After an NTP/clock rollback, valid newer reports from the same attempt are rejected until the clock catches up. Please add an attempt-local monotonic sequence to the enumerator envelope and order by attempt plus sequence.

The required Build was cancelled in the RocketMQ and engine-v2 lanes. After fixing the source blockers, please sync the latest dev and rerun the checks.

Thanks again for working through this — happy to re-review the next head.

Queue note: this head is diverged against dev (ahead_by=1, behind_by=4). I am recording that fact separately; it is not by itself a request to sync unless the CI guidance above explicitly says so.

@github-actions github-actions Bot added the e2e label Jul 22, 2026
@goutamadwant

Copy link
Copy Markdown
Collaborator Author

@DanielLeens Fixed the build issues from the latest dev sync. The engine test now uses SeaTunnel's CompletableFuture wrapper and the MySQL CDC E2E test has the missing Container import.

Re-ran the code specification checks, engine cleanup tests, MySQL CDC E2E compilation, and the full 284-module verify locally. All passed. The previously failing code style CI check is also passing now. Let me know,

@goutamadwant

Copy link
Copy Markdown
Collaborator Author

Thanks @nzw921rx I considered this again.

The CDC scope is already explicit in CdcEnumeratorProgressProvider and CdcEnumeratorProgressReport. Provider here represents a local non-blocking capability that returns the latest connector progress snapshot. I kept Observability out of the type name because these types describe connector-owned progress facts rather than the engine observability service itself.

I have kept the current names for now, but can revise them if you think a different name would better match the project convention. Let me know

@SEZ9 SEZ9 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this. I re-reviewed the latest head cd5ef252b126 from scratch.

What this PR fixes

  • User pain: Operators have no way to observe CDC snapshot/incremental progress at runtime — no visibility into which splits are assigned, completed, or where the reader is consuming, making stuck jobs and lag hard to diagnose (STIP-30 / #11364, lifecycle gaps from #11395).
  • Fix approach: Introduces experimental Cdc{Reader,Enumerator}ProgressProvider contracts in seatunnel-api with immutable report types (CdcProgressValue with per-field accuracy, CdcProgressPosition with family/schemaVersion, CdcProgressLifecycle), wires current-position tracking into the record emission path, distinguishes assigned/completed/running/prepared/unchunked counts in the assigners, and has the engine runtime collect and retain the latest report per source task.
  • One-line summary: The API contracts are well-designed (explicit accuracy semantics, checkpoint/restore positions honestly reported as UNSUPPORTED until callbacks are wired), but I have concerns about a signature change on HybridSplitAssigner that may break external connector implementations, an unsafe deserialization pattern in the report transport path, and missing documentation for the new config/option surface — details below.

Runtime chain I rechecked

IncrementalSourceReader.pollNext() -> RecordEmitter.emitRecord()  IncrementalSourceRecordEmitter.java:98
  -> CdcReaderProgressTracker.recordEmittedOffset(offset)  (position-change timestamp only updated when offset advances)
  -> CdcReaderProgressProvider.getCdcReaderProgress()  CdcReaderProgressProvider.java:26 (non-blocking snapshot read, no source I/O)

SourceSplitEnumerator side:
HybridSplitAssigner.getNext()/onCompletedSplits() -> split state counters (assigned/completed/running/prepared/unchunked)  HybridSplitAssigner.java
  -> IncrementalSourceEnumerator implements CdcEnumeratorProgressProvider.getCdcEnumeratorProgress()  CdcEnumeratorProgressProvider.java:27
  -> builds CdcEnumeratorProgressReport (activeSplits keyed by same split ID as watermarks)  CdcEnumeratorProgressReport.java:82

Engine collection:
SourceTask / enumerator task -> runtime progress collector polls providers -> retains only latest report per source task (map keyed by task ID, overwrite on newer report)

Findings

Issue 1: Possible public API change in seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/source/enumerator/HybridSplitAssigner.java

  • Location: seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/source/enumerator/HybridSplitAssigner.java
  • Why it matters: A public/protected signature appears to be removed or changed. Verify backward compatibility for downstream connectors.
  • Severity: High

Issue 2: Unsafe Java deserialization pattern

  • Location: seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/task/operation/ReportCdcProgressOperation.java:1
  • Why it matters: Matched in added line: + reports.add(in.readObject());
  • Suggested fix: Security: Unsafe Java deserialization pattern. Please review this line.
  • Severity: High

Issue 3: Config/option changes without doc updates

  • Why it matters: Consider updating docs/example configs for the new/changed options.
  • Severity: Low

Review conclusion

Conclusion: can merge after the blocking items are fixed

1. Blocking items

  • Issue 1: Possible public API change in seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/source/enumerator/HybridSplitAssigner.java
  • Issue 2: Unsafe Java deserialization pattern

2. Suggested (non-blocking) follow-ups

  • Issue 3: Config/option changes without doc updates

Nice progress overall — once the blocking points above are addressed this should be in good shape. Happy to discuss.

@github-actions github-actions Bot removed the e2e label Jul 24, 2026
@goutamadwant

Copy link
Copy Markdown
Collaborator Author

Thanks for the review @SEZ9 I synced the branch with the latest and removed the generic object deserialization from ReportCdcProgressOperation.

CDC progress reports now use an explicit wire codec for the known fields. I also added coverage for reader and enumerator reports, exact and best effort positions, active split details, empty batches, and malformed collection counts.

I rechecked HybridSplitAssigner against dev as well. No existing constructor or method signature is removed or changed. The diff only adds CdcEnumeratorProgressSource and getCdcEnumeratorProgress(...). If the concern is about exposing the new interface on this public class rather than compatibility with an existing signature, please let me know.

This PR does not add or change any connector configuration, so there is no config documentation update.

I verified locally on Java 11. The focused tests passed and the full engine-server suite completed with 364 tests, 0 failures, and 0 errors. Let me know if there are any other suggestions/comments. thanks!

@nzw921rx

Copy link
Copy Markdown
Member

Thanks @nzw921rx I considered this again.

The CDC scope is already explicit in CdcEnumeratorProgressProvider and CdcEnumeratorProgressReport. Provider here represents a local non-blocking capability that returns the latest connector progress snapshot. I kept Observability out of the type name because these types describe connector-owned progress facts rather than the engine observability service itself.

I have kept the current names for now, but can revise them if you think a different name would better match the project convention. Let me know

Thank you for your reply. My idea was generated by AI and I would like to discuss it with you. It's an honor

1. The reporting mechanism is duplicated across nearly every layer

The current implementation introduces two parallel reporting paths:

  • CdcReaderProgressProvider / CdcEnumeratorProgressProvider
  • CdcReaderProgressReport / CdcEnumeratorProgressReport
  • reader/enumerator task methods for collection, source vertex lookup, and sequence generation
  • CdcReaderProgressEnvelope / CdcEnumeratorProgressEnvelope
  • separate reader/enumerator lists in ReportCdcProgressOperation
  • separate serialization branches
  • separate maps, update methods, and ordering methods in CdcProgressService

Reader and enumerator reports should remain different because they own different facts. However, provider discovery, engine identity, execution-attempt ordering, transport, serialization, and latest-report storage are common reporting infrastructure and should not be duplicated.

A shared connector-facing abstraction could look like:

public interface CdcProgressReport extends Serializable {}

public interface CdcProgressProvider<R extends CdcProgressReport> {
    R getCdcProgress();
}

The engine could then use one tagged envelope and one ordering/storage path while preserving reader- and enumerator-specific report payloads.

Without a common top-level protocol, every additional report owner or progress dimension is likely to introduce another provider, envelope, serializer branch, task collection branch, and state map.

2. Reader and enumerator lifecycle ownership is conflated

CdcProgressLifecycle is shared by both reader and enumerator reports, but SnapshotSplitAssigner reports CATCH_UP once split assignment is complete:

assignerCompleted
        ? CdcProgressLifecycle.CATCH_UP
        : CdcProgressLifecycle.SNAPSHOT

CATCH_UP describes reader consumption relative to the snapshot high watermark. The enumerator does not own or directly observe that state, and assignment completion does not prove that readers are still catching up. Readers may already be incremental, or different readers may temporarily be in different states.

The enumerator should report assignment-specific state, such as whether snapshot discovery or assignment is still running. The source-level CDC lifecycle should be derived by the engine from reader reports without hiding mixed reader states.

This is also important for the STIP-30 principle that each component reports only facts it owns.

3. Enumerator collection does not follow the agreed STIP-30 path

STIP-30 specifies two distinct collection paths:

  • reader reports are periodically sampled on workers and transported to the coordinator;
  • enumerator progress is collected locally on the coordinator and is not sampled through the worker task loop.

The current implementation scans both SourceSeaTunnelTask and SourceSplitEnumeratorTask from TaskExecutionService.collectCdcProgress() and places both report types into ReportCdcProgressOperation.

Even if the enumerator task currently runs on the coordinator, this still routes coordinator-owned state through the generic task sampler and operation transport instead of collecting it directly through the coordinator-side progress service. It introduces unnecessary transport and diverges from the agreed design.

4. Engine transport constraints leak into the connector-facing API

All public progress DTOs implement Serializable, and CdcProgressValue requires:

T extends Serializable

This makes an engine transport requirement part of the connector-facing SPI. The engine already has explicit serialization code, so the public report model should not be shaped around the current Hazelcast transport implementation unless that restriction is intentionally part of the connector contract.

Suggested direction

I suggest keeping the reader and enumerator payload models separate, while consolidating the common mechanics:

  1. Introduce one common CdcProgressProvider<R> and report marker.
  2. Introduce one engine-internal report source abstraction for task collection.
  3. Use one envelope containing owner type, task identity, execution attempt, sequence, observation time, and report payload.
  4. Use one latest-report ordering and storage implementation.
  5. Keep enumerator assignment state separate from reader CDC lifecycle.
  6. Collect enumerator state directly on the coordinator as specified by STIP-30.

Because this is a foundational connector-facing and engine-level contract, it will become significantly harder to consolidate after checkpoint, restore, aggregation, REST, and additional CDC connectors depend on the current parallel hierarchy. I think this should be addressed before merge.

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update. I rechecked the latest head a3af71a13cd1 from scratch.

The earlier blockers I called out around lastPositionChangeAt, same-attempt ordering, and generic object deserialization are closed for me on this head:

  1. CdcReaderProgressTracker now records lastPositionChangeAt when the emitted position actually advances.
  2. Same-attempt ordering now uses reportSequence instead of relying only on wall-clock time.
  3. ReportCdcProgressOperation now uses an explicit codec instead of generic readObject() for these reports.

I still see two source-level blockers before this can merge:

  1. SnapshotSplitAssigner.getCdcEnumeratorProgress() reports CATCH_UP once assignerCompleted becomes true (seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/source/enumerator/SnapshotSplitAssigner.java:291-308).
    That condition proves snapshot assignment/completion state on the enumerator side, but it does not prove that all readers are in catch-up, and it can hide mixed reader states. Please keep the enumerator report limited to facts the enumerator owns and derive source-level CDC lifecycle from reader reports instead of emitting CATCH_UP here.

  2. Enumerator progress is still routed through the worker-side periodic sampler instead of a coordinator-local collection path (seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/TaskExecutionService.java:857-924, seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/task/SourceSplitEnumeratorTask.java:222-236, seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/task/operation/ReportCdcProgressOperation.java:56-80).
    The enumerator is coordinator-owned state, but the current implementation scans it from TaskExecutionService.collectCdcProgress() and transports it back through ReportCdcProgressOperation, so it inherits the worker sampling/transport path instead of being collected locally on the coordinator. For this foundational runtime contract, I think that ownership boundary should be fixed before merge.

I agree with @nzw921rx on the lifecycle-ownership and enumerator-collection concerns above.

The required Build is still queued, and the branch is currently diverged against dev (ahead_by=7, behind_by=2). I am recording that fact separately; it is not by itself the blocker here. After the source-level issues above are fixed, please rerun the required Build on the updated head and I'm happy to take another look.

@goutamadwant

Copy link
Copy Markdown
Collaborator Author

@nzw921rx @DanielLeens I updated the latest head based on the ownership and duplication feedback

  • reader and enumerator reports now share CdcProgressProvider CdcProgressReport and one tagged envelope storage and serialization path
  • reader and enumerator payloads remain separate
  • enumerator progress now reports snapshot assignment state only and no longer reports CATCH_UP
  • enumerator progress is collected directly on the coordinator when the enumerator is local
  • Serializable is removed from the connector facing progress model and transport still uses the explicit codec

I also added coverage for assignment states owner and payload validation ordering and wire serialization. The focused API connector base and engine progress tests pass locally

Could you please check if this now matches the STIP ownership and collection model

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basic information

  • PR title: [Feature] [CDC] Wire CDC progress reporting into runtime
  • Author: goutamadwant
  • Link: #11512
  • Base branch: dev
  • State: OPEN
  • Change size: +2642 / -23, 41 file(s)
  • Human review ready: No
  • Review time: 2026-07-26T13:35:00Z
  • Local branch: seatunnel-review-11512
  • Local worktree: dedicated PR 11512 review worktree

Stable review keys

  • pr_number: 11512
  • base_sha: 924b289e95d0bfe06286e8666bcbb7d986bc2023
  • reviewed_base_sha: 924b289e95d0bfe06286e8666bcbb7d986bc2023
  • merge_base_sha: 924b289e95d0bfe06286e8666bcbb7d986bc2023
  • head_sha: 792fdf98c17ff739683ecc3bf1fc39a34508e260
  • reviewed_head_sha: 792fdf98c17ff739683ecc3bf1fc39a34508e260
  • technical_verdict: blocking
  • github_review_event: NOT_POSTED
  • human_review_ready: false
  • intended_change_correctness: blocking
  • diff_integrity: pass
  • deletion_total: 23
  • deletion_classified: 23
  • deletion_unclassified: 0
  • other_total: 8
  • other_confirmed: 1
  • other_resolved_in_current_head: 5
  • other_rejected_with_same_proposition_evidence: 1
  • other_not_applicable_with_reason: 1
  • other_unresolved: 0
  • merge_conclusion: fix_then_merge
  • reviewed_at: 2026-07-26T13:35:00Z

CI, compare, and merge-gate facts

  • mergeStateStatus: BLOCKED
  • reviewDecision: REVIEW_REQUIRED
  • mergeable_state: blocked
  • mergeable: True
  • rebaseable: False
  • required_ci_gate: pending
  • approval_gate: pending
  • conflict_gate: satisfied
  • merge_queue_gate: pending
  • compare: status=ahead, ahead_by=10, behind_by=0, total_commits=10, url=dev...792fdf9
  • Gate assessment: Three technical blockers, the queued required Build, and REVIEW_REQUIRED remain; the PR is mergeable with no conflict and is zero commits behind, so there is no basis for a synchronization request.

What problem this PR solves

  • User pain: CDC operators must rely on connector logs and checkpoint internals to determine snapshot assignment, the actual emitted offset, reader lifecycle, and stale attempts.
  • Fix approach: Add experimental connector-owned reader and enumerator DTOs, update progress from record-emission and assigner paths, attach task, attempt, and sequence identity, transport periodically, and retain latest-only state on the master.
  • One-line summary: The typed CDC progress runtime slice is largely coherent, but enumerator ownership, runtime-path tests, and bilingual contract documentation remain blocking.
  • Before: When a four-reader MySQL CDC job appears idle, logs are the only way to distinguish snapshot from incremental progress.
  • After: The master can retain each reader's binlog position and one assignment report, but an off-master enumerator still depends on worker transport.

1. Code-change review

1.1 Core logic and real call/execution chain

  • Behavior before: The engine did not retain a typed latest CDC-progress snapshot keyed by source vertex, reader index, attempt, and sequence.
  • Behavior after: Reader emission and enumerator assignment produce owner-specific reports; TaskExecutionService collects them periodically and the master latest-only store fences stale attempts and sequences.
  • Normal-path hit: conditional — The CDC reader emission path is hit normally; the direct-master enumerator path is hit only when the enumerator task group is placed on the master.

Changed files, classes, and methods

  • seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/source/IncrementalSource.java:264-440 createReader/createEnumerator/restoreEnumerator — Creates progress trackers and providers and passes connector and position types into readers and enumerators.
  • seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/source/reader/IncrementalSourceRecordEmitter.java:81-180 emitRecord — Records the actual emitted position and lifecycle after record and state processing succeeds.
  • seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/TaskExecutionService.java:558-993 CDC progress registration/collection/reporting — Registers task providers, periodically samples readers and enumerators, and selects a direct master update or member operation.
  • seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/observability/cdc/CdcProgressService.java:32-165 updateReports/latest-state store — Retains the latest report by owner, job, pipeline, source, and task identity with attempt and sequence fencing.
  • seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/task/operation/CdcProgressReportSerializer.java:42-266 typed report codec — Explicitly encodes reader and enumerator payloads and rejects unknown owners and negative sizes.

Effective prerequisites

  • The source task or provider is deployed and registered, the scheduled metrics sampler runs, and the report reaches the current master.

Conditions where the change does not apply

  • A custom non-IncrementalSourceRecordEmitter leaves the current position unavailable; snapshot records have no incremental Offset; checkpoint and restore positions are explicitly UNSUPPORTED.

Complete execution chain

1. seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/source/IncrementalSource.java:264-313 -> createReader [lifecycle]
   Creates the tracker and injects it into the emitter and reader.
   Side effect: Creates the tracker and injects it into the emitter and reader.
2. seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/source/reader/IncrementalSourceRecordEmitter.java:100-180 -> emitRecord [method_call]
   Atomically snapshots emitted progress after successful record, state, and phase processing.
   Side effect: Atomically snapshots emitted progress after successful record, state, and phase processing.
3. seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/task/flow/SourceFlowLifeCycle.java:131-143 -> getCdcReaderProgress [method_call]
   Exposes the reader provider to the engine task.
   Side effect: Exposes the reader provider to the engine task.
4. seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/TaskExecutionService.java:810-993 -> reportCdcProgress [thread]
   The scheduled sampler builds envelopes and branches for local or remote owners.
   Side effect: The scheduled sampler builds envelopes and branches for local or remote owners.
5. seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/task/operation/CdcProgressReportSerializer.java:42-266 -> write/read report batch [serialization]
   Transfers reports between members with a typed internal codec.
   Side effect: Transfers reports between members with a typed internal codec.
6. seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/task/operation/ReportCdcProgressOperation.java:32-77 -> runInternal [rpc]
   The operation invokes the latest-state service on the master.
   Side effect: The operation invokes the latest-state service on the master.
7. seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/observability/cdc/CdcProgressService.java:32-165 -> updateReports [same_method]
   Rejects stale reports by execution ID and task-local sequence.
   Side effect: Rejects stale reports by execution ID and task-local sequence.
8. seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/SeaTunnelServer.java:392-403 -> removeMetrics [lifecycle]
   Pipeline cleanup also removes CDC progress state.
   Side effect: Pipeline cleanup also removes CDC progress state.
  • Recovery, exception, async, serialization, and concurrency paths: AtomicReference, the synchronized enumerator context, ConcurrentHashMap.compute, and attempt/sequence fencing handle concurrency; report failures are logged without failing the data task and interruption is restored, but off-master enumerator and failover ownership do not establish a coordinator-local invariant.

Multi-table Sink Writer contract audit

  • Applicable: false
  • Sink implements SupportMultiTableSink: Not reported by GitHub
  • createWriter returns the required subclass: Not reported by GitHub
  • optionRule contains the replica option: Not reported by GitHub
  • Evidence: Not applicable: the PR adds no SupportMultiTableSinkWriter.

1.2 Compatibility impact

  • Classification: fully_compatible (fully compatible)
  • API: New connector-facing types are additive and marked @experimental; existing constructors and methods remain.
  • SPI: The new provider and report capability is additive; HybridSplitAssigner only adds an interface and method.
  • Configuration: No Option or configuration is added, removed, or renamed.
  • Defaults: Existing defaults are unchanged.
  • Protocol and serialization: The internal operation uses a unique serializer ID and explicit typed codec; it has no envelope version tag, but no evidence establishes mixed-binary rolling Zeta members as a supported contract.
  • Checkpoint/restore: Progress reports are not written into checkpoint state; checkpoint and savepoint compatibility is unchanged.
  • Historical behavior: Connector output and existing runtime behavior remain; the added observability state does not alter records.
  • Migration guidance: No stable incompatible migration is required; the experimental contract still needs documentation.
  • Incompatible-changes documentation: Not applicable: no incompatible change was found.

1.3 Performance and side effects

  • CPU: Each emission updates a small immutable state; each enumerator sample scans assignedSplits and sorts active IDs.
  • Memory: Each active reader allocates a position map, report, and envelope per cycle; the master is latest-only with no unbounded history.
  • GC: Periodic immutable DTO allocations add bounded GC pressure; no per-position labels or history are introduced.
  • Network: Reader batches and off-master enumerator reports use a member-to-master operation; a master-local enumerator can update directly.
  • Lock contention: Enumerator sampling shares the synchronized context with assignment and checkpoint mutation, bounded by the existing metrics interval.
  • Concurrency safety: The reader AtomicReference, synchronized enumerator context, store compute, and attempt/sequence ordering are coherent.
  • Retry: Sampling and transport failures are caught and the next fixed-rate run can recover; there is no separate retry queue.
  • Idempotency: Latest-state ordering ignores duplicate or older sequences in the same attempt and superseded execution attempts.
  • Resource release: Task-group completion removes enumerator providers and pipeline metrics cleanup removes master reports, but production callers are not exercised by tests.
  • Overall: The overhead is bounded; the primary risks are synchronous scheduled transport delay and unverified lifecycle and placement behavior.

1.4 Error handling and logging

  • Exception propagation: Record-processing and deserialization exceptions still propagate; observability-reporting failures are isolated from the data task.
  • Context: Task, pipeline, source, and owner identity is retained in envelope and store keys to locate stale and current reports.
  • Log levels: Report failures use warning or error context and lifecycle cleanup does not silently swallow failures; no improper sensitive-payload logging was found.
  • Sensitive information: Transport contains connector-native offsets and status only; no password, token, or cookie was found.
  • Overall: Error isolation and typed decoding are generally sound; positive collection-size bounds would be defense in depth.

1.5 Diff integrity, deletion ledger, and scope audit

  • intended_change_correctness: blocking
  • diff_integrity: pass
  • deletion_ledger: total=23, classified=23, unclassified=0
  • Reconciliation: 23 = 23 + 0

Deletion, rename, and disappeared-capability ledger

  • deletion-001..deletion-004 | count=4 | deletion | intended_change | seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/source/IncrementalSource.java (old line 290 .. old line 424) — Old emitter and enumerator construction statements are replaced by equivalent overloads carrying the progress tracker or type; existing reader and assigner behavior remains.
  • deletion-005 | count=1 | deletion | intended_change | seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/source/enumerator/HybridSplitAssigner.java (old line 43) — The class declaration or old construction line is replaced only to add a CDC progress capability or overload; no existing API, configuration, or behavior is removed.
  • deletion-006 | count=1 | deletion | intended_change | seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/source/enumerator/IncrementalSourceEnumerator.java (old line 43) — The class declaration or old construction line is replaced only to add a CDC progress capability or overload; no existing API, configuration, or behavior is removed.
  • deletion-007 | count=1 | deletion | intended_change | seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/source/enumerator/IncrementalSplitAssigner.java (old line 55) — The class declaration or old construction line is replaced only to add a CDC progress capability or overload; no existing API, configuration, or behavior is removed.
  • deletion-008 | count=1 | deletion | intended_change | seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/source/enumerator/SnapshotSplitAssigner.java (old line 53) — The class declaration or old construction line is replaced only to add a CDC progress capability or overload; no existing API, configuration, or behavior is removed.
  • deletion-009..deletion-017 | count=9 | deletion | intended_change | seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/source/reader/IncrementalSourceReader.java (old line 64 .. old line 232) — Declarations, construction, and early-return initialization are refactored to record initialized state; original snapshot and incremental construction, phase transition, event, and return behavior remains.
  • deletion-018..deletion-019 | count=2 | deletion | intended_change | seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/test/java/org/apache/seatunnel/connectors/cdc/base/source/enumerator/SnapshotSplitAssignerTest.java (old line 146 .. old line 147) — Fixed test watermarks are parameterized for the same-split progress assertion; no test capability is removed.
  • deletion-020..deletion-021 | count=2 | deletion | intended_change | seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/TaskExecutionService.java (old line 517 .. old line 589) — Old deployment and context constructor calls are replaced by additive overloads carrying the execution-attempt ID.
  • deletion-022 | count=1 | deletion | intended_change | seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/task/SourceSeaTunnelTask.java (old line 52) — The class declaration or old construction line is replaced only to add a CDC progress capability or overload; no existing API, configuration, or behavior is removed.
  • deletion-023 | count=1 | deletion | intended_change | seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/task/SourceSplitEnumeratorTask.java (old line 75) — The class declaration or old construction line is replaced only to add a CDC progress capability or overload; no existing API, configuration, or behavior is removed.

Scope and base-drift items

  • No out-of-scope hunk, stale-base change, or merge artifact requires a separate ledger entry.

  • Out-of-scope hunk conclusion: All 41 files belong to the CDC API, CDC-base or MySQL provider, engine transport or store, or focused tests; no out-of-scope hunk was found.

  • Stale-base conclusion: The branch is zero commits behind the reviewed dev base; no stale-base rollback was found.

  • Merge-artifact conclusion: The merge-tree candidate scan is empty and REST reports mergeable=true and not dirty; no merge artifact or conflict was found.

2. Code-quality assessment

2.1 Code conventions, title format, and comments

  • Title format: Follows the repository PR template's [Feature] [component] Title form.
  • Code conventions: New files have ASF headers, with no wildcard imports or new dependency; git diff --check is clean.
  • Comment completeness: Core lifecycle and reporting methods in CdcProgressReportSource, CdcProgressService, and TaskExecutionService lack identity, ordering, and threading contract comments, recorded as non-blocking Daniel issue 3.

2.2 Test coverage and stability

  • Unit tests: covered — Covers DTO invariants, tracker behavior, assigner facts, latest-store ordering and cleanup, and typed serialization.
  • Component tests: missing — No TaskExecutionService test with fake tasks and providers covers local or remote collection, registration and removal, or operation runInternal.
  • Engine integration tests: missing — No engine lifecycle or integration test connects record emitter to task provider, sampler, master store, and cleanup.
  • E2E: missing — No runtime progress E2E is added; the finding does not require broad Docker coverage, but the critical ownership boundary needs deterministic verification.
  • Regression tests: missing — Missing off-master enumerator, master failover, attempt restart and stale fencing, exceptional cleanup, and multi-source identity scenarios.
  • Stability classification: risk

Test-stability evidence

  • TaskExecutionService.java:558-609,810-993; SeaTunnelServer.java:392-403
    • Trigger: Off-master placement, master failover, attempt restart, transport failure, or lifecycle cleanup.
    • Probability basis: These are normal placement and lifecycle states, but current tests bypass production wiring; the added unit tests themselves have no sleep, fixed-port, network, or randomness signal.
    • Analysis: The unit tests look deterministic; runtime feature stability is at risk because of a deterministic coverage gap, not a proven flaky test.

Missing scenarios

  • Both master-local and off-master enumerator placement branches.
  • Deployment registration and removal, exceptional task completion, and the pipeline cleanup caller.
  • New-attempt sequence reset and stale-report rejection through the actual sampler and operation.

2.3 Documentation

  • User-visible change: true
  • docs/en: The complete diff has no docs/en change; the experimental public CDC SPI and semantics are undocumented.
  • docs/zh: The complete diff has no docs/zh change; the bilingual repository requirement is unmet.
  • Examples: There is no implementer example for provider ownership, accuracy, position schema, lifecycle and assignment, or unsupported fields.
  • Configuration truth: No config or option changes; SEZ9's configuration-documentation proposition is therefore not applicable.
  • URL truth: The diff adds no documentation URL; an external STIP does not replace repository bilingual documentation.

2.4 Local-validation boundary and GitHub CI evidence

  • Local boundary: Only static diff, source and call-chain review, merge-tree candidate inspection, git diff --check, and current-head GitHub state were used; no compilation, unit tests, integration tests, E2E, packaging, Docker, service, or job was run.

Local execution boundary

  • compilation: not_executed — Not executed; current-head GitHub CI is the runtime evidence.
  • unit_tests: not_executed — Not executed.
  • integration_tests: not_executed — Not executed.
  • e2e: not_executed — Not executed.
  • packaging: not_executed — Not executed.
  • docker: not_executed — Not executed.
  • service_start: not_executed — Not executed.
  • real_job: not_executed — Not executed.

Actually executed review commands

  • git diff --stat 924b289e95d0bfe06286e8666bcbb7d986bc2023...792fdf98c17ff739683ecc3bf1fc39a34508e260
    • Result: passed
    • Explanation: Confirmed 41 files and +2642/-23.
  • git diff --name-status 924b289e95d0bfe06286e8666bcbb7d986bc2023...792fdf98c17ff739683ecc3bf1fc39a34508e260
    • Result: passed
    • Explanation: Completed the file, deletion, and scope audit; there are no deleted or renamed files.
  • git diff --unified=0 924b289e95d0bfe06286e8666bcbb7d986bc2023...792fdf98c17ff739683ecc3bf1fc39a34508e260
    • Result: passed
    • Explanation: Completed the full hunk and call-chain audit.
  • git diff --check 924b289e95d0bfe06286e8666bcbb7d986bc2023...792fdf98c17ff739683ecc3bf1fc39a34508e260
    • Result: passed
    • Explanation: Clean.
  • merge-tree candidate scan 924b289e95d0bfe06286e8666bcbb7d986bc2023 792fdf98c17ff739683ecc3bf1fc39a34508e260
    • Result: passed
    • Explanation: No conflict marker or candidate was found.

Required checks

Complete status-check rollup

3. Architecture assessment

3.1 Solution type: precise fix / workaround / long-term design

  • Type: long_term_design
  • Assessment: Typed owner-specific reports, attempt and sequence fencing, and a latest-only store are the right long-term direction; the enumerator ownership invariant is unfinished.

3.2 Maintainability

A shared provider, envelope, codec, and store remove the duplicated protocol; core method contracts and bilingual docs still need completion.

3.3 Extensibility

Accuracy and native-position schemas can extend to more connectors; future REST and metrics consumers can read the same master store.

3.4 Historical-version compatibility

The experimental API is additive and does not change checkpoint format, configuration, or output; mixed-member wire versioning is not a currently proven supported contract.

4. Disposition ledger for findings from other reviewers

  • total=8, confirmed=1, resolved_in_current_head=5
  • rejected_with_same_proposition_evidence=1, not_applicable_with_reason=1, unresolved=0
  • Reconciliation: 8 = 1 + 5 + 1 + 1 + 0

review-4742261935 — nzw921rx

  • Original proposition: Progress provider and report naming did not clearly identify the CDC purpose.
  • Location: seatunnel-api/src/main/java/org/apache/seatunnel/api/cdc/CdcProgressProvider.java and related public types
  • Thread: #11512 (review)
  • Current-head evidence: The current head uses CdcProgressProvider and CdcProgressReport, all in the api.cdc package with a Cdc prefix.
  • Disposition: resolved_in_current_head
  • Daniel disposition: The original naming proposition is resolved.

review-4769667323-item-1 — SEZ9

  • Original proposition: An existing HybridSplitAssigner public signature might have been removed or changed.
  • Location: seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/source/enumerator/HybridSplitAssigner.java
  • Thread: #11512 (review)
  • Current-head evidence: The base-to-head diff only adds a capability and method to the class declaration; constructors and existing methods remain, as does the old IncrementalSourceEnumerator constructor.
  • Disposition: rejected_with_same_proposition_evidence
  • Daniel disposition: Rejected with evidence on the same signature proposition.

review-4769667323-item-2 — SEZ9

  • Original proposition: ReportCdcProgressOperation used generic Java readObject for report payloads.
  • Location: seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/task/operation/CdcProgressReportSerializer.java:42-266
  • Thread: #11512 (review)
  • Current-head evidence: The current head uses explicit typed fields and a TaskLocation codec, rejecting unknown owners and negative counts.
  • Disposition: resolved_in_current_head
  • Daniel disposition: The generic deserialization proposition is resolved.

review-4769667323-item-3 — SEZ9

  • Original proposition: Connector option or configuration changes lack documentation.
  • Location: Complete diff option/config surface
  • Thread: #11512 (review)
  • Current-head evidence: The complete diff adds or changes no Option, option rule, default, or example configuration.
  • Disposition: not_applicable_with_reason
  • Daniel disposition: The configuration-documentation proposition is not applicable; public API documentation is a distinct Daniel finding.

issuecomment-5068763565-item-1 — nzw921rx

  • Original proposition: Reader and enumerator provider, envelope, serialization, ordering, and store protocols were duplicated.
  • Location: seatunnel-api/src/main/java/org/apache/seatunnel/api/cdc/CdcProgressProvider.java; seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/observability/cdc
  • Thread: #11512 (comment)
  • Current-head evidence: The current head shares one generic provider, marker, source, tagged envelope, batch operation, and latest-state ordering and store.
  • Disposition: resolved_in_current_head
  • Daniel disposition: The duplicated-protocol proposition is resolved.

issuecomment-5068763565-item-2 — nzw921rx

  • Original proposition: The enumerator inferred reader CATCH_UP from assignment completion, conflating lifecycle ownership.
  • Location: seatunnel-api/src/main/java/org/apache/seatunnel/api/cdc/CdcEnumeratorProgressReport.java
  • Thread: #11512 (comment)
  • Current-head evidence: The enumerator reports only CdcSnapshotAssignmentStatus; CdcProgressLifecycle remains only on reader reports.
  • Disposition: resolved_in_current_head
  • Daniel disposition: The owner-specific lifecycle proposition is resolved.

issuecomment-5068763565-item-3 — nzw921rx

  • Original proposition: Enumerator state should be collected by a coordinator-local path rather than depend on the worker sampler and transport.
  • Location: seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/TaskExecutionService.java:558-609,893-923,961-993
  • Thread: #11512 (comment)
  • Current-head evidence: The direct branch applies only to a master-local task; an ordinary TaskGroupDefaultImpl can be placed on a remote worker, where it still invokes ReportCdcProgressOperation.
  • Disposition: confirmed
  • Daniel disposition: Daniel explicitly +1s this proposition and aggregates it under the original ID as a blocking formal finding.
  • Aggregated finding: issuecomment-5068763565-item-3

issuecomment-5068763565-item-4 — nzw921rx

  • Original proposition: Java Serializable leaked into connector-facing reports and the provider type parameter.
  • Location: seatunnel-api/src/main/java/org/apache/seatunnel/api/cdc/CdcProgressReport.java and CdcProgressProvider.java
  • Thread: #11512 (comment)
  • Current-head evidence: The public marker, provider, and value have no Serializable inheritance or bound; transport is handled by an engine-internal explicit codec.
  • Disposition: resolved_in_current_head
  • Daniel disposition: The Serializable-leakage proposition is resolved.

5. Formal findings

issuecomment-5068763565-item-3 — Off-master enumerator collection still depends on the worker sampler and transport (+1)

  • Source reviewer: nzw921rx
  • Location: seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/TaskExecutionService.java:265-993
  • Thread: #11512 (comment)
  • Problem and real execution path: The new registration and direct branch do not make enumerator placement and lifetime coordinator-owned. PhysicalPlanGenerator creates a TaskGroupDefaultImpl -> a slot may select a remote worker -> worker TaskExecutionService collectEnumeratorCdcProgress -> ReportCdcProgressOperation -> master.
  • Current-head evidence: PhysicalVertex deployment supports local or remote workers; direct update occurs only when the node address equals the master address.
  • Trigger condition: The enumerator physical vertex receives a non-master slot or remains on a former master after failover.
  • Potential impact: The STIP-30 coordinator-local ownership guarantee becomes placement-dependent and inherits worker sampler and transport delay or failure.
  • Best actionable fix: Explicitly bind enumerator placement and registration to a coordinator-owned collector; otherwise formalize the remote transport and failover contract and update the STIP, docs, and tests.
  • Severity: medium
  • Merge gate: blocking
  • Current-head disposition: confirmed_in_current_head
  • Already raised by another reviewer: true
  • Other finding ID: issuecomment-5068763565-item-3

daniel-issue-1 — No execution-path test covers runtime collection, placement, transport, registration, or cleanup

  • Source reviewer: DanielLeens
  • Location: seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/TaskExecutionService.java:558-993
  • Thread: Not reported by GitHub
  • Problem and real execution path: The PR adds roughly 135 lines of central wiring, but tests only instantiate DTOs, trackers, assigners, stores, and codecs directly. Emitter -> SourceFlowLifeCycle -> source task -> TaskExecutionService sampler -> local or remote branch -> operation -> store -> task and pipeline cleanup.
  • Current-head evidence: There is no TaskExecutionService, lifecycle, or integration test; the service cleanup test calls removePipeline directly and the serialization test does not execute runInternal.
  • Trigger condition: A defect occurs in provider discovery, placement, execution-ID propagation, operation invocation, or cleanup.
  • Potential impact: All isolated tests and Build can pass while the first runtime slice never produces, routes, or removes a report correctly.
  • Best actionable fix: Add deterministic server tests with fake task groups, providers, master addresses, and captured operations, covering both placement branches, attempt fencing, registration removal, and SeaTunnelServer cleanup.
  • Severity: medium
  • Merge gate: blocking
  • Current-head disposition: confirmed_in_current_head
  • Already raised by another reviewer: false
  • Other finding ID: Not reported by GitHub

daniel-issue-2 — The user-facing public CDC progress contract lacks English and Chinese documentation

  • Source reviewer: DanielLeens
  • Location: seatunnel-api/src/main/java/org/apache/seatunnel/api/cdc/CdcProgressProvider.java:1-168
  • Thread: Not reported by GitHub
  • Problem and real execution path: Ten experimental public types define owner, accuracy, native position, reader lifecycle, and assignment semantics, but the complete diff has no docs/en or docs/zh change. A connector author implements CdcProgressProvider -> runtime and future REST consumers interpret DTOs, status, UNSUPPORTED, and UNAVAILABLE.
  • Current-head evidence: CdcProgressLifecycle Javadoc still says reader or enumerator even though the current head deliberately removes enumerator lifecycle.
  • Trigger condition: A connector author or consumer implements or interprets the contract from repository documentation and public Javadocs.
  • Potential impact: Assignment COMPLETED, position schemas, and unsupported versus unavailable semantics can be misunderstood; a stale current-head sentence already demonstrates semantic drift.
  • Best actionable fix: Add aligned docs/en and docs/zh developer documentation covering ownership, the no-I/O provider contract, DTOs, accuracy, schema version, freshness, limitations and status, and correct the lifecycle Javadoc to reader-only.
  • Severity: medium
  • Merge gate: blocking
  • Current-head disposition: confirmed_in_current_head
  • Already raised by another reviewer: false
  • Other finding ID: Not reported by GitHub

daniel-issue-3 — Core reporting interfaces and lifecycle methods lack identity, ordering, and threading comments

  • Source reviewer: DanielLeens
  • Location: seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/observability/cdc/CdcProgressReportSource.java:23-34
  • Thread: Not reported by GitHub
  • Problem and real execution path: Five nontrivial public methods and service or collector methods do not document vertex identity, attempt-local monotonic sequence, nullability, no-I/O, thread safety, or lifetime. New report-owner implementation -> CdcProgressReportSource -> scheduled sampler -> stale-report ordering and store.
  • Current-head evidence: The compiler accepts a blocking provider, unstable identity, or non-monotonic sequence that violates sampler and store assumptions.
  • Trigger condition: A later owner, connector, or engine task implements or reuses the interface.
  • Potential impact: Future correctness and maintainability risk; the current MySQL path is not proven wrong.
  • Best actionable fix: Document owner and task identity, attempt-local sequence, null behavior, non-blocking and no-I/O requirements, synchronization, and registration and removal lifetime for core methods.
  • Severity: medium
  • Merge gate: non_blocking
  • Current-head disposition: confirmed_in_current_head
  • Already raised by another reviewer: false
  • Other finding ID: Not reported by GitHub

6. Findings summary

ID Finding Location Severity Merge gate
issuecomment-5068763565-item-3 Off-master enumerator collection still depends on the worker sampler and transport (+1) seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/TaskExecutionService.java:265-993 medium blocking
daniel-issue-1 No execution-path test covers runtime collection, placement, transport, registration, or cleanup seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/TaskExecutionService.java:558-993 medium blocking
daniel-issue-2 The user-facing public CDC progress contract lacks English and Chinese documentation seatunnel-api/src/main/java/org/apache/seatunnel/api/cdc/CdcProgressProvider.java:1-168 medium blocking
daniel-issue-3 Core reporting interfaces and lifecycle methods lack identity, ordering, and threading comments seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/observability/cdc/CdcProgressReportSource.java:23-34 medium non_blocking

7. Merge conclusion

Conclusion:can merge after fixes

Blocking items

  • blocker-1 [source] (issuecomment-5068763565-item-3): An off-master enumerator is still collected by the worker sampler and transport, so the coordinator-local ownership invariant is not met.
  • blocker-2 [tests] (daniel-issue-1): The new runtime collection, placement, transport, registration, and cleanup path has no execution-path test.
  • blocker-3 [documentation] (daniel-issue-2): The declared user-facing experimental CDC public contract lacks required English and Chinese documentation.

Non-blocking recommendations

  • daniel-issue-3: Document owner and task identity, attempt-local sequence, null behavior, non-blocking and no-I/O requirements, synchronization, and registration and removal lifetime for core methods.

Overall assessment

The current head materially closes generic serialization, timestamp and ordering, and lifecycle-conflation issues, but three blockers prevent human review.

Better alternative implementation and trade-offs

  • Alternative: Preferred: explicitly place and register the enumerator with a coordinator-owned collector and keep worker TaskExecutionService responsible only for reader batches; if remote enumerators are allowed, formalize a separate transport and failover contract.
  • Trade-offs: A coordinator-owned placement and lifecycle hook better matches the STIP but touches scheduling; a formal remote path is less invasive but gives up the coordinator-local invariant and needs extra failover tests and documentation.

8. GitHub publication and reply readback

  • Publication event: COMMENT
  • Publisher identity: DanielLeens (repository permission READ)
  • Reviewed commit: 792fdf98c17ff739683ecc3bf1fc39a34508e260
  • This complete report is the submitted GitHub Review body. Its immutable review ID, URL, state, and submission time are verified from the GitHub API immediately after creation and retained in the local bilingual evidence.
  • Any precise line-thread replies are separate GitHub objects and are likewise verified individually.

@goutamadwant

Copy link
Copy Markdown
Collaborator Author

@DanielLeens Updated the implementation based on the latest comments.

Enumerator progress collection is now owned by the active coordinator. The coordinator resolves the current task placement and requests the snapshot from the assigned worker, so worker local registration is no longer used for ownership.

I added coverage for placement, collection, transport, serialization and cleanup, along with English and Chinese documentation for the CDC progress contract.

The focused API and engine tests pass locally. A full multi member failover test is not included yet, but the ownership and recovery path is covered at the coordinator and operation boundaries. Let me know if any suggestions!

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pushing the new revision. I re-reviewed the latest head from the CDC connector APIs through the reader/enumerator runtime collection path, the master-side store, serialization, cleanup, docs, and the new tests.

The source-level blockers from my previous round look closed to me now:

  • The enumerator path is no longer driven by the worker-side periodic sampler. Reader reports still use TaskExecutionService.reportReaderCdcProgress(), while enumerator reports are now selected by the active coordinator from runningJobMasterMap, the physical plan, coordinator vertices, and ownedSlotProfilesIMap, then collected through CollectCdcEnumeratorProgressOperation.
  • The runtime-path coverage is now present. TaskExecutionServiceTest.testCoordinatorCollectsAndCleansEnumeratorProgress() covers local deployment, collection, operation-based store update, task completion, and pipeline cleanup.
  • The public experimental CDC progress contract is now documented in both docs/en/developer/cdc-progress.md and docs/zh/developer/cdc-progress.md, and the lifecycle wording is reader-owned rather than reader-or-enumerator.
  • The generic report readObject() issue remains fixed by the explicit CdcProgressReportSerializer codec. CollectCdcEnumeratorProgressOperation still reads TaskGroupLocation through Hazelcast object serialization, but that is not the CDC report payload deserialization issue we discussed earlier.

The main runtime chain I checked is:

CDC reader record path
  -> IncrementalSourceRecordEmitter.emitRecord()
      -> CdcReaderProgressTracker records the emitted position / lifecycle
  -> SourceFlowLifeCycle.getCdcReaderProgress()
  -> TaskExecutionService.reportReaderCdcProgress()
      -> CdcProgressEnvelope(owner=READER, taskLocation, sourceVertexId, attempt, sequence)
      -> ReportCdcProgressOperation
      -> CdcProgressService.updateReports()

CDC enumerator path
  -> CoordinatorService.collectCdcEnumeratorProgress()
      -> runningJobMasterMap / physical plan / coordinator vertex
      -> ownedSlotProfilesIMap locates the worker for each enumerator task group
      -> CollectCdcEnumeratorProgressOperation(worker)
          -> TaskExecutionService.collectEnumeratorCdcProgress(taskGroupLocations)
              -> SourceSplitEnumeratorTask.getCdcProgressReport()
              -> CdcProgressEnvelope(owner=ENUMERATOR, ...)
          -> ReportCdcProgressOperation(master)
      -> CdcProgressService.updateReports()

Cleanup
  -> SeaTunnelServer.removeMetrics(PipelineLocation)
      -> CdcProgressService.removePipeline()

Test stability looks acceptable to me. The new CDC progress tests are mostly synchronous DTO/store/serializer checks, plus one Awaitility-based runtime cleanup check. I do not see newly added hard sleeps, fixed ports, external services, container timing, or shared static-state pollution in the new test logic. Stability rating: stable.

Merge conclusion

Conclusion: can merge after the remaining gate is cleared

  1. Blockers that must be fixed

    • I do not see a new source-level blocker in the latest code.
    • The remaining blocker is CI / merge gate. The current Build check is failing: https://github.com/apache/seatunnel/runs/90398366741. The failed jobs I found include unit-test (8, ubuntu-latest), all-connectors-it-7 (8), and kafka-connector-it (8), with several follow-on cancellations. The all-connectors-it-7 failure also appears on the latest dev build I checked, but the unit-test (8, ubuntu-latest) log stream failed to download, so I cannot safely classify that one as unrelated yet.
  2. Non-blocking suggestions

    • Nothing else from my side for this revision.

I also checked this head against the latest dev: the branch is currently diverged with behind_by=2. The lowest-cost next step is to sync with the latest dev and rerun CI first. If unit-test (8, ubuntu-latest) still fails after that, please paste the new failing log link here and I can help narrow it down against the updated head.

Overall, this is a strong follow-up. The ownership, tests, and documentation are much clearer now, and the remaining work is to get a trustworthy CI signal on the refreshed head.

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update. I re-reviewed the latest head (3bc5349ad4fb4773d595bf2de4966fd42ccc03c1) across the CDC progress API, reader/enumerator connector paths, active-coordinator collection, operation serialization, cleanup, docs, and the new tests.

The source-level blockers from my previous rounds still look closed to me on this revision:

  • Reader progress remains reader-owned and non-blocking: the emission path updates CdcReaderProgressTracker, and the worker-side sampler only reads the latest immutable report.
  • Enumerator progress is now coordinator-owned: the active coordinator derives enumerator placement from the current job/slot state and requests the report from the member that actually runs the enumerator task.
  • The transport path uses an explicit CdcProgressReportSerializer for known reader/enumerator fields, including negative-size validation, instead of falling back to generic object deserialization.
  • CdcProgressService keeps reader and enumerator reports separate, rejects stale attempt/sequence updates, and removes reports when the owning pipeline is cleaned up.

The runtime chain I checked is:

CDC reader emits a record
  -> IncrementalSourceRecordEmitter / IncrementalSourceReader
      -> CdcReaderProgressTracker.recordEmission(...)
      -> AtomicReference stores latest split / lifecycle / offset / lastPositionChangeAt

Worker-side reader sampling
  -> TaskExecutionService.reportCdcProgress()
      -> reportReaderCdcProgress()
      -> collectCdcProgress(context, READER, observedAt, reports)
      -> ReportCdcProgressOperation(reports)

Active-coordinator enumerator sampling
  -> CoordinatorService resolves current JobMaster / physical plan / slot placement
      -> find the source enumerator TaskGroupLocation and execution member
      -> CollectCdcEnumeratorProgressOperation
          -> accept only active-master caller
          -> TaskExecutionService.collectEnumeratorCdcProgress(...)
          -> ReportCdcProgressOperation writes reports back to master

Serialization and storage
  -> CdcProgressReportSerializer.writeEnvelope/readEnvelope
      -> explicit reader/enumerator fields by owner
      -> invalid sizes fail fast
  -> CdcProgressService.updateReports()
      -> newer executionAttempt wins
      -> within one attempt, higher reportSequence wins
  -> removePipeline()
      -> deletes reports for the cleaned pipeline

Test coverage looks good for this slice. The added tests cover model invariants, reader position updates, snapshot assignment reporting, coordinator-side collection/cleanup, stale attempt and sequence ordering, owner/payload validation, and the explicit wire codec. I do not see a flaky-test pattern in the new tests: they are synchronous unit/component checks, and the async task-boundary test uses Awaitility-style condition waiting rather than fixed sleeps. Stability rating: stable.

Merge conclusion

Conclusion: can merge after the remaining gate is cleared

  1. Blocking items that must be fixed

  2. Suggested non-blocking follow-ups

    • Nothing else from my side for this revision.

One merge-gate note: this branch is currently diverged from dev (ahead_by=15, behind_by=2). I would not ask for a sync only because of that while the current Build is still running. If the Build later fails in a lane that does not appear related to this CDC progress diff, then syncing the latest dev and rerunning CI will be the lowest-cost next step.

Overall, this is much cleaner now. The ownership boundary is in the right place: connectors expose local facts, while the engine owns collection, ordering, transport, and cleanup.

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update. I re-reviewed the latest head (a6ca253bc4964dfd7e9b5dfc6afba1e8e6e5fa6d) across the CDC progress API, CDC base/MySQL reader and enumerator paths, Zeta worker/master reporting, operation serialization, cleanup, docs, and the new tests.

The source-level blockers from the previous rounds still look closed to me. In particular, +1 to the earlier concerns from @SEZ9 about API compatibility, unsafe Java deserialization, and docs: on the current head I see the public CDC progress model added as new API surface, CdcProgressReportSerializer now writes and reads explicit fields instead of falling back to Java object deserialization, and both English/Chinese developer docs are present.

Runtime chain I traced:

CDC record emission
  -> IncrementalSourceRecordEmitter.emitRecord()
      -> processElement() updates the split offset / watermark state
      -> CdcReaderProgressTracker.recordEmission(...)

Reader progress reporting
  -> IncrementalSourceReader.getCdcProgress()
  -> SourceSeaTunnelTask.getCdcProgressReport()
  -> TaskExecutionService.reportCdcProgress()
  -> ReportCdcProgressOperation.runInternal()
  -> CdcProgressService.updateReports()

Enumerator progress reporting
  -> SourceSplitEnumeratorTask.getCdcProgressReport()
  -> CoordinatorService.collectCdcEnumeratorProgress()
      -> groups enumerator task groups by the current slot owner
  -> CollectCdcEnumeratorProgressOperation.run()
  -> ReportCdcProgressOperation.runInternal()

Serialization and cleanup
  -> TaskDataSerializerHook registers the new operation class ids
  -> CdcProgressReportSerializer.writeEnvelope/readEnvelope()
  -> CdcProgressService keeps only the newest execution-attempt / sequence report
  -> pipeline cleanup removes both reader and enumerator reports

I also checked the updated tests. The CDC-specific additions cover model behavior, reader tracker state transitions, latest-only service updates, operation serialization, active enumerator grouping, and pipeline cleanup. The new CDC tests look deterministic to me; I do not see a new high-risk flaky pattern in the added CDC coverage.

Merge conclusion:

Conclusion: can merge after CI / merge gate is cleared

  1. Blockers that must be resolved

    • I do not see a new source-level blocker from Daniel's side on the current head.
    • The remaining blocker is the current Build check. The branch is currently diverged from dev (ahead_by=16, behind_by=7), and GitHub reports mergeStateStatus=BLOCKED.
    • The failing Build is here. The failed jobs I checked are:
      • Run / unit-test (8, ubuntu-latest): seatunnel-ci-tools failed because the Surefire fork hit GC overhead limit exceeded.
      • Run / all-connectors-it-7 (11, ubuntu-latest): connector-cdc-mysql-e2e failed. This lane is related to the CDC area, so if it still fails after a fresh rebase/sync, we should narrow it against the current CDC changes.
      • Run / rocketmq-connector-it (11, ubuntu-latest): RocketMqIT.testRocketMqLatestToConsole timed out waiting for the expected condition within 2 minutes, which does not appear directly related to this PR's CDC progress diff.
  2. Non-blocking suggestions

    • None from my side in this round.

Overall, the implementation now looks coherent: connector code produces immutable progress snapshots, the engine collects them without adding network I/O to the record emission path, and the master-side store rejects stale attempt/sequence reports. Since the latest dev Build I checked is also not green, I would not describe this as "upstream already fixed"; the lowest-cost next step is still to sync with the latest dev and rerun Build first. If the CDC MySQL lane remains red after that, please paste the new failing check link here and I can help narrow it down against the updated head.

One process note: GitHub may still show reviewDecision=REVIEW_REQUIRED; this comment is Daniel's technical recheck, and a write-capable maintainer may still need to issue the final approval / merge-gate action once CI is green.

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update. I re-reviewed the latest head f19ef23c from the full current dev...HEAD diff, and I also compared it against my previous Daniel source-clear head a6ca253b with git range-diff.

That targeted comparison is the important part here: the logical CDC-progress patch series is unchanged from the last Daniel source-clear round. The current head only adds repeated merges of the latest dev; I do not see a reopened source-side change in the CDC progress implementation itself.

One thing to update from my previous round: the old "sync latest dev first" guidance is now outdated for the current head. This branch is no longer behind dev (ahead_by=19, behind_by=0), and the current required Build is queued rather than failing. So I do not see an upstream-sync blocker on the latest head.

PR solves what problem

  • User pain: CDC operators still lack structured runtime visibility into reader position, snapshot assignment, and enumerator progress, which makes stuck jobs and lag hard to diagnose.
  • Fix approach: this PR adds the experimental CDC progress API model, wires reader/enumerator reporting through the connector/runtime path, adds coordinator-owned enumerator collection, explicit transport serialization, master-side latest-only storage, cleanup hooks, tests, and EN/ZH docs.
  • One-line summary: this adds a typed CDC progress reporting path from connector runtime to the active coordinator without reopening the earlier source-side correctness issues.

I. Code Change Review

1.1 Core logic analysis

Precise change summary

The core runtime path I rechecked is still the same one I cleared in the previous Daniel round:

  • CDC connector path:
    • seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/source/IncrementalSource.java
    • .../reader/IncrementalSourceReader.java
    • .../reader/IncrementalSourceRecordEmitter.java
    • .../progress/CdcReaderProgressTracker.java
  • engine/runtime path:
    • seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/CoordinatorService.java
    • .../TaskExecutionService.java
    • .../observability/cdc/CdcProgressService.java
    • .../task/operation/CdcProgressReportSerializer.java
    • .../task/operation/CollectCdcEnumeratorProgressOperation.java
    • .../task/operation/ReportCdcProgressOperation.java

The critical runtime chain remains:

CDC reader record emission
  -> IncrementalSourceRecordEmitter
      -> CdcReaderProgressTracker.recordEmission(...)

Reader report collection
  -> TaskExecutionService.reportReaderCdcProgress()
      -> ReportCdcProgressOperation
      -> CdcProgressService.updateReports()

Enumerator report collection
  -> CoordinatorService.collectCdcEnumeratorProgress()
      -> CollectCdcEnumeratorProgressOperation
      -> ReportCdcProgressOperation
      -> CdcProgressService.updateReports()

Serialization / cleanup
  -> CdcProgressReportSerializer
  -> SeaTunnelServer.removeMetrics(...)
      -> CdcProgressService.removePipeline(...)

Before / after snippets

There is no new source-side behavioral delta between my last Daniel source-clear head and the current head. The relevant signal from the latest git range-diff is that the same six logical CDC-progress commits are still present, and the new top-of-branch changes are only repeated merges of dev, not new CDC progress logic.

So the already-reviewed implementation remains in place:

reader emission
  -> tracker records immutable progress facts

coordinator-owned enumerator collection
  -> active coordinator requests enumerator progress from the owning member

transport
  -> explicit CdcProgressReportSerializer codec

Key findings

  1. The current head does not reopen a Daniel source-side issue relative to the last reviewed CDC progress implementation.
  2. The latest head still keeps the previously reviewed ownership split: reader progress remains reader-owned, and enumerator progress remains coordinator-owned.
  3. The explicit CDC progress serializer path remains in place; I do not see a regression back to generic object deserialization for the progress payload itself.
  4. The remaining gate is GitHub CI / repository review state, not a new CDC progress logic blocker from Daniel's side.

Logic correctness deep dive

I rechecked the same high-risk areas that mattered in the previous source-clear round:

  • reader-side emission-time progress updates,
  • coordinator-owned enumerator collection,
  • explicit progress transport serialization,
  • latest-only stale-attempt / stale-sequence rejection in the master store,
  • cleanup on pipeline removal,
  • public EN/ZH developer docs for the experimental API contract.

Because the logical patch series is unchanged from the last Daniel source-clear head, I do not see a new runtime branch that would invalidate those conclusions.

Full runtime chain

CDC record emission
  -> IncrementalSourceRecordEmitter.emitRecord()
      -> CdcReaderProgressTracker.recordEmission(...)

Reader reporting
  -> SourceSeaTunnelTask / TaskExecutionService
      -> ReportCdcProgressOperation
      -> CdcProgressService.updateReports()

Enumerator reporting
  -> active CoordinatorService
      -> CollectCdcEnumeratorProgressOperation
      -> ReportCdcProgressOperation
      -> CdcProgressService.updateReports()

Current head delta after previous Daniel-clear version
  -> repeated merges of latest dev
  -> no reopened CDC progress logic change

1.2 Compatibility impact

Compatibility assessment: fully compatible relative to the last Daniel-reviewed source-clear version.

  • API: no new compatibility regression is reopened in the current head.
  • Configuration: no new option-surface regression appears in the delta after the last source-clear head.
  • Default values: unchanged in the current delta.
  • Historical behavior: unchanged relative to the already-reviewed CDC progress implementation.

1.3 Performance / side-effect analysis

  • CPU / memory: no new performance-side change is reopened by the current head delta.
  • Concurrency / ordering: the previously reviewed attempt/sequence fencing and coordinator-owned enumerator collection remain the relevant correctness contract, and I do not see them reopened.
  • Serialization / network: the explicit typed CDC progress serializer path remains the active transport path.
  • Resource release: no new cleanup regression is surfaced by the latest delta.

1.4 Error handling and logging

I do not see a new blocking or non-blocking Daniel source issue on the latest head.

II. Code Quality Assessment

2.1 Code conventions

The current implementation remains consistent with the code shape I reviewed in the previous Daniel-clear round. The latest delta does not introduce a new style or contract concern from Daniel's side.

2.2 Test coverage and test stability

The CDC progress tests that mattered in the previous source-clear round still stand for the current head:

  • model / serializer coverage,
  • reader tracker coverage,
  • coordinator-side enumerator collection coverage,
  • stale report ordering coverage,
  • cleanup coverage,
  • EN/ZH developer docs coverage for the public contract.

Test stability rating: stable.

The latest delta does not add a new risky UT/E2E pattern; the current head changes after the last Daniel-clear version are repeated dev merges rather than new CDC progress tests.

2.3 Documentation update

The EN/ZH developer docs for the CDC progress contract remain present on the current head:

  • docs/en/developer/cdc-progress.md
  • docs/zh/developer/cdc-progress.md

I do not see a reopened documentation gap in the current revision.

III. Architecture Reasonableness

3.1 Elegance of the solution

The current design remains the same reviewed direction: connectors expose local progress facts, while the engine owns collection, ordering, transport, and cleanup.

3.2 Maintainability

Maintainability is unchanged relative to the last Daniel-clear head. The current delta does not add a new maintenance burden in the CDC progress logic itself.

3.3 Extensibility

The typed CDC progress model remains reusable for additional CDC connectors and future runtime surfaces. No new extensibility regression appears in the current head.

3.4 Historical version compatibility

No new historical-compatibility concern is reopened by the latest delta from Daniel's side.

IV. Problem summary

No. Problem Location Severity
- No blocking or non-blocking Daniel source issue identified on the current head - -

V. Merge conclusion

Conclusion: can merge

  1. Blockers that must be fixed

    • No new Daniel source-level blocker on the latest head f19ef23c.
    • The remaining gate is repository CI / review state. The current required Build is still queued: https://github.com/apache/seatunnel/runs/91515434235
    • GitHub may still keep repository-level reviewer gates visible from earlier rounds. Because my repository permission is read-only here, a write-capable maintainer or reviewer may still need to complete the final merge gate after the checks finish.
  2. Suggested fixes (non-blocking)

    • None from Daniel on the current head.

Overall evaluation:

  • I rechecked the current CDC progress implementation and do not see a reopened source-side issue.
  • The CI / merge-gate fact has changed materially since my previous round: this branch is no longer behind dev, so the old upstream-sync suggestion does not apply to the latest head.
  • From Daniel's technical review side, the remaining gate is current CI / repository review controls, not a new CDC progress logic blocker.

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the continued work here — this is my consolidated re-review from scratch at the latest head 8773988077 (87739880771ab2aacaab0bb803c5eca766838aff). This is a long-running review thread (mine and @SEZ9's and @nzw921rx's), so let me restate where things stand rather than assume anyone remembers the history.

What problem does this PR solve?

  • User pain: Operators running CDC jobs (MySQL today, with the base classes shared by Oracle/Postgres/SQLServer/MongoDB CDC) have no runtime visibility into snapshot vs. incremental progress, split assignment, or how far a reader has actually consumed. Today the only signal is connector logs, which makes a stuck or lagging CDC job hard to diagnose.
  • Fix approach: Introduces an experimental org.apache.seatunnel.api.cdc contract (CdcProgressProvider, CdcReaderProgressReport, CdcEnumeratorProgressReport, CdcProgressValue with explicit accuracy semantics, CdcProgressPosition with connector-native family/schema versioning). Reader progress is captured non-blocking at record-emission time; enumerator/snapshot-assignment progress is derived from the split assigners. On the engine side, reader reports are periodically sampled by the existing worker metrics scheduler and shipped to the master; enumerator reports are collected by a coordinator-owned pull (the active coordinator resolves current task placement and asks the owning member), and a latest-only store on the master fences stale attempts/sequences and is cleaned up on pipeline removal.
  • One-line summary: A well-designed, additive CDC observability slice that has closed every source-level blocker raised across 7 rounds of review (naming, ownership, deserialization safety, timestamp/ordering correctness, enumerator collection ownership); the only thing standing between this and merge right now is a green CI run, plus one previously-uncaught, non-blocking public-constructor compatibility gap I found on this pass.
  • Concrete example: Before this PR, if a 4-reader MySQL CDC job looks idle, an operator has to grep worker logs per reader to guess whether it's still snapshotting, catching up, or truly stuck. After this PR, IncrementalSourceReader.getCdcProgress() and IncrementalSourceEnumerator.getCdcProgress() expose a typed snapshot (lifecycle, active split, consumed position, split counts) that the engine collects centrally per source vertex — the plumbing for a future REST/metrics surface, though this PR intentionally stops short of exposing it externally.

Re-review methodology and carryover note

Per the task, I re-read the entire current diff (gh pr diff 11512, 48 files, +3102/-23) and the actual head source (via git show 87739880771ab2aacaab0bb803c5eca766838aff:<path> — a full worktree checkout was not feasible in time due to heavy concurrent disk I/O on the shared review host, so I read files directly from git objects instead, which are already fetched and verified against the exact head SHA), rather than trusting my own prior write-ups blindly.

I also confirmed via gh api repos/apache/seatunnel/compare/f19ef23c724d...87739880771a that every file changed between my last source-clear review (head f19ef23c, 2026-08-03) and the current head is an unrelated dev-sync file (docs for Airtable/HugeGraph/InfluxDB/etc., the HugeGraph connector rewrite, Maxcompute, file-connector PDF reader, KnowledgeSyncMetadataField, MetadataTransform) — zero CDC-progress files appear in that delta. So the CDC-progress implementation itself has not changed since my last full pass; what changed is 9 more dev commits picked up via merge, plus one merge commit. I want to be upfront that this re-review therefore reuses my own prior verification of the parts that are provably unchanged (attempt/sequence fencing math, docs prose, etc.), but I independently re-verified the hot-path and serialization/compatibility questions this task specifically asked about, and in doing so found one thing that was missable in all 7 prior rounds (mine included) — see Issue 1 below. I'm sorry that one slipped through this many passes; it's a real, if low-impact, gap.

1. Code Change Review

1.1 Core Logic Analysis

Hot-path / blocking-call check (the specific ask for this round). I traced the record-emission path end to end:

// IncrementalSourceRecordEmitter.emitRecord() — connector-cdc-base
while (elementIterator.hasNext()) {
    SourceRecord next = elementIterator.next();
    reportMetrics(next);
    processElement(next, collector, splitState);
    markEnterPureIncrementPhase(next, splitState);
    if (cdcProgressTracker != null) {
        cdcProgressTracker.recordEmission(
                splitState, getMessageTimestamp(next), System.currentTimeMillis());
    }
}

recordEmission → CdcReaderProgressTracker.recordState() → latestState.updateAndGet(previous -> nextState(...)). This is a per-record AtomicReference CAS with an in-memory lambda — no network, no disk, no lock acquisition, no blocking I/O. Confirmed non-blocking. One real (but minor) cost: nextState(...) unconditionally allocates a new immutable ReaderState object on every emitted record, even when nothing observable changed (e.g. a heartbeat record with no offset). For a very high-throughput binlog stream this is continuous small-object churn on the hot path — bounded and cheap, but it is per-record, not per-batch, so it's worth knowing this is not "occasional" overhead. Not a blocker; flagging for awareness (see Issue 2).

Where the actual blocking RPC lives. TaskExecutionService.reportReaderCdcProgress() → reportCdcProgressToMaster() does createInvocationBuilder(...).invoke().get() — a blocking wait for the master's ack. I verified this runs only on TaskExecutionService's existing scheduledExecutorService (Executors.newSingleThreadScheduledExecutor(), wired into this::updateMetricsContextInImap at TaskExecutionService.java:262), i.e. the same periodic, single-threaded scheduler that already does a blocking ReportMetricsOperation invocation (TaskExecutionService.java:815-830, pre-existing, unchanged by this PR). So the new CDC blocking call is not new architecture — it mirrors the exact pattern already accepted for metrics reporting, and it does not run on the SourceReader's polling/fetch thread. The one thing worth noting: this scheduler now does two sequential blocking master round-trips per tick (metrics, then CDC progress) instead of one, so a slow/partitioned master could delay this worker's regular metrics-to-IMap update by roughly the CDC call's duration on top of the existing metrics call. Bounded by Hazelcast's operation-call timeout, not unbounded — acceptable, but worth knowing if metrics latency SLOs are ever investigated later.

Enumerator collection ownership — this was the subject of 3 rounds of back-and-forth (my Blocker 2 on 07-24, @nzw921rx's item 3 on 07-24, my confirmation on 07-29). Current head:

// CoordinatorService.collectCdcEnumeratorProgress() — engine-server
public void collectCdcEnumeratorProgress() {
    if (!isCoordinatorActive()) return;
    // walk runningJobMasterMap -> physical plan -> coordinator vertices that host a
    // SourceSplitEnumeratorTask -> resolve current owning worker from ownedSlotProfilesIMap
    // -> CollectCdcEnumeratorProgressOperation(taskGroupLocations) per worker
}

CollectCdcEnumeratorProgressOperation.run() explicitly checks getCallerAddress().equals(masterAddress) before doing anything — only the active coordinator can pull. This is genuinely coordinator-initiated (pull), not worker-sampled-and-pushed like reader reports, which is the STIP-30 ownership split @nzw921rx originally asked for. Called from SeaTunnelServer.printExecutionInfo() guarded by coordinatorService.isCoordinatorActive() && this.isMasterNode(), so it only runs on the active master. This resolves my prior Blocker 2 / the aggregated issuecomment-5068763565-item-3 finding.

Serialization compatibility. CdcProgressReportSerializer (engine-server/task/operation) writes every field explicitly via ObjectDataOutput/ObjectDataInput (owner tag, reader vs. enumerator branch, accuracy enum ordinal, nullable longs, position map) — no generic readObject()/writeObject() for the CDC payload itself. This resolves SEZ9's Issue 2 (unsafe deserialization) from 07-24. ReportCdcProgressOperation and CollectCdcEnumeratorProgressOperation are registered as new IdentifiedDataSerializable class IDs 29/30 in TaskDataSerializerHook (previous max was 28), which is a purely additive registration — no existing operation's wire ID or format changes, so this is safe for a rolling upgrade in the sense that old members simply won't recognize the new operation types (which is expected for new functionality) rather than misinterpreting existing traffic. One thing I checked specifically because it looked similar to the earlier issue: CollectCdcEnumeratorProgressOperation.readInternal() does use a bare in.readObject() for TaskGroupLocation (no explicit class token, unlike TaskLocation elsewhere which uses in.readObject(TaskLocation.class)). This is not the same risk as the original finding — it's Hazelcast's own typed ObjectDataInput/ObjectDataOutput serialization resolved through Hazelcast's registered-type mechanism for an existing, already-pervasively-used internal engine type (TaskGroupLocation), not raw Java ObjectInputStream deserialization of an attacker-controllable class name. This matches what I noted on 07-29 ("not the CDC report payload deserialization issue we discussed earlier") — confirmed again independently this round.

Fencing / latest-only store. CdcProgressService.newerReport():

if (current == null
        || candidate.getExecutionAttemptId() > current.getExecutionAttemptId()
        || (candidate.getExecutionAttemptId() == current.getExecutionAttemptId()
                && candidate.getReportSequence() > current.getReportSequence())) {
    return candidate;
}
return current;

Correct monotonic ordering: newer attempt always wins, same-attempt ties broken by a strictly increasing per-task sequence (not wall-clock time — this was my original Blocker 1 from the very first round, and it's been fixed since 07-24). removePipeline() is wired from SeaTunnelServer.removeMetrics(), so reports don't leak past pipeline cleanup.

1.2 Compatibility

Overall: fully compatible, with one real gap I'm raising for the first time this round (Issue 1).

  • Config/options: none added, changed, or removed. No docs/en/docs/zh config-reference update is needed for that reason (SEZ9's earlier config-doc concern is genuinely not applicable — confirmed, nothing in the diff touches an Option).
  • Checkpoint/restore: untouched. Progress reports are not part of checkpoint state; lastCompletedCheckpointPosition/restoredPosition are explicitly reported as UNSUPPORTED until the corresponding lifecycle callbacks exist — an honest signal rather than a guess, which I like.
  • HybridSplitAssigner, SnapshotSplitAssigner, IncrementalSplitAssigner: only gained a new interface (CdcEnumeratorProgressSource) and one new method each. No existing constructor or method signature removed/changed — I independently re-diffed these three files and confirm SEZ9's original "possible API break" concern here is not reproducible on the current head (my prior "rejected with evidence" disposition stands).
  • IncrementalSourceEnumerator: gained a 4-arg constructor, but the old 2-arg constructor is kept and delegates (this(context, splitAssigner, "UNKNOWN", "UNKNOWN")) — correctly backward compatible.
  • IncrementalSourceReader (new finding — see Issue 1 below): the constructor gained a required CdcReaderProgressTracker parameter with no backward-compatible overload. Unlike the enumerator, there's no delegating old-signature constructor here. I checked all four other CDC connectors that extend IncrementalSource in this repo (Mongo, Oracle, Postgres, SQLServer) — none of them override createReader() or call new IncrementalSourceReader(...) directly, so nothing in-tree breaks. But IncrementalSourceReader and IncrementalSource.createReader() are both public/non-final, i.e. connector-cdc-base is meant to be extended by out-of-tree CDC connectors, and any such external subclass that overrides createReader() and calls the old 8-arg constructor directly will fail to compile against this change (a loud, not silent, break — see severity note in Issue 1).

1.3 Performance / Side effects

  • CPU: bounded — one AtomicReference.updateAndGet per emitted record, one HashMap/stream scan per enumerator sample (not per record).
  • Memory/GC: one small immutable ReaderState + CdcReaderProgressReport allocated per emitted record (see 1.1); one CdcEnumeratorProgressReport + activeSplits list per enumerator sampling tick. No unbounded growth — CdcProgressService is latest-only (one entry per reader task / one per enumerator vertex), no history retained.
  • Network: reader reports batch onto the existing periodic worker→master metrics channel; enumerator reports add one additional coordinator→worker→coordinator round trip per sampling tick, only when there's at least one active CDC enumerator task group. Bounded by the existing metrics interval (EngineConfig#getJobMetricsBackupInterval).
  • Concurrency: AtomicReference CAS on the reader side, synchronized (context) around IncrementalSourceEnumerator.getCdcProgress() (shares the assigner's existing lock granularity), ConcurrentHashMap.compute in the master store. I didn't find a new lock ordering or contention pattern beyond what already exists for metrics.
  • Resource release: task-group completion + SeaTunnelServer.removeMetrics() clean up both provider registration and master-side state.

1.4 Error handling & logging

reportReaderCdcProgress() catches InterruptedException (restores interrupt status, logs at warning) and generic Exception (logs at warning) around the whole reporting attempt, so a transport failure never propagates into and fails the data task — it's isolated to "we'll try again next tick." CollectCdcEnumeratorProgressOperation fails loudly with IllegalStateException if a non-master caller tries to invoke it, which is the right fail-fast behavior for an ownership invariant. I didn't find any place where connector-native offset/position values are logged verbatim at a level that would leak credentials — the position maps only carry binlog-style file/position pairs, not connection strings.

2. Code Quality Assessment

2.1 Coding standards / comment completeness

New files carry ASF headers, no wildcard imports, @Experimental is applied consistently to every new api.cdc type. Class/method Javadoc is present and substantive on the core contracts (CdcProgressProvider, CdcReaderProgressTracker, CoordinatorService.collectCdcEnumeratorProgress() — the latter's Javadoc specifically documents the failover/placement-rebuild invariant I was originally worried about, which is a nice touch). I don't have a new comment-completeness complaint on this pass beyond what I already flagged as non-blocking on 07-26 (identity/threading contract comments on CdcProgressReportSource) — that one remains a reasonable, low-priority polish item but I'm not re-raising it as a numbered issue since it was already non-blocking and unchanged.

2.2 Test coverage & stability

Confirmed present and passing (see CI section below for direct evidence from the current head's own CI run, not just reading the test files): CdcProgressModelTest (DTO invariants — defensive copying, accuracy/value contract), CdcReaderProgressTrackerTest (position-change timestamp semantics, SNAPSHOT→CATCH_UP→INCREMENTAL transitions), IncrementalSplitAssignerTest/SnapshotSplitAssignerTest (assignment-status derivation, same-split watermark pairing), CdcProgressServiceTest (latest-only fencing), ReportCdcProgressOperationSerializationTest (round-trip wire codec via real BufferObjectDataOutput/BufferObjectDataInput, not a mock), TaskExecutionServiceTest and CoordinatorServiceTest (runtime collection/placement/cleanup paths — this is the execution-path coverage I originally asked for on 07-26 as Blocker/daniel-issue-1, and it is present).

I looked specifically for flaky-test red flags in the new CDC coverage: no Thread.sleep in the new test methods, the async runtime tests use Hazelcast's own test-cluster bring-up rather than fixed sleeps, and I don't see shared mutable static state across the new test classes. Stability rating: Stable.

2.3 Documentation

docs/en/developer/cdc-progress.md and docs/zh/developer/cdc-progress.md are present, linked from docs/sidebars.js, and both cover ownership, the non-blocking provider contract, the accuracy table, runtime collection (including the coordinator-owned enumerator path and failover rebuild), lifecycle/cleanup, and current limitations (no REST/CLI/metrics exposure yet, checkpoint/restore positions still UNSUPPORTED). I compared the two files line-for-line in content and they're substantively equivalent, not just token pass-throughs. This closes my daniel-issue-2 blocker from 07-26.

3. Architectural Soundness

This lands where I concluded on 07-30 and reconfirm now: connectors expose local, non-blocking facts; the engine owns identity, ordering (attempt+sequence fencing), transport, and storage. The ownership boundary is now enforced by an explicit runtime check (CollectCdcEnumeratorProgressOperation rejecting non-master callers), not just convention. This is a reasonable long-term foundation for later REST/metrics exposure, and the accuracy-per-field model (EXACT/BEST_EFFORT/UNSUPPORTED/UNAVAILABLE) avoids the common trap of a progress API that silently lies about precision.

4. Issue Summary

# Finding Location Severity Merge gate Raised by
1 IncrementalSourceReader constructor gained a required parameter with no backward-compatible overload, unlike the sibling IncrementalSourceEnumerator change in the same PR seatunnel-connectors-v2/connector-cdc/connector-cdc-base/.../reader/IncrementalSourceReader.java:84-93 Low-Medium Non-blocking New (mine, carryover apology — missed in 7 prior rounds incl. my own)
2 Per-record ReaderState allocation on the emission hot path (informational) .../progress/CdcReaderProgressTracker.java (nextState) Low Non-blocking New (mine)
3 CI: Build not yet green on the current head fork run 31242397845 — Blocking (procedural, not source) Carryover (mine)

Issue 1 detail. IncrementalSourceReader's only constructor is now:

public IncrementalSourceReader(
        DataSourceDialect<C> dataSourceDialect, ..., DebeziumDeserializationSchema<T> debeziumDeserializationSchema,
        CdcReaderProgressTracker cdcProgressTracker) { ... }

with no overload preserving the old 8-arg form. Compare this to IncrementalSourceEnumerator, which explicitly kept IncrementalSourceEnumerator(context, splitAssigner) delegating to the new 4-arg constructor with "UNKNOWN" defaults. Nothing in this repository breaks — I verified Mongo/Oracle/Postgres/SQLServer CDC connectors all go through the shared IncrementalSource.createReader(), which this PR updates in place, so there is no in-tree caller of the old signature. The risk is scoped to hypothetical out-of-tree connectors that extend connector-cdc-base and override createReader() directly — such a caller would fail to compile, which is a safe (loud, not silent) failure mode, not a runtime correctness risk. Best improvement: for symmetry with the enumerator treatment, add a backward-compatible delegating constructor, e.g. this(dataSourceDialect, ..., debeziumDeserializationSchema, new CdcReaderProgressTracker(getPluginName(), "UNKNOWN")) or an explicit null-tracker fallback (the class already null-checks cdcProgressTracker != null at the call site in IncrementalSourceRecordEmitter, so a null tracker is a value the code already tolerates). This is not something I'd block merge on — it's a real but low-impact gap, and I'm flagging it now rather than letting an 8th round pass without anyone noticing it.

Issue 3 detail (CI). As of this review, the fork's Build run (https://github.com/goutamadwant/seatunnel/actions/runs/31242397845, triggered by the 87739880 push at 2026-08-08T05:45:31Z) is not complete: 34 jobs succeeded, 28 are still queued, 9 are in progress, and one failed —

[ERROR] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 311.269 s <<< FAILURE!
  - in org.apache.seatunnel.engine.server.resourcemanager.WorkerTagTest
java.lang.IllegalStateException: Node failed to start!
	at org.apache.seatunnel.engine.server.resourcemanager.WorkerTagTest.before(WorkerTagTest.java:43)

on unit-test (8, windows-latest) (job 93073542313), which cascaded into 3 sibling matrix legs (unit-test (11, ubuntu-latest), (11, windows-latest), (8, ubuntu-latest)) being cancelled by the matrix's fail-fast behavior. I traced this specific failure and I'm confident it is unrelated to this PR's diff: WorkerTagTest.java has a 0-line net diff in this PR versus dev (it only appears in the file list because the last dev-sync merge touched it upstream, not because this PR changes it), the failure is a Hazelcast test-node startup timeout on a windows-latest runner (a well-known category of GH Actions Windows-runner flake, not a code defect), and — importantly — every CDC-progress test class in this exact same failing job run passed with zero failures before the crash: CdcProgressModelTest (4/4), IncrementalSplitAssignerTest/SnapshotSplitAssignerTest (5/5), CdcReaderProgressTrackerTest (2/2), CoordinatorServiceTest (32/32), CdcProgressServiceTest (5/5), ReportCdcProgressOperationSerializationTest (5/5), TaskExecutionServiceTest (14/14). The PR is currently diverged from dev (ahead_by=10, behind_by=3 relative to the last review's synced state) but mergeable=true with no conflict — this is normal drift, not something requiring action. Given the unrelated failure and the fact that most of the matrix is still queued/running, my recommendation is to let the current run finish and re-run only the failed unit-test (8, windows-latest) leg (job-level rerun, not a full-workflow retrigger) rather than pre-emptively syncing dev — I don't yet have evidence this specific flake also reproduces on current dev, so I'm not recommending a sync on that basis alone per our usual guidance.

5. Merge Recommendation

Conclusion: Ready to merge after fixes

Blockers (must-fix before merge):

  • Issue 3: Get the Build check green on the current head — specifically, re-run the failed/cancelled unit-test legs (the failure looks like CI infra flake unrelated to this diff, but it needs a clean pass, not just an explanation, before merge).

Recommended (non-blocking) follow-ups:

  • Issue 1: Add a backward-compatible delegating constructor to IncrementalSourceReader for consistency with how IncrementalSourceEnumerator's constructor change was handled in this same PR.
  • Issue 2: Purely informational — the per-record ReaderState allocation is bounded and acceptable; no action needed unless a future profiling pass flags GC pressure on very high-throughput CDC streams.

No new source-level correctness, compatibility, security, or ownership blocker was found on this pass. Every previously-raised blocker (timestamp/ordering fencing, generic-deserialization safety, enumerator-collection ownership, execution-path test coverage, bilingual documentation) remains resolved on the current head. Thanks again for the sustained iteration through 7+ rounds of review — the ownership boundary and typed-report design are in good shape; this is close.

@SEZ9

SEZ9 commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the updates @goutamadwant, and thanks @nzw921rx for the detailed write-up — happy to discuss.

Build/CI: Glad the dev sync issues are resolved and code style CI is green. The local 364-test engine-server run plus the E2E compile check covers what I was worried about.

HybridSplitAssigner: Thanks for re-checking against dev. You're right — I re-diffed and the change is purely additive (implementing the new interface plus getCdcEnumeratorProgress(...)), which is source- and binary-compatible for external implementations. My earlier concern was based on an intermediate revision; consider it resolved.

Deserialization: The explicit wire codec in ReportCdcProgressOperation is exactly what I was asking for, and the added coverage for malformed collection counts and empty batches is appreciated.

Docs: Agreed there's no config surface to document. However, this PR does add a user-facing capability — operators need to know how to actually see these reports. Two concrete asks: (1) make sure all new public API types carry the @Experimental annotation, and (2) add a short docs section (or at minimum a note in the STIP-30 tracking issue) describing how the retained per-task reports are exposed/consumed. If they're engine-internal only for now with exposure coming in a follow-up, say so explicitly in the Javadoc so connector authors don't build against assumptions.

On @nzw921rx's consolidation proposal: I think the analysis is directionally right. Reader and enumerator reports should stay distinct types — they own different facts, and merging them would blur accuracy semantics. But the engine-side plumbing (envelope, operation payload, sequence ordering, latest-report storage in CdcProgressService) is genuinely duplicated and will be painful to keep in sync. My preference: keep CdcReaderProgressProvider/CdcEnumeratorProgressProvider as-is on the connector-facing side (the split avoids type-erasure awkwardness in provider discovery), but collapse the transport/storage path into a single tagged envelope and one ordering/storage map keyed by role. Since the API is experimental, now is the cheapest time to do this — I'd rather not defer it.

@goutamadwant if you can address the docs/@Experimental items and the engine-side consolidation, I think this is close. Naming can stay as-is; the current names are consistent with what the types actually represent.

@DanielLeens

DanielLeens commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Thanks @SEZ9. On the @Experimental ask specifically — that one's already fully satisfied on the current head, no action needed: I just re-checked every public type under seatunnel-api/.../api/cdc/ (CdcProgressProvider, CdcProgressReport, CdcReaderProgressReport, CdcEnumeratorProgressReport, CdcProgressValue, CdcProgressPosition, CdcProgressAccuracy, CdcProgressLifecycle, CdcSnapshotAssignmentStatus, CdcSnapshotSplitProgress) and all ten carry @Experimental — consistent with what I noted in my own review (2.1). Good to mark that one closed.

The docs-exposure ask and the engine-side transport/storage consolidation are both reasonable, but they're design-direction questions for @goutamadwant and @nzw921rx to settle rather than something I'd weigh in on as a correctness gate — my review already treats "engine-internal only for now" as an accurate, honest state of this PR (Section 3, Architectural Soundness), so an explicit Javadoc note to that effect seems like a cheap, worthwhile addition regardless of which way the consolidation discussion goes. I'd only flag one thing on the consolidation proposal itself: if it lands as a follow-up rather than in this PR, worth confirming it doesn't reopen the attempt/sequence fencing correctness I verified in CdcProgressService.newerReport() — that logic needs to survive being reshaped into a single tagged envelope/ordering map, not just be preserved by convention.

Neither of these changes my Issue Summary or merge recommendation — Issue 3 (CI) remains the only blocker from my side, and Issue 1 (the IncrementalSourceReader constructor gap) remains a non-blocking follow-up.

@goutamadwant

Copy link
Copy Markdown
Collaborator Author

@SEZ9 thanks again for the review!

I rechecked the current head against these points. The public CDC progress types already have @experimental and both English and Chinese docs clarify that this data stays inside the engine for now and is not exposed through REST CLI or metrics

The implementation also uses the common CdcProgressProvider and CdcProgressReport contracts with one tagged CdcProgressEnvelope one operation payload and one role keyed service map for reader and enumerator reports

The latest CI failures are WorkerTagTest failing to start a Hazelcast node on Windows and PaimonSinkCDCIT timing out on an existing sink writer thread. The CDC progress tests passed in the same run and neither failing path is changed by this PR

Could you please recheck the latest head and let me know if any specific change is still missing cc @DanielLeens

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What Problem Does This PR Solve?

Operators running CDC jobs (MySQL today, on connector-cdc-base classes shared by Oracle/Postgres/SQLServer/MongoDB CDC) have no runtime visibility into snapshot vs. incremental progress, split assignment state, or how far a reader has actually consumed. Today the only signal is connector logs, which makes a stuck or lagging CDC job hard to diagnose. This PR adds an experimental org.apache.seatunnel.api.cdc progress contract, wires non-blocking reader/enumerator progress capture into the connector runtime path, adds coordinator-owned enumerator collection with explicit transport serialization, and retains only the latest report per task on the master with attempt/sequence fencing and pipeline-cleanup hooks. It intentionally stops short of exposing this data through REST/CLI/metrics or changing checkpoint/restore behavior — those are separate STIP-30 slices.

Note on this round (re-review, not a new patch)

Thanks for the continued iteration, @goutamadwant, and thanks @SEZ9 and @nzw921rx for the earlier discussion. Per the task, this is a fresh full re-review of the current head (fb16ded0) rather than an incremental diff review, so I re-derived every finding below from the current source rather than trusting my own prior write-ups blindly.

The practical result: I compared fb16ded0 against my last source-clear full pass (87739880771a, 2026-08-09) and confirmed via git log/GitHub compare that every commit in between is a dev-sync merge — zero files under seatunnel-api/.../api/cdc, connector-cdc-base, or the CDC-touched engine paths changed. So the CDC-progress implementation itself is unchanged since that round; what changed is more upstream dev commits picked up through merges. I independently re-verified the load-bearing pieces anyway rather than assuming that: the position-change timestamp logic in CdcReaderProgressTracker, the attempt/sequence fencing in CdcProgressService.newerReport(), the master-only ownership check in CollectCdcEnumeratorProgressOperation, the purely-additive serializer IDs in TaskDataSerializerHook, the IncrementalSourceReader constructor shape, and both docs files — all confirmed against the actual current-head source (see 1.1/1.2/2.3 below), not just re-asserted from memory.

On the pending thread: my reply to @SEZ9 on 2026-08-09 already confirmed the @Experimental annotation ask is satisfied and treated the docs-exposure/consolidation questions as design-direction items for the author and @nzw921rx rather than correctness gates. Nothing on this head changes that. @goutamadwant's 2026-08-09 comment says the CDC progress tests passed in the same CI run where WorkerTagTest (Windows) and PaimonSinkCDCIT failed — I independently re-verified that diagnosis below (Section 1.4/Issue 3) rather than taking it at face value, and it holds up.

1. Code Change Review

1.1 Core Logic Analysis

Reader hot path (record emission → progress tracker). Confirmed unchanged and correct on this head:

// IncrementalSourceRecordEmitter.emitRecord() — connector-cdc-base, lines 100-115
public void emitRecord(...) throws Exception {
    final Iterator<SourceRecord> elementIterator = sourceRecords.iterator();
    while (elementIterator.hasNext()) {
        SourceRecord next = elementIterator.next();
        reportMetrics(next);
        processElement(next, collector, splitState);
        markEnterPureIncrementPhase(next, splitState);
        if (cdcProgressTracker != null) {
            cdcProgressTracker.recordEmission(
                    splitState, getMessageTimestamp(next), System.currentTimeMillis());
        }
    }
}

recordEmission() feeds CdcReaderProgressTracker.nextState() (CdcReaderProgressTracker.java:115-144), which is the piece that matters for correctness — the API contract is that lastPositionChangeAt reflects when the emitted position actually changed, not when progress was later collected:

// CdcReaderProgressTracker.nextState(), lines 123-132
boolean emittedPositionChanged =
        emissionObserved
                && offset != null
                && (previous == null
                        || !previous.emissionObserved
                        || !Objects.equals(previous.offset, offset));
long lastPositionChangeAt =
        emittedPositionChanged
                ? observedAt
                : previous == null ? 0L : previous.lastPositionChangeAt;

observedAt is the System.currentTimeMillis() passed in at the emission call site, and it is only adopted when the offset actually advances; otherwise the previous stored timestamp is carried forward via the AtomicReference.updateAndGet CAS. This is exactly the fix that closed my original Blocker 1 several rounds ago, and it still holds. The update itself is a per-record AtomicReference CAS with an in-memory lambda — no network, disk, or lock acquisition, confirmed non-blocking.

Enumerator collection ownership. This was the subject of the longest back-and-forth in this thread (my Blocker 2, @nzw921rx's ownership concern, my confirmation two rounds later). Current head:

// CollectCdcEnumeratorProgressOperation, lines 49-52
Address callerAddress = getCallerAddress();
Address masterAddress = getNodeEngine().getMasterAddress();
if (callerAddress == null || !callerAddress.equals(masterAddress)) {
    throw new IllegalStateException(...);
}

The active coordinator resolves current enumerator task placement from the running job master / physical plan / slot ownership and pulls the report from the owning member; a non-master caller is rejected fail-fast. This is a real runtime-enforced invariant, not just a convention, and it's unchanged from what I verified in my last full pass.

Fencing / latest-only store. CdcProgressService.newerReport() (lines 80-89):

private CdcProgressEnvelope<?> newerReport(
        CdcProgressEnvelope<?> current, CdcProgressEnvelope<?> candidate) {
    if (current == null
            || candidate.getExecutionAttemptId() > current.getExecutionAttemptId()
            || (candidate.getExecutionAttemptId() == current.getExecutionAttemptId()
                    && candidate.getReportSequence() > current.getReportSequence())) {
        return candidate;
    }
    return current;
}

Correct monotonic ordering: newer execution attempt always wins; same-attempt ties are broken by a strictly increasing per-task sequence, not wall-clock time. This is the logic that closed my original Blocker 1/2 pairing, and I re-verified it byte-for-byte on this head.

Serialization compatibility. TaskDataSerializerHook registers REPORT_CDC_PROGRESS_OPERATION = 29 and COLLECT_CDC_ENUMERATOR_PROGRESS_OPERATION = 30 (previous max was 28) — purely additive class-ID registration, no existing operation's wire format changes. CdcProgressReportSerializer (not re-pasted here since unchanged from prior verification) still writes every CDC report field explicitly through ObjectDataOutput/ObjectDataInput, with no generic readObject() fallback for the report payload itself.

Runtime chain (confirmed unchanged on this head):

CDC reader record path
  IncrementalSourceRecordEmitter.emitRecord() [connector-cdc-base]
    -> CdcReaderProgressTracker.recordEmission()/nextState()  (AtomicReference CAS, non-blocking)
  -> SourceFlowLifeCycle.getCdcReaderProgress() -> TaskExecutionService.reportReaderCdcProgress()
      -> ReportCdcProgressOperation -> CdcProgressService.updateReports() [engine-server]

CDC enumerator path
  CoordinatorService.collectCdcEnumeratorProgress() (active coordinator only)
    -> resolves enumerator task placement from runningJobMasterMap / physical plan / slot ownership
    -> CollectCdcEnumeratorProgressOperation(worker)  [master-only caller check]
        -> TaskExecutionService.collectEnumeratorCdcProgress() -> SourceSplitEnumeratorTask.getCdcProgressReport()
        -> ReportCdcProgressOperation(master) -> CdcProgressService.updateReports()

Cleanup
  SeaTunnelServer.removeMetrics(PipelineLocation) -> CdcProgressService.removePipeline()

1.2 Compatibility Impact

Fully compatible, with one previously-identified, still-present non-blocking gap (Issue 1 below).

  • No config Option is added, changed, or removed — nothing in the diff touches connector configuration, so no config-doc update is needed for that reason.
  • Checkpoint/restore behavior is untouched; lastCompletedCheckpointPosition/restoredPosition are honestly reported UNSUPPORTED until their lifecycle callbacks land, rather than guessed.
  • HybridSplitAssigner, SnapshotSplitAssigner, IncrementalSplitAssigner: purely additive — a new interface (CdcEnumeratorProgressSource) plus one new method each, no existing signature removed or changed. This confirms the earlier "possible API break" concern (SEZ9's original Issue 1) is not reproducible.
  • IncrementalSourceEnumerator: gained a 4-arg constructor, but the old 2-arg constructor is preserved and delegates to it with "UNKNOWN" defaults — correctly backward-compatible.
  • IncrementalSourceReader (.../reader/IncrementalSourceReader.java:85-94): the only constructor now requires a CdcReaderProgressTracker parameter, with no delegating overload preserving the old 8-arg signature — unlike the symmetric enumerator treatment above. The single in-tree caller is IncrementalSource.createReader() (IncrementalSource.java:264-295), which this PR updates in place to construct and pass the tracker, so nothing in this repository breaks. IncrementalSourceRecordEmitter already null-checks the tracker at the call site (if (cdcProgressTracker != null), line 110), so the class itself tolerates a null/absent tracker at runtime — a backward-compatible overload is a low-risk, mechanical addition. The residual risk is scoped to a hypothetical out-of-tree connector that extends connector-cdc-base and calls the old constructor directly; such code would fail to compile against this change, which is a loud, safe failure mode, not a silent runtime break. See Issue 1.

1.3 Performance / Side-Effect Analysis

  • CPU/GC: one AtomicReference.updateAndGet per emitted record on the reader side (bounded, no I/O); one enumerator-side sample per collection tick, not per record. nextState() allocates a new immutable ReaderState on every emitted record, including heartbeats with no offset change — small and bounded, but continuous rather than occasional on a high-throughput binlog stream. Not a blocker, purely informational (Issue 2).
  • Network: reader reports batch onto the existing periodic worker-to-master metrics channel; enumerator reports add one coordinator-to-worker-to-coordinator round trip per sampling tick, only when a CDC enumerator task group is active, bounded by the existing metrics interval.
  • Storage: CdcProgressService is latest-only — one entry per reader task, one per enumerator vertex — no unbounded growth, and entries are removed on pipeline cleanup.
  • Concurrency: AtomicReference CAS on the reader side, master-only gating on the enumerator collection path, ConcurrentHashMap.compute in the store update. No new lock-ordering pattern beyond what already exists for metrics reporting.

1.4 Error Handling and Logging

Reporting failures on the worker side are isolated: transport exceptions are caught and logged rather than propagated into and failing the data task, so a transient master-communication issue degrades to "retry next tick" rather than job failure. CollectCdcEnumeratorProgressOperation fails fast with IllegalStateException when a non-master caller invokes it — correct behavior for enforcing the ownership invariant. Reported position values are connector-native offset/position pairs (e.g., binlog file/position), not credentials or connection strings, so there's no sensitive-data-in-logs concern here.

Issue 1: IncrementalSourceReader constructor gained a required parameter with no backward-compatible overload, unlike the sibling IncrementalSourceEnumerator treatment in the same PR.

  • Location: seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/source/reader/IncrementalSourceReader.java:85-94
  • Problem: The only constructor requires CdcReaderProgressTracker; the enumerator's equivalent constructor change in this same PR kept a delegating old-signature overload, this one does not.
  • Potential risk: Source-incompatible (compile-time break, not a runtime/silent break) for any out-of-tree connector extending connector-cdc-base and calling this constructor directly. No in-tree caller is affected.
  • Best improvement: Add a delegating constructor that preserves the old 8-arg signature, e.g. falling back to a default/UNKNOWN-tagged tracker or an explicit null (the class already tolerates a null tracker at the IncrementalSourceRecordEmitter call site), mirroring how IncrementalSourceEnumerator's constructor change was handled.
  • Severity: Low-Medium
  • Raised by another reviewer: No (raised by me previously in this same review thread on 2026-08-09; carried forward unchanged since no CDC file changed since then — see the re-review note above for why I'm not presenting this as new)

Issue 2: Per-record ReaderState allocation on the emission hot path (informational).

  • Location: seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/source/progress/CdcReaderProgressTracker.java (nextState(), lines 115-144)
  • Problem: A new immutable ReaderState is allocated for every emitted record, including records where nothing observable changed.
  • Potential risk: Bounded, cheap per-object GC churn; only a concern if a future profiling pass on very high-throughput CDC streams flags GC pressure.
  • Best improvement: No action needed now; worth revisiting only if profiling data shows it matters.
  • Severity: Low
  • Raised by another reviewer: No

2. Code Quality Assessment

2.1 Coding Standards

New files carry ASF license headers, no wildcard imports, and @Experimental is applied consistently across every new public type under org.apache.seatunnel.api.cdc (CdcProgressProvider, CdcProgressReport, CdcReaderProgressReport, CdcEnumeratorProgressReport, CdcProgressValue, CdcProgressPosition, CdcProgressAccuracy, CdcProgressLifecycle, CdcSnapshotAssignmentStatus, CdcSnapshotSplitProgress) — I re-checked all ten on this head. Class/method Javadoc is present and substantive on the core contracts (CdcProgressProvider, CdcReaderProgressTracker, CoordinatorService.collectCdcEnumeratorProgress(), the latter specifically documenting the failover/placement-rebuild invariant). One pre-existing, still-unaddressed, non-blocking polish item: CdcProgressReportSource would benefit from an explicit comment on its identity/threading contract — this was already flagged as low-priority and non-blocking previously and I'm not re-numbering it as a fresh issue since nothing changed here. New non-trivial fields such as IncrementalSourceReader.cdcProgressTracker (line 79) don't carry per-field Javadoc, but the class is small and the field's purpose is adequately covered by the constructor parameter and the null-check at its one use site — flagging as a minor (Medium-leaning-low) polish opportunity rather than a blocker, since it doesn't rise to the level of a core protocol/state field.

2.2 Test Coverage and Test Stability

Coverage remains present and substantive: CdcProgressModelTest (DTO invariants), CdcReaderProgressTrackerTest (position-change timestamp semantics, lifecycle transitions), IncrementalSplitAssignerTest/SnapshotSplitAssignerTest (assignment-status derivation), CdcProgressServiceTest (latest-only fencing), ReportCdcProgressOperationSerializationTest (wire-codec round trip via real BufferObjectDataOutput/BufferObjectDataInput), TaskExecutionServiceTest and CoordinatorServiceTest (runtime collection/placement/cleanup paths). None of these files changed since my last full pass, and I don't see hard sleeps, fixed ports, external services, or shared mutable static state in the added CDC test classes; the async runtime test uses condition-based waiting rather than fixed sleeps. Stability rating: Stable.

2.3 Documentation Updates

docs/en/developer/cdc-progress.md and docs/zh/developer/cdc-progress.md are present on this head, linked from docs/sidebars.js, and I read both in full this round rather than assuming parity: they cover ownership semantics, the non-blocking provider contract, the per-field accuracy table, runtime collection (including the coordinator-owned enumerator path and failover rebuild), lifecycle/cleanup, and — directly answering @SEZ9's exposure question — an explicit "Current limitations" section stating "This slice does not expose progress through REST, the CLI, or metrics." Both files are substantively equivalent in content, not a token pass-through translation. No config-reference doc is needed since no Option is touched.

3. Architectural Soundness

3.1 Elegance of the Solution

This is a precise fix, not a workaround: connectors expose local, non-blocking facts (reader position, enumerator assignment state); the engine owns identity, ordering (attempt+sequence fencing), transport, and storage. The ownership boundary between worker-sampled reader reports and coordinator-pulled enumerator reports is enforced by a runtime check, not just convention.

3.2 Maintainability

The reader/enumerator report split (kept distinct per @nzw921rx's original observation that they own different facts) combined with the shared CdcProgressProvider/CdcProgressReport/tagged-envelope infrastructure (added specifically in response to @nzw921rx's duplication concern) is a reasonable middle ground. @SEZ9's follow-up point that the engine-side plumbing (envelope, operation payload, ordering, storage in CdcProgressService) still has some structural duplication between reader and enumerator handling is fair as a longer-term simplification target, but it's a design-direction question rather than a correctness defect on this head — I already noted in my 2026-08-09 reply that if that consolidation happens as a follow-up, it needs to preserve the attempt/sequence fencing math in newerReport() verified above, not just by convention.

3.3 Extensibility

The accuracy-per-field model (EXACT/BEST_EFFORT/UNSUPPORTED/UNAVAILABLE) avoids a progress API that silently overclaims precision, which should extend cleanly to other CDC connectors and to the eventual checkpoint/restore position wiring without a contract change. The @Experimental annotation on every public type gives the project room to adjust before this becomes a stable contract.

3.4 Historical-Version Compatibility

No serialization format for any pre-existing operation changes; the two new operation class IDs (29, 30) are purely additive on top of the previous max (28). No config option, checkpoint format, or public method signature used by other in-tree code is removed or altered. The one residual compatibility gap (Issue 1) is scoped to hypothetical out-of-tree extenders and fails at compile time, not at runtime against old state.

4. Issue Summary

Number Issue Location Severity
1 IncrementalSourceReader constructor gained a required parameter with no backward-compatible overload connector-cdc-base/.../reader/IncrementalSourceReader.java:85-94 Low-Medium
2 Per-record ReaderState allocation on the emission hot path (informational) connector-cdc-base/.../progress/CdcReaderProgressTracker.java (nextState) Low
3 CI: the current head's fork Build run has a completed job failure (unit-test (11, windows-latest)), unrelated to this PR's diff, still in progress overall fork run 31339051848 Blocking (procedural, not source)

5. Merge Recommendation

Conclusion: Ready to merge after fixes

  1. Blockers — must be fixed:

    • Issue 3 (CI): get a clean Build run on the current head. I checked the fork's Actions run for this exact head SHA (fb16ded0, triggered 2026-08-09T22:18:15Z): of 84 check runs, 13 succeeded, 58 are still queued/in-progress, 3 were cancelled, and exactly 1 completed with failure — Run / unit-test (11, windows-latest), which failed at its "run all modules unit test (Windows)" step. I confirmed via the GitHub compare API that neither WorkerTagTest.java nor PaimonSinkCDCIT (the two known-flaky classes in this failure category from the previous round) appear anywhere in this PR's diff against dev, so this failure is not caused by this PR's own changes — it matches the same Windows Hazelcast-node-startup flake category identified in my 2026-08-01 review, and lines up with @goutamadwant's own 2026-08-09T22:18 comment describing this exact same failure pattern for this push, with CDC progress tests passing in the same run. I was not able to pull the raw job log text in this pass (log-storage fetch failed in my environment), so I'm relying on the check-run step name, the historical failure signature, and the author's own report rather than a fresh stack trace — but all three agree. Given most of the matrix is still queued and only one Windows leg failed so far, the practical next step is to let the run finish and re-run the failed/cancelled unit-test legs at job level rather than retriggering the whole workflow; I don't have fresh evidence this exact flake is already fixed on current dev, so I'm not recommending a dev sync on that basis. This needs a green run before merge, not just an explanation, since I can't rule out a masked CDC-relevant failure once the rest of the matrix finishes.
  2. Recommended fixes — non-blocking:

    • Issue 1: add a backward-compatible delegating constructor to IncrementalSourceReader, mirroring how the IncrementalSourceEnumerator constructor change was handled in this same PR.
    • Issue 2: purely informational; no action needed unless a future profiling pass flags GC pressure from per-record ReaderState allocation on very high-throughput streams.
    • Coding standards: consider a short Javadoc note on IncrementalSourceReader.cdcProgressTracker and on CdcProgressReportSource's identity/threading contract (carried over, non-blocking).

Overall assessment: this is a well-designed, additive CDC observability slice that has closed every source-level blocker raised across this review thread (naming, ownership, deserialization safety, timestamp/ordering correctness, enumerator-collection ownership, documentation). Nothing in the CDC-progress implementation itself changed since my last source-clear pass — the diff since then is entirely upstream dev-sync merges — and I independently re-verified the load-bearing correctness pieces (position-change timestamp, attempt/sequence fencing, master-only ownership check, additive serializer IDs) directly against the current head rather than re-asserting prior conclusions. The only thing standing between this and merge is a clean CI run plus, ideally, the small constructor-compatibility fix in Issue 1. No alternative implementation approach is warranted here — the design direction is sound.

@goutamadwant

Copy link
Copy Markdown
Collaborator Author

@DanielLeens Synced with latest dev and restored the previous IncrementalSourceReader constructor as a delegating overload. The compatibility path shares one UNKNOWN progress tracker with the record emitter while normal connector construction keeps its connector-specific metadata. Added a constructor compatibility test and reran the focused CDC, API, and Zeta tests.

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up on head 122d0af5: in my last review the only remaining gate was CI, because the apache-side Build was still in_progress and the fork run was queued. That has changed. The required Build has now completed with SUCCESS on this exact head, and Signal pull request update is green too.

The head has not changed since that review, and I had no source-side blockers (Issue 1 is a low-severity follow-up). CI was the only remaining blocker, so I am updating my conclusion to approve.

As I said before, it would still be good for a committer who knows the coordinator lifecycle to take a final look at this experimental surface before merging, and merge needs a committer approval under branch protection. Thanks again for your patience through this long review, @goutamadwant!

@goutamadwant

Copy link
Copy Markdown
Collaborator Author

Fixed the CDC service and JobMaster wiring in the cleanup test fixtures. The broader Java 11 run had one ResourceManager startup setup error.

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick follow-up after the dev sync, @goutamadwant! Since my approval of 122d0af5, the head moved to c5104805 through two commits: the dev merge 50e65a66 and the test-only fixture commit c5104805. I re-checked both against the full PR diff and the runtime call chain on this exact head. The review is by code reading only; nothing was executed locally.

On your comment (11-07): the fixture fix is correct, and it is the right place to fix it. dev brought two new cases into StateTransitionCleanupTest (from #11495, "Reset metrics after pipeline recovery", and #12377, "Preserve cancellation after worker failure"). They build a JobMaster around a bare mock(SeaTunnelServer.class) and call initStateFuture() on a SubPlan that has no JobMaster. With this PR, both of those now touch the CDC progress service, so the old fixtures would hit an NPE. Your three stub lines fix exactly that and nothing else. About the "ResourceManager startup setup error" in your broader local Java 11 run: I cannot reproduce it from CI. On this head, all four unit-test legs, both engine-resource-managers-it legs, both engine-v2-it legs and both engine-k8s-it legs passed on the first attempt (fork run 42402487063). If you can share the test class name and the first stack frame, I am happy to take a look. Unless it reproduces on dev without this PR, I would treat it as local environment noise. It does not block this PR.

What Problem Does This PR Solve?

  • User pain point: Zeta gives no runtime view of a CDC job's snapshot assignment progress or its reader position and lifecycle, beyond raw checkpoints and logs (STIP-30, #11364).
  • Fix approach: connectors opt in through SupportCdcProgress and publish immutable progress reports. Readers record progress after an emission succeeds, and the enumerator publishes a snapshot after each assigner mutation. Workers sample on the metrics tick and send the reports to the master. The coordinator polls enumerators without blocking and stores the latest reports in CdcProgressService, keyed by generation and owner.
  • Summary: an opt-in, engine-internal foundation for observing CDC progress. Checkpoint semantics are unchanged.

1. Code Change Review

1.1 Core Logic Analysis

Dev merge 50e65a66. The merge has one hand-resolved hunk, in IncrementalSource.java:101-104. In the same window, dev added SupportCoordinate there (#12776, Spark CDC support), and the merge keeps both interfaces:

public abstract class IncrementalSource<T, C extends SourceConfig>
        implements SeaTunnelSource<T, SourceSplitBase, PendingSplitsState>,
                SupportCdcProgress,
                SupportCoordinate {

SupportCoordinate is an empty marker interface that only the Spark/Flink translation layer uses (CoordinatedSource), so the two cannot conflict. I compared the PR's own diff file by file before and after the merge. Apart from this import/implements line and the fixture commit, all 62 other files are byte-identical to what I reviewed and approved on 122d0af5. I also checked that the new dev test IncrementalSourceEnumeratorTest still compiles against the PR. It uses the legacy two-argument IncrementalSourceEnumerator(context, splitAssigner) constructor, which the PR keeps (IncrementalSourceEnumerator.java:67).

Fixture commit c5104805. It touches only StateTransitionCleanupTest:

  • :258 and :299 stub getCdcProgressService() on the mocked SeaTunnelServer and return the real test server's service. Without this stub, the convenience JobMaster constructor dereferences seaTunnelServer.getCdcProgressService() (JobMaster.java:231-232) and fails.
  • :430 sets mockJobMaster() on the sub-plan before initStateFuture(). SubPlan.initStateFuture() now calls jobMaster.registerCdcProgressContext(...) first (SubPlan.java:192). The other cases in that class already set a job master the same way (:457, :495, :553).

Production impact: none. In the real server, cdcProgressService is a final field created in the SeaTunnelServer constructor, so it is never null. Every production SubPlan gets its JobMaster before initStateFuture(); the existing SubPlan code already relies on jobMaster unconditionally, for example in SubPlan.java:270.

Runtime path (unchanged from the approved version):

Reader (worker): IncrementalSourceRecordEmitter.emitRecord OK -> CdcReaderProgressTracker.recordEmission
  metrics tick -> reportCdcProgressAsync (skip while one is in flight) -> ReportCdcProgressOperation -> master
Enumerator: assigner mutation -> publishProgress (immutable snapshot)
  coordinator tick -> CollectCdcEnumeratorProgressOperation (<=1 in flight per worker)
    -> IncrementalSourceEnumerator.getCdcProgress() (no monitor) -> CdcProgressService (latest only)
Pipeline scope: SubPlan.initStateFuture -> registerCdcProgressContext
                SubPlan.subPlanDone   -> closeCdcProgressContext (before metrics/history cleanup)

I also re-checked how this fits with the restore path that #11495 changed on dev. prepareRestorePipeline() (SubPlan.java:561-583) now calls clearPipelineMetricsForRestore, but it does not close or reopen the CDC scope. That is fine: the restored attempt's reports replace the old ones because CdcProgressService#newerReport orders reports by execution attempt first (CdcProgressService.java:192-202). This matches docs/en/developer/cdc-progress.md:66-68.

1.2 Compatibility Impact

Fully compatible. The new API types are additive and opt-in, and the legacy constructors are kept. No checkpoint, split-serializer or released operation ID changes. Adding SupportCoordinate comes from dev, not from this PR.

1.3 Performance / Side-Effect Analysis

No change from the approved version. Recording on the reader is O(1), worker reporting does not block, there is at most one outstanding enumerator collection per worker, active-split details are capped, and the coordinator keeps only the latest report. A small observation, which is not an issue: since #12776, CDC sources can also run on Spark through CoordinatedSource. There the tracker and the enumerator snapshots are still built, but nothing reads them. This costs one O(1) update per emitted record plus one immutable snapshot per assigner mutation, which is negligible.

1.4 Error Handling and Logging

No new issues. Provider failures stay isolated per task and are logged by exception class only.

2. Code Quality Assessment

2.1 Coding Standards

The fixture lines follow the class's existing style. New public types and non-trivial methods already have Javadoc.

2.2 Test Coverage and Test Stability

Rating: Stable. The fixture commit adds wiring only. No assertion, timeout, data set or expected state changes, so the dev-side cleanup cases (#11495, #12377) still check exactly what they checked on dev. All PR tests are unchanged.

2.3 Documentation Updates

docs/en/developer/cdc-progress.md and docs/zh/developer/cdc-progress.md are unchanged and still match the code.

3. Architectural Soundness

No change. Reader and enumerator ownership stay separated, snapshots are immutable, and the service is latest-only and fenced by generation. Other CDC connectors can opt in later, and a REST/UI consumer can be built on CdcProgressService.

4. Issue Summary

Number Issue Location Severity
1 Carryover, non-blocking: string-length and frame-size bounds in CdcProgressReportSerializer are not bounded separately; agreed as a follow-up PR CdcProgressReportSerializer Low

5. Merge Recommendation

Conclusion: Ready to merge

Blockers (must fix): none.

Non-blocking: Issue 1, as the follow-up PR you already planned. #12137 stays stacked as a draft until this lands.

CI on this exact head (c5104805): green. The Apache-side Build completed with success on this SHA, and the fork run it points to passed on its first attempt. The branch is 17 commits behind dev with no conflicts, so no sync is needed.

Existing review state: I re-checked @SEZ9's last points; nothing is open apart from the serializer-bounds follow-up. As before, merging needs a committer approval under branch protection. It would also be good for someone familiar with the coordinator lifecycle to take a final look at this cross-cutting experimental surface. Thanks again for keeping this branch healthy through so many dev syncs!

@goutamadwant

Copy link
Copy Markdown
Collaborator Author

@davidzollo @nzw921rx this one is ready for a committer look.

Could you review and merge when you have time? Happy to address anything on the coordinator lifecycle side. But this PR is foundational to follow up work. Appreciate if you could have an eye on this :)

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-checked the new head 209e1de6: the only change since my last review (c5104805) is a merge of the latest dev; the PR's own diff is unchanged. All 63 PR files are byte-identical between the two heads, and dev did not touch any of them, so the merge had no conflict in this PR's code.

Previous review points: my earlier conclusion was Ready to merge with no blockers, and nothing in this merge changes that.

CI on this head: the fork run 42751630343 failed. 81 jobs passed and 11 were skipped. The non-green jobs are not related to this PR:

  • connector-file-sftp-it (11 and 17) fails with docker.io/atmoz/sftp:alpine-3.7: not found when it pulls the image. Docker Hub removed that tag, and the same failure hits every PR and dev. It is fixed on dev by #13203, merged after this sync, so this head (2 commits behind dev) does not have it yet.
  • transform-v2-it-part-2 (11 and 17) was cancelled at the 210-minute job budget while it was still running TestJsonPathTransformIT. No test had failed. The same job passed on the previous head of this PR in about 194 minutes, and on dev it currently takes 195-207 minutes. So this is the job hitting its time budget, not a regression from this PR.

@goutamadwant, the minimum next step is one more plain dev merge (to pick up #13203), then push. If transform-v2-it-part-2 hits the time budget again, re-running just that job should be enough.

Conclusion: Ready to merge

The technical conclusion is unchanged. The only open gate is a green CI run on the current head. I will re-confirm approval once that run is green.

Blockers (must fix): none (non-CI).

@nzw921rx nzw921rx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest splitting the first version of this PR to evaluate stable interface contracts firs.

@goutamadwant

Copy link
Copy Markdown
Collaborator Author

@nzw921rx sure. does this proposed split look good?

  1. seatunnel-api contract types + model tests + docs
  2. connector-cdc-base + MySQL/MongoDB reporting
  3. engine collection, wire codec and coordinator store

2 and 3 depend only on 1. Does 1 alone match what you want to review first, or should 1 include the connector-cdc-base side?

@nzw921rx

Copy link
Copy Markdown
Member

@nzw921rx sure. does this proposed split look good?

  1. seatunnel-api contract types + model tests + docs
  2. connector-cdc-base + MySQL/MongoDB reporting
  3. engine collection, wire codec and coordinator store

2 and 3 depend only on 1. Does 1 alone match what you want to review first, or should 1 include the connector-cdc-base side?

  1. Define the API only in the initial phase.

    • Mark the API as experimental.
    • Clearly document the capabilities and guarantees provided by implementations of this API.
  2. Ensure consistent CDC progress reporting across startup modes.

    • CDC supports the following startup modes: initial, earliest, latest, specific, timestamp, and snapshot-only.
    • The initial and snapshot-only modes use SnapshotSplitAssigner or SnapshotOnlySplitAssigner. The initial mode subsequently transitions to IncrementalSplitAssigner.
    • Design the API to ensure reliable and consistent progress reporting across the snapshot and incremental phases, including the transition between them.
  3. Control the performance overhead of observability. (For future implementation)

    • Performance and observability often involve trade-offs in streaming CDC workloads.
    • Introduce benchmarks to ensure that performance regressions caused by observability are measurable and remain within acceptable limits.
  4. Strictly control API complexity.

    • Keep the API minimal, well-defined, and maintainable.
    • Avoid unnecessary abstractions or overengineering.
  5. Design an extensible metrics aggregation and storage interface. (For future implementation)

    • Use in-memory aggregation windows for metrics.
    • Expose APIs that allow aggregated metrics to be observed and persisted in external time-series databases.

@goutamadwant

Copy link
Copy Markdown
Collaborator Author

Thanks @nzw921rx. so this can be the plan:

  1. API-only PR first: the seatunnel-api types, marked experimental, with a guarantees section and a table of expected reporting for each startup mode (initial, earliest, latest, specific, timestamp, snapshot-only). I'll drop the checkpoint/restore position fields from v1 and add them with the restore phase.
  2. [Feature][Zeta] Collect CDC progress reports on the coordinator #11512 becomes the engine slice on top of it; connector-cdc-base + MySQL as a separate draft. [Test][E2E] Validate MySQL CDC progress reporting #12137 stays the end-to-end gate.
  3. Benchmarks: I'll add a reader-tracker throughput benchmark with the connector slice.
  4. Aggregation/persistence: v1 stays latest-snapshot only per [STIP-30][Feature][CDC] : Unified CDC lag and progress observability model #11364. I'll keep the store behind an interface so that can be added later, and raise it on the issue if we want it in scope.

Add the org.apache.seatunnel.api.cdc report types and the SupportCdcProgress
marker so CDC sources can expose their latest progress to the engine. The
contract is experimental: reader and enumerator reports stay separate, every
value carries its own accuracy, and connector-native positions keep an explicit
position family.

The developer doc states the provider guarantees and the expected lifecycle,
assignment status and position accuracy for each startup mode, including the
COMPLETED stage that bounded jobs reach. Checkpoint and restore positions are
left out until the restore lifecycle is wired.
Workers sample reader reports from TaskExecutionService on the
print-execution-info-interval cadence, batch them per worker and send them to
the coordinator in one operation. The coordinator collects enumerator reports
separately, locating the enumerator task group from the job plan and slot
assignments, and keeps only the latest report per owner and task with
execution-attempt and sequence fencing. Reports are removed with their pipeline
and cannot reopen a cleaned-up scope.

The wire codec encodes enums by name and bounds entry and field counts. Nothing
is exposed through REST, the CLI or metrics in this slice.
@goutamadwant
goutamadwant force-pushed the GH-11364-cdc-progress-v2 branch from 209e1de to 738c0ac Compare November 12, 2026 01:01
@goutamadwant goutamadwant changed the title [Feature] [CDC] Wire CDC progress reporting into runtime [Feature][Zeta] Collect CDC progress reports on the coordinator Nov 12, 2026
@goutamadwant

Copy link
Copy Markdown
Collaborator Author

@nzw921rx the split is up:

  1. API only: [Feature][API] Add experimental CDC progress contract #13239. All types are experimental; docs/en/developer/cdc-progress.md has the provider guarantees and a table of expected lifecycle, assignment status and position accuracy for each startup mode. Two changes against this PR: the checkpoint/restore position fields are dropped from v1, and COMPLETED is added to the lifecycle so snapshot-only and bounded jobs have a terminal state.
  2. Connector side (connector-cdc-base, MySQL, MongoDB test): draft [Feature][CDC] Report reader and enumerator progress from connector-cdc-base #13240, on top of [Feature][API] Add experimental CDC progress contract #13239.
  3. This PR is now the engine slice on top of [Feature][API] Add experimental CDC progress contract #13239; the diff shows both until [Feature][API] Add experimental CDC progress contract #13239 merges.

Points 3 and 5 stay out of this round as discussed.

@goutamadwant
goutamadwant marked this pull request as draft November 12, 2026 04:12
@SEZ9

SEZ9 commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

Thanks @goutamadwant for the clear answer on F7. If both CdcEnumeratorProgressReport constructors in 9170d5e78a document that present counts must be non-negative and that assigned = completed + running is enforced only when all three are EXACT, that is the invariant I was looking for; I'll confirm it against the diff rather than take it as closed here. Noted that 122d0af5fa only adds the SnapshotSplitAssignerTest ordering fix and that docs/*/developer/cdc-progress.md is unchanged since d2f8193c97.

Now that the API types and docs/en/developer/cdc-progress.md have moved to the API-only PR, could you point me to where the remaining items from my earlier review land, so nothing falls between the two PRs?

  • F2 (no credentials/secrets in connector-native position payloads) and F4 (runtime-collection docs describing pull/derive vs. the registration-based enumerator report path) — handled in the doc in the API-only PR, or still open?
  • F5 (which connectors implement the provider) — if this is intentionally out of scope for now, a short known-gap note in the doc would help readers.
  • F6 (CdcProgressLifecycle.SNAPSHOT Javadoc vs. the ownership rule in the doc) — with COMPLETED added to the lifecycle, does the SNAPSHOT Javadoc now match?
  • F1 (unbounded activeSplits vs. the documented bounded contract) and F8 (shallow copy / element immutability of CdcSnapshotSplitProgress) — are these addressed in the API-only PR, or should I expect them in this engine slice?
  • F3 (encode the new enums by name, not ordinal, in the engine codec) — this stays with the engine slice here; a pointer to the codec change, or a note that it is deferred, is all I need.

With those pointers I'll re-check against the current diffs of both PRs.

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the Apache SeaTunnel contribution and for splitting the API, connector and engine work. I re-read all 42 changed files at 738c0acc46ea28db0da2466b4966ce33541b5695, traced the deployment/restore/cleanup paths, and incorporated @nzw921rx's split request and @SEZ9's F1-F8 questions. Sorry for missing the integration/documentation gaps in my earlier source-clear conclusion; these are carryover gaps, not newly introduced functional defects. The CI fact cited previously has also changed: this head fails Maven-wrapper bootstrap in the Amazon SQS Java 11 lane, rather than the old SFTP-image check.

What Problem Does This PR Solve?

User pain point: connector-specific CDC progress cannot be collected consistently across distributed readers and enumerators.

Fix approach: add experimental API reports, task adapters, bounded asynchronous reader push/enumerator pull, an explicit wire codec and a coordinator-local latest-report store.

One-sentence summary: Zeta can retain a connector's latest progress sample without turning that sample into checkpoint state. For example, sequence 2 from execution 101 supersedes sequence 50 from execution 100 even if their wall clocks disagree.

1. Code Change Review

1.1 Core Logic Analysis

Core methods are TaskExecutionService.reportReaderCdcProgress/collectEnumeratorCdcProgress, CoordinatorService.collectCdcEnumeratorProgress, CdcProgressService.updateReports and JobMaster's scope registration/cleanup.

// Before: metrics reporting only
updateMetricsContextInImap();
// After: after the existing metrics RPC, collect CDC reports asynchronously
reportCdcProgressAsync(inFlight, collectAndSend, onFailure);
// Latest-only acceptance, not wall-clock ordering
candidate.getExecutionAttemptId() > current.getExecutionAttemptId()
    || (candidate.getExecutionAttemptId() == current.getExecutionAttemptId()
        && candidate.getReportSequence() > current.getReportSequence());
// New wire payload uses names
out.writeString(envelope.getOwner().name());
out.writeString(accuracy.name());
submission / coordinator activation
 -> capture CdcProgressService.Generation and reserve Owner before async initialization
 -> JobMaster.init -> SubPlan.initStateFuture -> register pipeline scope
 -> PhysicalVertex.getTaskGroupImmutableInformation:346 allocates execution ID
 -> deployLocalTask -> TaskGroupContext holds execution identity
 -> SourceSeaTunnelTask.init publishes initialized SourceFlowLifeCycle
 -> SourceReader implementing CdcProgressProvider supplies immutable reader report
 -> existing metrics tick -> reportReaderCdcProgress -> one outstanding RPC per worker
 -> ReportCdcProgressOperation -> explicit codec -> CdcProgressService.updateReports
 -> key(owner, job, pipeline, source vertex, reader index), ordered by attempt then sequence

coordinator print-execution-info tick
 -> inspect physical coordinator vertices for SupportCdcProgress
 -> derive hosting members from owned slots, batch task groups by worker
 -> CollectCdcEnumeratorProgressOperation checks active-master caller
 -> initialized/opened enumerator provider -> response batch
 -> callback checks in-flight token, coordinator epoch and captured generation
 -> latest-only coordinator store

failure / restore / terminal pipeline / savepoint
 -> failed initialization closes only its owner's scopes
 -> SubPlan.subPlanDone closes observations before metrics-history cleanup
 -> coordinator clear closes generation and clears in-flight tokens
 -> replacement JobMaster registers a newer owner; old cleanup cannot remove it
 -> restored/deployed tasks publish new samples; observations are not recovery state

Key findings:

  • Normal task execution reaches the adapters, but this slice adds no production connector provider. Actual reports require the separate connector work; non-CDC source plans skip distributed slot lookup.
  • Reader provider publication is after reader creation; enumerator publication is after open succeeds. Uninitialized tasks return no report, and one failing provider does not discard healthy reports.
  • Collection RPCs are asynchronous with at most one outstanding request per worker; the existing metrics RPC still precedes reader collection and can delay its cadence. No extra checkpoint lock is acquired.
  • Pipeline ownership/generation guards protect cleanup and asynchronous enumerator callbacks. Attempt ordering compares received observations; it is not proof of a globally authoritative committed offset, and an empty newly opened store has no prior sample to compare.
  • No REST/CLI/metric consumer is exposed. This is a long-term observation foundation, not a complete CDC-monitoring feature.

For @SEZ9's mapping: F1/F7/F8 are implemented by the API model's 100-entry cap/truncation, exact-count validation and final immutable element/map types; F2 is docs/en/developer/cdc-progress.md:54; F6 is the reader-only lifecycle Javadoc. F3 is CdcProgressReportSerializer:51/218 with literal-name writer fixtures in ReportCdcProgressOperationSerializationTest:163/198. F4 is now correctly documented as plan/slot-derived pull at docs:116, matching CoordinatorService:2256, rather than a worker registration scheme. +1 to F5: docs:135 still needs the explicit known-gap statement that this engine slice alone enables no production connector, with #13240 linked as separate work. This existing point is not duplicated as a numbered issue.

@nzw921rx's CHANGES_REQUESTED review requested API-first evaluation. #13239 and #13240 now provide the proposed split, but that maintainer must confirm the API and sequencing before this engine draft is ready; I am not treating the split itself as an approval.

Review baseline: current head 738c0acc46ea28db0da2466b4966ce33541b5695 against its merge base with dev. The complete local diff was reconciled with GitHub's file list; git diff --check passed. No local build, tests or PR execution were performed.

1.2 Compatibility Impact

Fully compatible with existing job configurations and persisted checkpoint/savepoint formats at source level. Existing serializer IDs remain unchanged and new operation IDs are appended; old constructor entry points remain. This introduces an experimental transport contract, so it does not establish mixed-version rolling-upgrade support. Unknown operation/enum handling fails observational requests, not source data processing. There is no new persisted offset or migration requirement in this diff.

1.3 Performance / Side-Effect Analysis

Collection scans active tasks/plans, copies report lists and serializes bounded entries; active split details are capped at 100 and position fields at 1,024. One request per worker avoids unbounded queues. These are entry-count bounds, not a total byte-size budget for arbitrary position strings. The synchronized latest-only store serializes updates/reads; no performance benchmark was run. Retrying occurs on later monitor ticks, and duplicate/out-of-order reports are idempotently ignored relative to stored samples. Cleanup releases observations on terminal scopes and coordinator loss. No source/database network I/O is added by engine observation, assuming providers honor the non-blocking API.

1.4 Error Handling and Logging

Issue 1: Add real distributed engine integration coverage in this change

  • Location: seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/CoordinatorService.java:2256, seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/task/operation/ReportCdcProgressOperation.java:45, and seatunnel-engine/seatunnel-engine-server/src/test/java/org/apache/seatunnel/engine/server/TaskExecutionServiceTest.java:258.
  • Problem description: the unit coverage is substantial, including a real local task group and local operation dispatch, but the enumerator integration fixture is a synthetic task and most generation/failure cases directly invoke service methods. No existing seatunnel-e2e test is updated to run the complete distributed reader-push/enumerator-pull path through master failover and restore. The discussion defers this to #12137, which does not provide coverage in this change.
  • Potential risk: placement, serialization/classloading and recovered ownership interactions can pass isolated tests while the distributed observation path does not work.
  • Best improvement: extend the existing engine integration suite with a deterministic progress-provider test source, place the enumerator remotely, verify reader/enumerator observations, fail over the coordinator, and verify terminal/savepoint cleanup plus rejected late reports. Assert real data/checkpoint results separately from progress. This can remain engine-only and need not pull connector implementations into this PR.
  • Severity: Medium; integration coverage blocker.
  • Raised by another reviewer: No; this is an explicit review requirement, not a claim that #12137 has already run.

Issue 2: Document new lifecycle internals and add the required document headers

  • Location: seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/master/JobMaster.java:160, :1362, seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/task/SourceSeaTunnelTask.java:66, seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/task/SourceSplitEnumeratorTask.java:106, seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/task/flow/SourceFlowLifeCycle.java:142, and docs/en/developer/cdc-progress.md:1 / docs/zh/developer/cdc-progress.md:1.
  • Problem description: nontrivial generation/owner/closed fields and transient provider/sequence publication fields lack comments explaining lifecycle ownership and synchronization. New registration/reader-provider methods lack their boundary guarantees. Both new Markdown files start without the required ASF license comment.
  • Potential risk: later maintenance can publish providers before initialization or confuse task attempts with coordinator ownership; new documents miss project licensing requirements.
  • Best improvement: add concise field/method documentation for initialization, publication, concurrency and cleanup constraints, plus standard Markdown ASF headers. Boilerplate getters do not need extra prose.
  • Severity: Medium.
  • Raised by another reviewer: No; F5's connector-coverage wording remains separately acknowledged above.

Provider failures are isolated without logging native offset contents. Codec enum errors omit untrusted values. Diagnostic warnings often contain only exception class; this avoids leaking connector payloads, although task identity would improve troubleshooting. No source exception is swallowed by the added engine collection path.

2. Code Quality Assessment

2.1 Coding Standards

The immutable API, explicit codec, existing serializer ID preservation and owner-aware cleanup are clear. Issue 2 covers mandatory new-core-method/field documentation. git diff --check passed; all 42 changed files matched the API file inventory. No PR code, build or test was executed locally, as required for this batch.

2.2 Test Coverage and Test Stability

Stability rating: Stable. CdcReaderProgressReportingTest:109/145 uses latches and explicitly completed futures, shutting down/awaiting executors in finally. CoordinatorServiceTest:1243 coordinates the stale callback with latches rather than sleeping; TaskExecutionServiceTest:298 waits for task completion before checking removal. SourceSplitEnumeratorTaskTest:69 checks provider publication through deterministic Mockito callbacks and closes tasks in finally. Serialization fixtures use literal enum names and dispose the serializer in @AfterEach. The remaining gap is distributed coverage in Issue 1, not a high-risk flaky pattern in the new assertions.

Current Apache Build fails because the Amazon SQS Java 11 job receives repeated HTTP 404 downloading maven-wrapper-3.1.0.jar and then cannot load MavenWrapperMain. This happens before connector tests. I inspected latest dev dcf97867ac13: it still uses the same wrapper URL; #12468 already adds retries, and this job exhausts them. A simple sync is not a demonstrated fix for this failure. Please retry that job when Maven Central access is healthy; if the same 404 persists, retain the response evidence for the shared CI/bootstrap issue rather than adding unrelated CDC dependencies. My previous SFTP-only diagnosis no longer describes this head.

2.3 Documentation Updates

EN/ZH guides describe the runtime and experimental ownership contract consistently. Address @SEZ9 F5 by naming the absence of production providers in this slice and linking the connector follow-up. Align the common API documents with the eventual #13239/#13240 contract; this review does not assert the connector implementation meets every startup-mode promise. Add ASF headers (Issue 2).

3. Architectural Soundness

3.1 Elegance of the Solution

Long-term solution: separated connector facts, engine identity and observational transport.

3.2 Maintainability

Explicit ownership and named enum fixtures improve maintenance. Complete the lifecycle comments and distributed evidence before merging.

3.3 Extensibility

The provider/marker pattern permits further connectors without embedding connector-specific offsets in Zeta. Aggregation/history remain intentionally outside this slice.

3.4 Historical-Version Compatibility

Historical jobs/checkpoints are unchanged by new observation fields. No rolling-upgrade, recovery or production acceptance was executed; new operation support requires compatible members.

4. Issue Summary

Number Issue Location Severity
1 Distributed collection/failover integration missing CoordinatorService:2256; TaskExecutionServiceTest:258 Medium
2 Core lifecycle documentation and ASF headers missing JobMaster:160/1362; cdc-progress.md:1 Medium

5. Merge Recommendation

Conclusion: Ready to merge after fixes

  1. Blockers — must be fixed
  • Issue 1: cover distributed collection and ownership restoration in the existing integration suite.
  • Issue 2: complete required lifecycle documentation and new-file headers.
  • Existing @SEZ9 F5: make current connector coverage/known gaps explicit.
  • Resolve @nzw921rx's API-first merge sequencing and CHANGES_REQUESTED review; the PR remains a draft.
  • Rerun the failed Maven-bootstrap lane after repository access recovers. Sync alone has no verified fix for this head's failure.
  1. Recommended fixes — non-blocking
  • Consider a byte-size budget if future position families carry large strings; entry limits alone are not a byte quota.

Overall: no additional confirmed source data-processing defect was found in this engine slice. Option A adds a deterministic engine-only integration fixture now; Option B coordinates a dependent integration PR and keeps this draft unmerged until that coverage is included. Daniel's COMMENTED technical review does not clear another maintainer's requested-changes record or establish writer approval.

The current comparison is diverged against dev: ahead 2, behind 9; merge state blocked. This is recorded independently; being behind alone is not a request to sync. Daniel has READ permission. This technical review does not dismiss another reviewer's record or replace effective approval by a write-capable maintainer.

@goutamadwant

Copy link
Copy Markdown
Collaborator Author

@SEZ9 pointers for F1–F8, against where things stand now. The API is being reworked on #13239 into a Source-level contract (SourceReaderMetrics / SourceEnumeratorMetrics, proposal in that PR), so some of these resolve by removal rather than by a fix.

  • F1 (unbounded activeSplits) and F8 (shallow copy of CdcSnapshotSplitProgress): the per-split detail list is removed from the contract. The enumerator report carries counts only; there is no CdcSnapshotSplitProgress type to bound or copy. Lands in [Feature][API] Add experimental CDC progress contract #13239 with the rework; [Feature][CDC] Report reader and enumerator progress from connector-cdc-base #13240 and this PR drop the serializer block and the assigner detail code.
  • F2 (no credentials in position payloads): in the API doc on [Feature][API] Add experimental CDC progress contract #13239, under "Positions": payloads carry offset coordinates only, never credentials, connection URLs or authentication material. Stays in the reworked doc.
  • F3 (enums by name in the codec): already in this PR's head 738c0acc46: CdcProgressReportSerializer writes owner, lifecycle, assignment status and accuracy by name() and rejects unknown names. The rework keeps that and adds phases as strings.
  • F4 (runtime collection docs, pull/derive vs the enumerator path): the "Runtime collection in Zeta" section this PR adds to docs/*/developer/cdc-progress.md covers the worker pull for readers and the coordinator-owned enumerator path. It will be updated for the new names.
  • F5 (which connectors implement it): intentionally only connector-cdc-base and the connectors built on it (MySQL declares MYSQL_BINLOG; the others use their plugin name as position family). I will add that as a known-gap line in the API doc.
  • F6 (SNAPSHOT Javadoc vs the ownership rule): the Javadoc currently says only "reading snapshot splits". With COMPLETED added it still does not state the ownership rule; it will say that the consumed position is UNAVAILABLE during SNAPSHOT and that the reader does not infer enumerator state. Fixed in the rework together with the phase rename.
  • F7: both CdcEnumeratorProgressReport constructors in the current head document the non-negative and assigned == completed + running (only when all EXACT) rules; the rework keeps one constructor with the same rule, with running renamed to inFlight.

Integration coverage for the distributed path will come with the rework of this PR rather than only in #12137.

@DanielLeens

Copy link
Copy Markdown
Contributor

Thanks for the point-by-point plan. The proposed Source-level contract and removal of per-split detail may close several design points once that code is pushed; I cannot mark them resolved in current head 738c0acc46. Please include the distributed collection/failover integration fixture in this PR's rework, keep position payloads free of credentials, and update the API/engine documentation together with #13239. My existing merge blockers remain until the revised commits are available for a complete rereview.

@SEZ9

SEZ9 commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

@goutamadwant thanks for the point-by-point mapping. You didn't ask a question, so here is where each of F1–F8 stands for me. I have not re-checked any of this against the code, so none of them are closed on head 738c0acc46 yet.

  • F1 / F8: Removing the per-split detail list, so the enumerator report carries counts only and there is no CdcSnapshotSplitProgress type, resolves both by removal. They stay open until the rework is pushed on [Feature][API] Add experimental CDC progress contract #13239, and until this PR and [Feature][CDC] Report reader and enumerator progress from connector-cdc-base #13240 drop the serializer block and the assigner detail code.
  • F2: The "Positions" wording (offset coordinates only, never credentials, connection URLs or authentication material) is what I was asking for. Please make sure it survives in the reworked doc.
  • F3: Writing owner, lifecycle, assignment status and accuracy by name() and rejecting unknown names in CdcProgressReportSerializer is the right fix. I'll confirm it on the re-review, including the phases-as-strings addition.
  • F4: This stays open until the "Runtime collection in Zeta" section in docs/*/developer/cdc-progress.md is updated for the new names. It should still cover both the worker pull for readers and the coordinator-owned enumerator path.
  • F5: Limiting this to connector-cdc-base and the connectors built on it is fine. It stays open until the known-gap line is in the API doc.
  • F6: Agreed that it is not fixed yet. The SNAPSHOT Javadoc needs the wording you describe: the consumed position is UNAVAILABLE during SNAPSHOT, and the reader does not infer enumerator state.
  • F7: One thing I need from you here. You say the constructors document the non-negative and assigned == completed + running (only when all EXACT) rules. Are those rules enforced in the constructor, or only described in Javadoc? The finding was about missing validation, so please confirm how the single reworked constructor (with inFlight) handles invalid values.

Remaining asks: push the rework, answer the F7 question, and add the F5 and F6 doc changes. Then ping me and I'll re-review F1–F8 against the revised commits.

@DanielLeens

Copy link
Copy Markdown
Contributor

Thanks, @SEZ9. I agree that removing per-split details requires a matching update across this PR, #13239 and #13240, including the serialized model and consumers. Offsets must not expose credentials; unknown enum names need an explicit rejection contract; unavailable snapshot-consumption progress must remain unavailable rather than looking complete. Connector scope and collection cost should match the runtime, and constructor validation of invalid counts needs an actual regression, not only documentation.

These are the outstanding coordinated contract/validation requests already under discussion. No new commit is present, so I have not confirmed a fix or cleared the source blockers.

Checked unchanged head 738c0acc46ea28db0da2466b4966ce33541b5695 against dev: compare diverged, ahead 2 / behind 54. This drift is recorded independently; it does not by itself request synchronization. This is a discussion/CI follow-up, not another full source review. No local build, test or runtime execution was performed. Daniel has READ repository permission; effective maintainer approval/dismissal remains a separate repository gate. Checked 2026-11-20T11:59:57.811808+00:00.

@SEZ9

SEZ9 commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the point-by-point plan. No new commit has landed since 738c0acc46, so none of the earlier points can be confirmed as fixed yet and they all stay open.

API contract

  • Active-split list and immutability: Removing per-split details as proposed would close both the unbounded activeSplits concern and the shallow-copy immutability concern. That removal has to land consistently with [Feature][API] Add experimental CDC progress contract #13239 and [Feature][CDC] Report reader and enumerator progress from connector-cdc-base #13240, including the serialized model and its consumers. If any per-split list survives, it needs an enforced bound and truly immutable elements.
  • Count fields: Please reject negative and mutually inconsistent counts in the constructor, and add a regression test for it. Documentation alone is not enough here.
  • Enums on the wire: The engine codec should encode the enums by name, not ordinal. Please also define an explicit rejection contract for unknown enum names.

Docs and Javadoc

  • Secrets in position payloads: The payload contract should state explicitly that connector-native position payloads must not carry credentials or connection secrets.
  • Runtime collection: Please rewrite this section to describe the registration-based enumerator report path the PR actually implements, rather than a pull/derive model.
  • Connector scope: Please state which connectors currently implement the progress provider.
  • CdcProgressLifecycle.SNAPSHOT: The Javadoc should match the ownership rule in the new doc, so enumerator-owned discovery and assignment are not listed under it.

Once the revised commits are pushed, please add a short note mapping each item above to the change that addresses it, and I'll do a full re-review.

@DanielLeens

Copy link
Copy Markdown
Contributor

Thanks, @SEZ9. I agree with the existing boundary: keep the progress DTO bounded and deeply safe, consistently validate non-negative counts at construction, deserialize enum names with explicit unknown-name rejection, exclude secrets/source positions from exposed progress, and distinguish unavailable progress from completed work. The SPI documentation and cost limits belong in the same scoped update. The split-list exposure should follow the removal already discussed in #13239/#13240. There is no new head yet, so I cannot mark those items fixed; happy to re-review once the coordinated change is pushed.

Checked unchanged head 738c0acc46ea28db0da2466b4966ce33541b5695 against dev: compare diverged, ahead 2 / behind 57. This drift is recorded independently; it does not by itself request synchronization. This is a discussion/CI follow-up, not another full source review. No local build, test or runtime execution was performed. Daniel has READ repository permission; effective maintainer approval/dismissal remains a separate repository gate. Checked 2026-11-21T12:06:29.365986+00:00.

@SEZ9

SEZ9 commented Nov 22, 2026

Copy link
Copy Markdown
Collaborator

Following up on the earlier review points: the head is still 738c0acc46 with no new commit, so none of the points can be marked resolved yet. The direction discussed in this thread looks right, and these are the concrete asks that remain for the rework.

  • Unbounded activeSplits (F1) and shallow-copy immutability (F8): If the per-split details are removed as discussed, both points go away. That removal needs to land consistently with [Feature][API] Add experimental CDC progress contract #13239 and [Feature][CDC] Report reader and enumerator progress from connector-cdc-base #13240, including the serialized model and its consumers. If any per-split detail stays, please enforce an explicit bound and make the elements genuinely immutable rather than relying on a shallow copy.
  • Secrets in position payloads (F2): Please state in docs/en/developer/cdc-progress.md that connector-native position payloads must not carry credentials or connection secrets, since they are shipped to and stored on the coordinator.
  • Enum encoding (F3): The engine codec should encode the new enums by name, not ordinal, with an explicit rejection contract for unknown names.
  • Runtime collection docs (F4): Please align the description with the registration-based enumerator report path this PR actually implements, rather than the pull/derive model.
  • Connector scope (F5): Please state which connectors currently implement the progress provider.
  • CdcProgressLifecycle.SNAPSHOT Javadoc (F6): Please reconcile it with the ownership rule in the new doc regarding enumerator-owned discovery/assignment.
  • Count validation (F7): Please reject negative and mutually inconsistent counts at construction, and cover this with a regression test rather than documentation alone.

Could you confirm whether per-split details will be removed entirely or kept in bounded form? That decides how F1 and F8 get closed. Once the revised commits are pushed, I'm happy to go through these points again.

@DanielLeens

Copy link
Copy Markdown
Contributor

Thanks @SEZ9 for keeping the remaining contract questions together. The head is unchanged, so removal of per-split details is still a proposed direction rather than a completed fix. The next revision needs to settle that shape consistently across the serialized progress model, coordinator collection, and #13239/#13240 consumers; counts must remain validated and any retained detail must have an explicit bound and immutable contents. The enum encoding, connector scope, secret-free native-position contract and runtime documentation also remain part of the existing review. I am not marking those points resolved on discussion alone; the updated source and tests need to land together.

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

Labels

api document impact: high Engine, API, platform, CI, or a public core class / option contract of a connector Zeta

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants