fix(iterator): fallback to iterator consistency level if not provided in options#106
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: marlon-costa-dc The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@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. |
|
@marlon-costa-dc Please associate the related issue to the body of your Pull Request. (eg. “issue: #187”) |
| query_params: init_ts_params, | ||
| not_return_all_meta: false, | ||
| consistency_level: self.options.consistency_level.unwrap_or(0), | ||
| consistency_level: self |
There was a problem hiding this comment.
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.
0e6d3fa to
4cdbdde
Compare
4cdbdde to
035d661
Compare
There was a problem hiding this comment.
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_levelas the fallback value forconsistency_levelin 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 anelse ifrefactor).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
QueryIteratororSearchIterator, ifconsistency_levelis not explicitly provided in the options, it now falls back to the iterator's ownconsistency_levelinstead of hardcoding0.