Repository navigation
fix(strict-mode): enforce max_query_limit on scroll requests when limit is omitted - #10382
Conversation
…it is omitted (fixes #10373)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe scroll request limit retains its configured-or-default behavior. Strict-mode tests now verify omitted limits, explicit limits above the maximum, and explicit limits at the maximum. Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The change makes omitted scroll limits respect the configured maximum and adds coverage for default, excessive, and valid limits; no actionable merge-blocking risk remains beyond normal checks and review. Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Fixed the failing New workflow runs are waiting on maintainer approval ( |
…it is omitted (#10382) * fix(strict-mode): enforce max_query_limit on scroll requests when limit is omitted (fixes #10373) * style: rustfmt scroll query_limit for CI lint --------- Co-authored-by: qdrant-cloud-bot <[email protected]>
Mirror the scroll fix from qdrant#10382 for the two remaining read endpoints whose strict-mode query_limit() runs on the REST request before the default limits are resolved: - facet: an omitted limit now counts as FacetParams::DEFAULT_LIMIT (10) instead of skipping the check - matrix: omitted sample/limit fall back to DEFAULT_SAMPLE / DEFAULT_LIMIT_PER_SAMPLE, so the effective sample * limit is checked The gRPC paths convert to FacetParams/CollectionSearchMatrixRequest (with defaults applied) before check_strict_mode and already enforce correctly, so REST and gRPC disagreed. Adds regression tests next to the existing test_scroll_query_limit.
All Submissions:
devbranch (notmaster) and my branch was created fromdev.Changes to Core Features:
What does this PR do?
Fixes #10373.
When
strict_mode_config.max_query_limitis configured (e.g.max_query_limit: 5), executing ascrollrequest with an omittedlimitwould bypass the limit check and return the built-in default of 10 points.Root Cause:
ScrollRequestInternal'sStrictModeVerificationimplementation was returningself.limit(Option<usize>). Whenlimitwas omitted (None),check_limit_optbypassed validation becauseNonewas treated as no limit specified, and the default (10) was only applied downstream during execution.Solution:
Updated
ScrollRequestInternal::query_limit()inlib/collection/src/operations/verification/local_shard.rsto materialize the default limit before strict-mode validation via:This aligns
scrollwith thequery/searchendpoint families where default limits are checked againstmax_query_limit.Tests Added:
test_scroll_query_limitinlib/collection/src/operations/verification/mod.rsasserting that:limit(defaulting to 10) is rejected whenmax_query_limitis 4.limitexceedingmax_query_limitis rejected.limitwithinmax_query_limitsucceeds.