You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "moneycat957 (via GitHub)" <gi...@apache.org> on 2026/09/02 03:01:36 UTC
[PR] [Feature][Connector-V2] Add Amazon DocumentDB source connector [seatunnel]
moneycat957 opened a new pull request, #12046:
URL: https://github.com/apache/seatunnel/pull/12046
Part of #10443. Adds a source-only connector-amazondocumentdb.
DocumentDB is MongoDB wire-compatible but does not work with connector-mongodb out of the box: it rejects retryWrites, which the driver enables by default, and it requires TLS with the Amazon RDS CA bundle. This connector forces retryWrites=false, rejects an explicit retryWrites=true at configuration time, and builds its own SSLContext from a configured CA file rather than mutating the JVM-wide trust store.
V1 is source only, one database and collection per source, explicit schema, a single split, with optional BSON filter and projection. connector-mongodb is not modified or imported; the BSON to SeaTunnelRow conversion is implemented independently in this module.
<!--
Thank you for contributing to SeaTunnel! Please make sure that your code changes
are covered with tests. And in case of new features or big changes
remember to adjust the documentation.
Feel free to ping committers for the review!
## Contribution Checklist
- Make sure that the pull request corresponds to a [GITHUB issue](https://github.com/apache/seatunnel/issues).
- Name the pull request in the form "[Feature] [component] Title of the pull request", where *Feature* can be replaced by `Hotfix`, `Bug`, etc.
- Minor fixes should be named following this pattern: `[hotfix] [docs] Fix typo in README.md doc`.
-->
### Purpose of this pull request
<!-- Describe the purpose of this pull request. For example: This pull request adds checkstyle plugin.-->
### Does this PR introduce _any_ user-facing change?
<!--
Note that it means *any* user-facing change including all aspects such as the documentation fix.
If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
If possible, please also clarify if this is a user-facing change compared to the released SeaTunnel versions or within the unreleased branches such as dev.
If no, write 'No'.
If you are adding/modifying connector documents, please follow our new specifications: https://github.com/apache/seatunnel/issues/4544.
-->
### How was this patch tested?
<!--
If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
If tests were not added, please describe why they were not added and/or why it was difficult to add.
If you are adding E2E test cases, maybe refer to https://github.com/apache/seatunnel/blob/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-cdc-mysql-e2e/src/test/resources/mysqlcdc_to_mysql.conf, here is a good example.
-->
### Check list
* [ ] If any new Jar binary package adding in your PR, please add License Notice according
[New License Guide](https://github.com/apache/seatunnel/blob/dev/docs/en/developer/new-license.md)
* [ ] If necessary, please update the documentation to describe the new feature. https://github.com/apache/seatunnel/tree/dev/docs
* [ ] If necessary, please update `incompatible-changes.md` to describe the incompatibility caused by this PR.
* [ ] If you are contributing the connector code, please check that the following files are updated:
1. Update [plugin-mapping.properties](https://github.com/apache/seatunnel/blob/dev/plugin-mapping.properties) and add new connector information in it
2. Update the pom file of [seatunnel-dist](https://github.com/apache/seatunnel/blob/dev/seatunnel-dist/pom.xml)
3. Add ci label in [label-scope-conf](https://github.com/apache/seatunnel/blob/dev/.github/workflows/labeler/label-scope-conf.yml)
4. Add e2e testcase in [seatunnel-e2e](https://github.com/apache/seatunnel/tree/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/)
5. Update connector [plugin_config](https://github.com/apache/seatunnel/blob/dev/config/plugin_config)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Connector-V2] Add Amazon DocumentDB source connector [seatunnel]
Posted by "moneycat957 (via GitHub)" <gi...@apache.org>.
moneycat957 commented on PR #12046:
URL: https://github.com/apache/seatunnel/pull/12046#issuecomment-5506101975
Thanks for the exceptionally thorough review — the call-chain trace and the
`FactoryUtil`/`ConditionEvaluators` verification that `fetch.size > 0` is actually enforced
at runtime were more than I expected.
All addressed in 4725e22:
- **Issue 1** — `DocumentDBItemDeserializer.convert()` now chains the original exception as
the cause, so the underlying "Integer value is out of range" / "Infinite Decimal128"
messages survive. `conversionError` returns `SeaTunnelRuntimeException` so the cause can
be attached. Added `testPreservesNumericConversionFailureCause`.
- **Issue 2** — I took your suggestion rather than keeping the `connector-mongodb`
convention: `convertDecimal` now throws with the actual and configured precision instead
of silently returning `null`. Added `testRejectsDecimalPrecisionOverflow`, and the type
mapping section of both docs states the new behaviour.
- **Issue 4** — class-level Javadoc on all nine production classes, and the three pieces of
non-obvious "why" you named are now documented in code rather than only in the PR body:
the `applyConnectionString` → `retryWrites(false)` ordering and why the `SSLContext` is
connector-local (a JVM-global trust store change would affect unrelated connectors in the
same process), the single-split contract and the fact that checkpoint state carries no
cursor progress, and the two-section lock structure in `pollNext`.
- **E2E** — you were right and my reasoning in the PR description was wrong. I had gone from
"no DocumentDB emulator exists" to "no E2E is possible", but the wire-compatible path is
most of this connector and a plain `mongo` image does cover it. Took Option B and folded
`connector-amazondocumentdb-e2e` into this PR: three job configs (basic, filter,
projection) against a `mongo` Testcontainers image with `tls = false`, which also
exercises the TLS switch. `seatunnel-e2e/seatunnel-connector-v2-e2e/pom.xml` registers the
module and the checklist item is now ticked.
- **Single-split blast radius** — Tip #4 in both docs now spells out that a mid-scan failure
re-scans the whole collection from the start, and that downstream sinks therefore need to
be idempotent or truncate-and-reload.
Local verification: connector `clean install` and unit tests green (18/18), the e2e module
compiles, and `spotless:apply` produced no further changes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Connector-V2] Add Amazon DocumentDB source connector [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #12046:
URL: https://github.com/apache/seatunnel/pull/12046#issuecomment-5537828713
Quick follow-up on my own previous review: last round the only remaining item I flagged was procedural — get the apache-side `Build` check to reflect the fork's attempt 2, which was already green (21/21 `AmazonDocumentDBIT` on both JDK 8 and JDK 11), instead of the stale attempt-1 failure. I just rechecked the current head (`227480a377fbcb1e4171269bc10533fb19dd4311`) and the `Build`, `Notify test workflow`, and `labeler` checks are now all reporting `pass`, so that fact has changed since my last comment.
### Conclusion: Ready to merge
All five earlier review items (A–E) were already resolved and independently verified against the real engine source and CI logs in my previous pass, and there is no other code-side blocker outstanding from my side. Note that I don't have write-level review permissions on this repository, so this comment reflects my technical conclusion rather than GitHub's native review-approval state — a maintainer with write access will still need to perform the actual approval/merge action. Nice work getting this all the way to green, @moneycat957.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Connector-V2] Add Amazon DocumentDB source connector [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #12046:
URL: https://github.com/apache/seatunnel/pull/12046#issuecomment-5524218829
Thanks for confirming, @moneycat957 — and thanks for the extra detail on the two unrelated flakes (the Hazelcast `LoggingScheduledExecutor` shutdown race and the Maven Central resolution error, neither touching this connector). With `Build` now green on `227480a377` — including the previously-failing `AmazonDocumentDBIT` suite at 21/21 on both JDK 8 and JDK 11 — the one procedural item left in my last review is resolved. No blockers remain from my side; this is ready for a committer/maintainer with write access to take the formal merge action.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Connector-V2] Add Amazon DocumentDB source connector [seatunnel]
Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo commented on PR #12046:
URL: https://github.com/apache/seatunnel/pull/12046#issuecomment-5510734984
Good job.
Thanks a lot for your valuable contribution to Apache SeaTunnel!
To pass the automated CI checks for this PR, could you please enable CI workflows in your forked repository first? You can refer to the check run link below as a reference for the required CI configuration https://github.com/apache/seatunnel/pull/12046/checks?check_run_id=100167967305
If you run into any trouble enabling CI or encounter related errors during the process, feel free to leave a comment here. Contributors are always ready to offer help~
<img width="2412" height="1472" alt="image" src="https://github.com/user-attachments/assets/6abd2ea1-da45-4d78-a81c-0158f2d7a851" />
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Connector-V2] Add Amazon DocumentDB source connector [seatunnel]
Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo merged PR #12046:
URL: https://github.com/apache/seatunnel/pull/12046
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Connector-V2] Add Amazon DocumentDB source connector [seatunnel]
Posted by "moneycat957 (via GitHub)" <gi...@apache.org>.
moneycat957 commented on PR #12046:
URL: https://github.com/apache/seatunnel/pull/12046#issuecomment-5519992228
Fixed in 227480a3.
**Issue A + B — root cause and fix**
`assignSplits()` now signals no-more-splits only after enumeration has actually
completed, rather than treating "nothing pending for this reader right now" as "no work
will ever exist". `run()` clears `shouldEnumerate` before calling `assignSplits()`, so the
three orderings behave correctly:
- reader registers **before** `run()` (the Zeta ordering that broke this): it is assigned
the split and signaled only after enumeration, instead of being told there is no work;
- reader registers **after** `run()`: signaled immediately, so a late reader does not hang;
- `addSplitsBack()`: readers the enumerator context does not yet report as registered are
skipped rather than reassigned, so the coordinator no longer hits the
`ConcurrentHashMap.get(null)` NPE in `getTaskMemberAddressByIndex()` during restore. The
pending split stays queued and is assigned when that reader re-registers.
**Issue C — the test that should have caught this**
Three new cases in `AmazonDocumentDBSourceSplitEnumeratorTest`:
`testReaderRegisteredBeforeRunIsNotSignaledEarly` (asserts no signal is emitted between
`registerReader(0)` and `run()`, then that both the split and the signal arrive after
`run()`), `testReaderRegisteredAfterRunIsSignaledImmediately`, and
`testReturnedSplitWaitsForReaderRegistration`. Unit suite is 20/20 green.
**Issue D** — `registerReader()` and `assignSplits()` Javadoc now state the Zeta ordering
invariant explicitly. **Issue E** — unused `connector-fake` dependency dropped.
**On local e2e verification — I could not run it, and I would rather say so than imply I
did.** My Docker Desktop is 29.1.3 (Server API 1.52, minimum 1.44); Testcontainers 1.17.6
bundles a docker-java client that negotiates below 1.44, so the daemon rejects the
handshake with a 400 and an empty `Info` payload, and `DockerClientProviderStrategy`
reports "Could not find a valid Docker environment" after 0.4s — before any container
starts. `DOCKER_API_VERSION=1.44` does not help, since that client cannot speak 1.44.
Downgrading Docker to match a 2022 Testcontainers release was not something I wanted to do
to verify one fix.
So the engine-level proof has to come from CI here, as it did when CI found this bug. The
three new unit tests reproduce the exact `registerReader()`-before-`run()` sequence you
traced in `SourceSplitEnumeratorTask.stateProcess()` against a recording context, which is
strong evidence but not the same as a real Zeta run — please treat
`updated-modules-integration-test-part-1` as the deciding check rather than my word.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Connector-V2] Add Amazon DocumentDB source connector [seatunnel]
Posted by "moneycat957 (via GitHub)" <gi...@apache.org>.
moneycat957 commented on PR #12046:
URL: https://github.com/apache/seatunnel/pull/12046#issuecomment-5522487660
CI is green on the current head `227480a377` — `Build` passed on the fork's rerun, with
`updated-modules-integration-test-part-1` at 21/21 `AmazonDocumentDBIT` on both JDK 8 and
JDK 11. The single failure in the previous attempt was an unrelated Hazelcast
`LoggingScheduledExecutor` shutdown race in the whole-repo `unit-test (8, ubuntu-latest)`
job, which passed on rerun without any code change; it also failed for a different reason
(a Maven Central resolution error on `connector-google-bigtable`) in the run before that,
so that job appears generally flaky rather than related to this connector.
Thanks @DanielLeens for the three rounds of review and for going back to the engine source
and the raw CI logs yourself — the lifecycle-ordering bug was not something I would have
found without that first real Zeta run.
@davidzollo this should be ready for a committer look whenever you have a moment.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org