Apache Software Foundation / SeaTunnel
Merged upstreamCorrectnessMerged Aug 26, 2026

Preserve MongoDB CDC snapshot failure causes

Improved SeaTunnel MongoDB CDC diagnostics by retaining the underlying driver exception when snapshot task execution fails.

apache/seatunnel · #11880

Production diagnostics fix

MongoDB CDC snapshot failures now retain the original driver exception needed to identify topology, authentication, TLS, index, and bounds failures.

Problem

`MongodbScanFetchTask` converted every snapshot failure into a generic connector exception without its cause, leaving operators with only an `Illegal argument` message and no actionable signal about the real driver condition.

Approach

Added a cause-aware `MongodbConnectorException` constructor and propagated the original exception through the snapshot execution boundary without changing query, BSON bounds, hints, checkpoint, or successful-read behavior.

Impact and scope

  • Makes production snapshot failures diagnosable from the emitted exception chain instead of requiring reproduction or invasive logging.
  • Preserves driver-specific context for authentication, TLS, topology, index-hint, and snapshot-bound failures.
  • Improves observability without altering successful MongoDB CDC semantics or connector packaging.

Validation

  • Added snapshot-boundary regression coverage and ran all 28 MongoDB CDC connector unit tests.
  • Verified connector formatting and package-level build checks.
  • Received approvals from two maintainers; the authored merge commit is GitHub-verified.