feat(connectors): add MongoDB sink connector#2815
feat(connectors): add MongoDB sink connector#2815amuldotexe wants to merge 7 commits intoapache:masterfrom
Conversation
|
Docker proof of working (sink-only demo artifact, outside PR code scope):
Quick pull: docker pull ghcr.io/amuldotexe/iggy-mongodb-sink-demo:issue-2739-05fbec16 |
05fbec1 to
e2cf5fe
Compare
krishvishal
left a comment
There was a problem hiding this comment.
@amuldotexe I've added few comments.
It seems that inserts in mongodb can be fail after partial writes. Check if other places where insert is used are effected by this and handle them accordingly.
|
Thanks @krishvishal for the detailed feedback I will work on this and get back with an updated PR |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2815 +/- ##
============================================
+ Coverage 68.57% 68.70% +0.13%
Complexity 739 739
============================================
Files 1037 1038 +1
Lines 85610 86165 +555
Branches 62145 62709 +564
============================================
+ Hits 58708 59203 +495
- Misses 24499 24540 +41
- Partials 2403 2422 +19
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Adding to @krishvishal points which already cover a lot of ground. Two more things I think are blockers here. First, there's a liveness issue with how partial failures interact with offset commits. When any batch inside Second, |
|
Addressed the review feedback in What changed:
Validation run on this head:
Current PR head: @krishvishal @atharvalade please take another look when convenient. |
|
@amuldotexe looks good, but please fix the CI. after that we can merge. |
|
@hubcio fixed CI; was an unused import |
Which issue does this PR close?
Partially addresses #2739 (MongoDB sink only).
MongoDB source support will follow in a separate PR.
Rationale
We need a MongoDB sink connector with explicit failure behavior so writes are never reported as successful when they are not.
What changed?
Before this change, MongoDB sink support was missing for connector runtime users.
This PR adds the MongoDB sink connector, including insert/write logic, retry handling for transient failures, explicit duplicate-key failure behavior, metadata mapping, and delivery-semantics documentation.
It also adds sink-focused integration and unit tests to validate payload formats, batch behavior, auto-create collection behavior, and non-silent failure paths.
Local Execution
Passed:
cargo fmt --all -- --checkPassed:
cargo clippy -p iggy_connector_mongodb_sink --all-targets -- -D warningsPassed:
cargo test -p iggy_connector_mongodb_sink(13 passed)Passed:
cargo test -p integration --test mod -- mongodb_sink(10 passed)Pre-commit hooks ran
Docker E2E proof image:
ghcr.io/amuldotexe/iggy-mongodb-sink-demo:issue-2739-05fbec16Docker smoke result:
SMOKE_OK ... docs=3GHCR package: https://github.com/users/amuldotexe/packages/container/package/iggy-mongodb-sink-demo
Key sink tests:
duplicate_key_is_explicit_failure_and_not_silent_successordered_duplicate_partial_insert_has_exact_accountingschema_validation_mid_batch_surfaces_hard_error_and_partial_prefixwrite_concern_timeout_does_not_report_full_successretryable_write_failover_keeps_single_doc_per_idno_writes_performed_label_path_preserves_state_accuracyjson_messages_sink_to_mongodbbinary_messages_sink_as_bson_binarylarge_batch_processed_correctlyauto_create_collection_on_opengiven_no_client_should_return_error_not_silent_okAI Usage
Codex, Claude Code, Rust Rover
PRD, connector precedent analysis, TDD, implementation, and PR prep
Ran all local format, clippy, unit, and integration checks listed above
Yes