Skip to content

feat(connectors): add Meilisearch sink connector#3497

Open
countradooku wants to merge 11 commits into
apache:masterfrom
countradooku:feat/meilisearch-sink-connector
Open

feat(connectors): add Meilisearch sink connector#3497
countradooku wants to merge 11 commits into
apache:masterfrom
countradooku:feat/meilisearch-sink-connector

Conversation

@countradooku

Copy link
Copy Markdown
Contributor

Summary

  • add the Meilisearch sink connector using the official meilisearch-sdk
  • document the sink configuration and payload mapping behavior
  • add Docker-backed integration coverage for indexing JSON messages into Meilisearch

Motivation

This splits the sink portion out of #3404 so the Meilisearch sink can be reviewed and merged independently from the source connector.

Closes #3495.

Validation

  • cargo sort --no-format --workspace
  • cargo test -p iggy_connector_meilisearch_sink
  • cargo clippy -p iggy_connector_meilisearch_sink --all-targets -- -D warnings
  • env CARGO_BIN_EXE_iggy-server=... CARGO_BIN_EXE_iggy-connectors=... cargo test -p integration --test mod -- connectors::meilisearch::meilisearch_sink
  • git diff --check

@countradooku countradooku marked this pull request as ready for review June 15, 2026 18:58
@github-actions github-actions Bot added the S-waiting-on-review PR is waiting on a reviewer label Jun 15, 2026
@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 72.79793% with 210 lines in your changes missing coverage. Please review.
✅ Project coverage is 39.58%. Comparing base (18bcfb4) to head (ae744d1).
⚠️ Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
core/connectors/sinks/meilisearch_sink/src/lib.rs 72.79% 193 Missing and 17 partials ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             master    #3497       +/-   ##
=============================================
- Coverage     74.41%   39.58%   -34.83%     
  Complexity      937      937               
=============================================
  Files          1243     1178       -65     
  Lines        125698   105778    -19920     
  Branches     101616    86290    -15326     
=============================================
- Hits          93541    41876    -51665     
- Misses        29141    61468    +32327     
+ Partials       3016     2434      -582     
Components Coverage Δ
Rust Core 37.93% <72.79%> (-37.22%) ⬇️
Java SDK 62.44% <ø> (ø)
C# SDK 27.36% <ø> (-44.75%) ⬇️
Python SDK 88.88% <ø> (ø)
PHP SDK 84.29% <ø> (ø)
Node SDK 87.27% <ø> (-3.86%) ⬇️
Go SDK 15.66% <ø> (-24.70%) ⬇️
Files with missing lines Coverage Δ
core/connectors/sinks/meilisearch_sink/src/lib.rs 72.79% <72.79%> (ø)

... and 553 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread Cargo.toml
Comment thread Cargo.toml
Comment thread core/connectors/sinks/meilisearch_sink/src/lib.rs
Comment thread core/connectors/sinks/meilisearch_sink/src/lib.rs
Comment thread core/connectors/sinks/meilisearch_sink/src/lib.rs
Comment thread core/connectors/sinks/meilisearch_sink/src/lib.rs
Comment thread core/connectors/sinks/meilisearch_sink/src/lib.rs Outdated
Comment thread core/connectors/sinks/meilisearch_sink/src/lib.rs Outdated
Comment thread core/connectors/sinks/meilisearch_sink/src/lib.rs Outdated
Comment thread core/connectors/sinks/meilisearch_sink/src/lib.rs Outdated
@ryerraguntla

ryerraguntla commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

overall correct approach - JSON-object document model with generated PK is sound, wait_for_tasks + partial-error accounting is thoughtful. test coverage is present but there is
coverage gap — only happy-path (2 JSON messages indexed, iggy_id present). No test for: document_action = update semantics, include_metadata = false, raw-payload base64 fallback, or wait_for_tasks = false fire-and-forget path. Not a merge-blocker given this is the initial connector, but tracking it. Along with coverage, please take care of the above mentioned issues.

@ryerraguntla

Copy link
Copy Markdown
Contributor

/author

@github-actions github-actions Bot added S-waiting-on-author PR is waiting on author response and removed S-waiting-on-review PR is waiting on a reviewer labels Jun 16, 2026
@countradooku

Copy link
Copy Markdown
Contributor Author

/ready

