fix(drive): reject zero effective distinct count limit#4197
Conversation
With four colors and the `> "blue"` predicate only three distinct values matched, so the Some(10_000) clamp case passed identically whether the storage walk was bounded or not. A fifth color makes the predicate match four values — one more than max_query_limit — so the clamp case now fails against an unbounded walk. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The walk-mode destructure is provably dead today (both aggregate arms return earlier in the function), but a future early-exit added to the aggregate branch would turn the unreachable! into a panic on the query path. Return CorruptedCodeExecution instead, matching how rs-drive reports defensive impossibilities elsewhere. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Port the sum-side zero-limit fail-closed check to the count dispatcher: a max_query_limit of 0 (or an explicit limit of 0) previously reached grovedb with a zero bound, which returns nothing and masquerades as an empty result set. Now rejected as InvalidLimit before the storage walk, mirroring effective_no_proof_distinct_limit on the sum side. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
🕓 Ready for review — 36 ahead in queue (commit 0b19b3f) |
|
Warning Review limit reached
Next review available in: 15 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v4.1-dev #4197 +/- ##
============================================
+ Coverage 87.48% 87.49% +0.01%
============================================
Files 2651 2663 +12
Lines 334673 336422 +1749
============================================
+ Hits 292793 294360 +1567
- Misses 41880 42062 +182
🚀 New features to boost your workflow:
|
What
effective_no_proof_distinct_limitpolicy (with a regression test)CorruptedCodeExecutioninstead ofunreachable!ahead of the distinct SUM storage walkmax_query_limit: 3)Why
Review follow-ups to #4149, which merged while they were being prepared:
max_query_limit: 0config (or explicit zero limit) previously reached grovedb with a zero bound on the count path, which returns nothing and masquerades as an empty result set. The sum side already failed closed; the count side now matches.unreachable!was provably dead, but a future early-exit in the aggregate branch would have turned it into a query-path panic rather than an error.Checks
🤖 Generated with Claude Code