fix: free large-value segment pages on full-partition Truncate - #486
fix: free large-value segment pages on full-partition Truncate#486thweetkomputer wants to merge 1 commit into
Conversation
|
Warning Review limit reached
Next review available in: 23 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 Run ID: 📒 Files selected for processing (2)
✨ 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 |
Truncate's full-partition fast path (empty position) iterated only the data mapper and FreePage'd its pages, never touching the segment mapper. For a partition holding large values the segment mapping stayed fully populated, so the empty snapshot flushed by UpdateMeta serialized it verbatim: GC's manifest replay kept every segment file alive forever (only DropTable would reclaim them), and the stale mapping was copied into every later archive/branch snapshot. The partial-truncate path frees these via DelLargeValue. Free the segment pages too, mirroring the data-mapper loop, so the flushed segment mapping is empty and GC reclaims the files. Regression test in large_value_gc: full-truncating a partition of pinned large values leaves no segment files after GC (retained without the fix).
8170e9a to
b44e74f
Compare
Problem
Truncate's full-partition fast path (empty position) iterated only the data mapper andFreePage'd its pages — it never touched the segment mapper. For a partition holding large values the segment mapping stayed fully populated, so the empty snapshot flushed byUpdateMetaserialized it verbatim:DropTablewould reclaim them);Reads correctly saw an empty partition, so this is a silent space leak (disk and cloud) + snapshot pollution, not a correctness bug. The partial-truncate path already frees these via
DelLargeValue.Fix
Free the segment pages too, mirroring the data-mapper loop, so the flushed segment mapping is empty and GC reclaims the files. The empty-snapshot flush serializes the current segment mapping (not deltas), so no delta recording is needed.
Test
large_value_gc: full-truncating a partition of pinned large values leaves no segment files after GC. Verified it fails without the fix (the files are retained).