Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions core/connectors/sinks/mongodb_sink/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,11 @@ This connector provides **at-least-once** delivery semantics.
### Behavior

- Messages may be delivered more than once on retry or restart
- Uses Iggy message ID as MongoDB `_id` for document identity
- **Insert-only mode**: duplicate key error is a hard failure (not upsert)
- Uses a deterministic composite MongoDB `_id`: `stream:topic:partition:message_id`
- Duplicate key collisions are treated as idempotent replay of already-written messages
- The sink remains insert-only; it does not upsert existing documents

### Known Limitations

- On network timeout during insert, retry may cause duplicate key error
- Sink does not upsert on duplicate (future improvement)
- On network timeout during insert, MongoDB may partially commit a batch before returning an error
- The sink does not upsert on duplicate; replay safety relies on deterministic `_id` values and duplicate-key tolerance
2 changes: 1 addition & 1 deletion core/integration/tests/connectors/mongodb/mongodb_sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ async fn large_batch_processed_correctly(harness: &TestHarness, fixture: MongoDb
server(connectors_runtime(config_path = "tests/connectors/mongodb/sink.toml")),
seed = seeds::connector_stream
)]
async fn duplicate_key_is_explicit_failure_and_not_silent_success(
async fn duplicate_key_is_idempotent_replay_not_sink_error(
harness: &TestHarness,
fixture: MongoDbSinkFixture,
) {
Expand Down
Loading