Apache Software Foundation / SeaTunnel
Merged upstreamFeatureMerged Sep 10, 2026

Add bounded timestamp mode to MongoDB CDC

Exposed MongoDB CDC's existing timestamp stop capability through public configuration and added bounded completion plus savepoint-restore coverage.

apache/seatunnel · #11815

Change-data-capture feature

SeaTunnel MongoDB CDC jobs can now consume a bounded timestamp interval, drain records before the boundary, and finish cleanly.

Problem

MongoDB CDC already had timestamp ordering and a bounded stream-fetch path, but public configuration allowed only `stop.mode = never`. Users could not define a finite change-stream interval or have a job finish after consuming changes up to a timestamp boundary.

Approach

Adds `stop.mode = timestamp`, requires `stop.timestamp`, rejects same-second and reversed boundaries, and preserves `never` as the default. Initial snapshots still complete before the incremental boundary applies, and restore state takes precedence consistently.

Impact and scope

  • Enables finite MongoDB change-stream backfills and migration windows that terminate without external cancellation.
  • Preserves records before the stop boundary across savepoint restoration while excluding later changes.
  • Makes MongoDB's second-level timestamp precision and empty already-passed intervals explicit in configuration semantics.

Validation

  • Added unit coverage for supported modes, timestamp conversion, valid and invalid ranges, and unsupported stop modes; all 32 connector tests passed on JDK 11.
  • The Zeta E2E scenario derives boundaries from MongoDB cluster time, saves and restores the bounded job, verifies a post-savepoint record, excludes a post-boundary record, and reaches `FINISHED`.
  • A SeaTunnel maintainer approved the feature; final checks passed and the GitHub-verified merge commit credits Goutam Adwant. GH-11739 remains open as the broader cross-connector audit.