feat(connectors): add MongoDB sink connector#2815
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 70.25% 70.36% +0.11%
Complexity 763 763
============================================
Files 1040 1041 +1
Lines 85888 86443 +555
Branches 62164 62728 +564
============================================
+ Hits 60338 60827 +489
- Misses 23035 23081 +46
- Partials 2515 2535 +20
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 |
|
Following up here for continuity:
Referencing both here in case anyone revisits this thread later. |
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