treedb: retain more leaf-ref build pages - #3568
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
|
Clean sequential coordinator gate for #3537 / #3568: Artifact root: Throughput:
Allocation totals:
The specific #3537 target did not reproduce in this focused gate: Visible top allocators in this gate are now mostly Decision: leave this PR draft / gate-blocked. It has useful lifetime coverage, but the constant change is not mergeable as an allocation optimization on this evidence because the target does not reproduce and there are material allocation/throughput regressions in selected delete workloads. |
Objective
Prepare the focused #3537 leaf-ref cache slice by reducing persisted leaf-ref build-page churn in the zipper scratch cache while preserving the cache-owned byte lifetime invariant.
Fixes #3537 after the deferred benchmark gate passes.
Context
Post-#3561/#3565 main evidence reported
TreeDB/zipper.(*mergeScratch).acquireLeafRefCacheBuildPageas a current full-run allocation surface in/tmp/gomap_alloc_loop_main_post3561_all_20260706_060625at commit6f2d94def23551ccb1c6bdb35514bc72733d88e0.This PR intentionally does not claim performance validation yet. A local 10M gate attempt was stopped because another worker was running a concurrent 10M gate on the same machine, contaminating benchmark evidence. Those partial artifacts must not be used for merge decisions.
Non-goals
Design
mergeLeafRefCachePageKeepfrom4096to8192.endLeafRefCacheclears the active leaf-ref cache map.Scope
Includes:
TreeDB/zipper/zipper.go: leaf-ref cache build-page retention cap.TreeDB/zipper/zipper_test.go: overflow lifetime regression coverage.Excludes:
TreeDB/internal/memtableTreeDB/cachingCorrectness
Tests run locally:
Focused coverage added:
TestZipperLeafRefCacheOverflowBuildPagesStayPinnedUntilCloseforces more active cache build pages than the retention cap, persists both retained and overflow pages throughleafPageCacheAdoptOwned, mutates later active build buffers, and verifies cached leaf-log loads still return the original leaf entries without using the leaf page reader.Performance
Benchmarks run:
Invalidated local attempt:
Required before merge:
Gate status:
acquireLeafRefCacheBuildPageflat bytes/objects with no material throughput regression.Rollout / Toggle Plan
AI Review Loop