@github-actions github-actions Bot added S-waiting-on-review PR is waiting on a reviewer and removed S-waiting-on-author PR is waiting on author response labels Jun 16, 2026
Comment thread core/connectors/sinks/meilisearch_sink/src/lib.rs
Comment thread core/connectors/sinks/meilisearch_sink/src/lib.rs Outdated
Comment thread core/connectors/sinks/meilisearch_sink/src/lib.rs
Comment thread core/connectors/sinks/meilisearch_sink/src/lib.rs
Comment thread core/connectors/sinks/meilisearch_sink/src/lib.rs
Comment thread core/connectors/sinks/meilisearch_sink/src/lib.rs
@github-actions github-actions Bot added the S-waiting-on-review PR is waiting on a reviewer label Jun 19, 2026
Comment thread core/connectors/sinks/meilisearch_sink/src/lib.rs
Comment thread core/connectors/sinks/meilisearch_sink/src/lib.rs
Comment thread core/connectors/sinks/meilisearch_sink/src/lib.rs
Comment thread core/connectors/sinks/meilisearch_sink/src/lib.rs
Comment thread core/connectors/sinks/meilisearch_sink/src/lib.rs
@ryerraguntla

Copy link
Copy Markdown
Contributor

/author

@github-actions github-actions Bot added S-waiting-on-author PR is waiting on author response and removed S-waiting-on-review PR is waiting on a reviewer labels Jun 21, 2026
@countradooku

Copy link
Copy Markdown
Contributor Author

/ready

@github-actions github-actions Bot added S-waiting-on-review PR is waiting on a reviewer and removed S-waiting-on-author PR is waiting on author response labels Jun 21, 2026
Comment thread core/connectors/sinks/meilisearch_sink/src/lib.rs Outdated
Comment thread core/connectors/sinks/meilisearch_sink/src/lib.rs
Comment thread core/connectors/sinks/meilisearch_sink/src/lib.rs
Comment thread core/connectors/sinks/meilisearch_sink/src/lib.rs
Comment thread core/connectors/sinks/meilisearch_sink/src/lib.rs
}
}

async fn index_documents(

@ryerraguntla ryerraguntla Jun 23, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

batch partial failure with document_action=update: when chunk N fails, chunks 0..N-1 are already indexed; runtime retries entire batch; update action applies partial updates a second time to already-succeeded chunks. replace action is idempotent; update is not. No warn at open() when document_action=update. Fix: add warn! at open() when action is Update, documenting at-least-once + non-idempotent.


#[async_trait]
impl Sink for MeilisearchSink {
async fn open(&mut self) -> Result<(), Error> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

open() has no warn when wait_for_tasks=false. close() now warns, but operators see that too late. Fix: add warn! early in open() when !self.config.wait_for_tasks.

}
}

async fn ensure_index_exists(&self, client: &Client) -> Result<(), Error> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ensure_index_exists on Some(_) only logs "already exists"; does not validate existing index's actual primary key against self.config.primary_key. A misconfigured primary_key on an existing index fails silently at first consume() with a permanent Meilisearch error, not at open(). Fix: read index.primary_key from the returned Index and warn! (or Err) on mismatch.

config.task_poll_interval.as_deref(),
DEFAULT_TASK_POLL_INTERVAL,
);
let max_retries = config.max_retries.unwrap_or(DEFAULT_MAX_RETRIES);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

retry_delay > max_retry_delay not guarded. exponential_backoff clamps to max, so behavior is technically correct, but operator who sets retry_delay="10s", max_retry_delay="1s" gets silent misconfiguration. Fix: swap + warn! (cf. http_sink pattern).

async move {
let mut last_count = 0usize;
for _ in 0..POLL_ATTEMPTS {
if let Ok(documents) = self.list_documents(TEST_INDEX).await {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait_for_documents hardcodes TEST_INDEX instead of forwarding the index_name param to list_documents.

@ryerraguntla

Copy link
Copy Markdown
Contributor

@countradooku Looks good except for the few warnings around back indexing and open calls. After the above requested changes, good to go for second reviewer.

@ryerraguntla

Copy link
Copy Markdown
Contributor

/author

@github-actions github-actions Bot added S-waiting-on-author PR is waiting on author response and removed S-waiting-on-review PR is waiting on a reviewer labels Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author PR is waiting on author response

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Meilisearch sink connector

3 participants