fix(l1): preserve the largest prefix when a batch is short on memory - #9
fix(l1): preserve the largest prefix when a batch is short on memory#9voipmonitor wants to merge 2 commits into
Conversation
reserve_write's batch allocation was all-or-nothing: short by a few blocks meant every key got OUT_OF_MEMORY. A large L2->L1 restore then collapsed to zero prefix hits and the request re-prefilled its whole context (observed live: a 5700-chunk ~19 GB restore completed 8/5700 after missing the batch by 1140 blocks, stalling decode for minutes). Fall back to allocating the longest prefix that fits, estimated from the allocator's free space and halved on failure. The unallocated tail keeps explicit per-key OUT_OF_MEMORY results. Both callers already handle per-key failure: prefetch trims to the contiguous prefix and the store path skips failed keys.
|
Warning Review limit reached
Next review available in: 59 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: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
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 |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Problem
reserve_writeused an all-or-nothing batch allocation. If a large L2-to-L1 restore was short by only a few blocks, every key became OUT_OF_MEMORY and the complete prefix had to be recomputed. FLO observed a 5700-chunk restore retaining only 8 chunks after missing the batch by 1140 blocks.Change
This improves the original Florian Bernd implementation: its byte estimate plus halving could stop below the true maximum under alignment or fragmentation. Binary search runs only on the OOM recovery path and finds the actual maximum supported by the allocator. The original commit and authorship are preserved.
Validation