Skip to content

fix(iterator): fallback to iterator consistency level if not provided in options#106

Open
marlon-costa-dc wants to merge 1 commit into
milvus-io:mainfrom
marlon-costa-dc:fix/iterator-consistency-fallback
Open

fix(iterator): fallback to iterator consistency level if not provided in options#106
marlon-costa-dc wants to merge 1 commit into
milvus-io:mainfrom
marlon-costa-dc:fix/iterator-consistency-fallback

Conversation

@marlon-costa-dc
Copy link
Copy Markdown

Summary

  • When creating a QueryIterator or SearchIterator, if consistency_level is not explicitly provided in the options, it now falls back to the iterator's own consistency_level instead of hardcoding 0.

@sre-ci-robot
Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: marlon-costa-dc
To complete the pull request process, please assign yah01 after the PR has been reviewed.
You can assign the PR to them by writing /assign @yah01 in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@mergify
Copy link
Copy Markdown

mergify Bot commented Feb 25, 2026

@marlon-costa-dc Thanks for your contribution. Please submit with DCO, see the contributing guide https://github.com/milvus-io/milvus/blob/master/CONTRIBUTING.md#developer-certificate-of-origin-dco.

@mergify mergify Bot added the needs-dco label Feb 25, 2026
@mergify
Copy link
Copy Markdown

mergify Bot commented Feb 25, 2026

@marlon-costa-dc Please associate the related issue to the body of your Pull Request. (eg. “issue: #187”)

Comment thread src/iterator.rs
query_params: init_ts_params,
not_return_all_meta: false,
consistency_level: self.options.consistency_level.unwrap_or(0),
consistency_level: self
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

When options.consistency_level is None and the collection default is Customized, this PR changes the wire value from 0 (Strong) to 4 (Customized) while use_default_consistency remains true. The iterator never consumes options.guarantee_timestamp (dead field at L72, L197), so the request carries Customized without the user-supplied timestamp that the proto spec requires (proto L1041). Whether this causes issues depends on server-side handling of use_default_consistency=true — which cannot be verified from this repo. The fix direction is correct for the 4 common levels (Strong/Session/Bounded/Eventually). Same pattern at L715, L961, L1403. Consider a follow-up to wire options.guarantee_timestamp into the request, or defensively reject Customized when the user hasn't set a consistency level.

@yhmo yhmo force-pushed the fix/iterator-consistency-fallback branch from 0e6d3fa to 4cdbdde Compare April 30, 2026 10:33
@mergify mergify Bot added the ci-passed label Apr 30, 2026
@yhmo yhmo force-pushed the fix/iterator-consistency-fallback branch from 4cdbdde to 035d661 Compare May 6, 2026 04:06
Copilot AI review requested due to automatic review settings May 6, 2026 04:06
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the iterator request construction so that QueryIterator and SearchIterator use the iterator’s configured collection consistency level when options.consistency_level is not explicitly provided, rather than defaulting the request field to 0.

Changes:

  • Use self.consistency_level as the fallback value for consistency_level in iterator query/search requests when the option is unset.
  • Make checkpoint file opening explicitly non-truncating and apply small idiomatic cleanups (map_err(Error::Io), simplifying an iterator sum, and an else if refactor).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants