Repository navigation
[4.2-dev] fix(disttae): account workspace copies against CN memory budget - #32536
Draft
VioletQwQ-0 wants to merge 16 commits into
Draft
VioletQwQ-0 wants to merge 16 commits into
VioletQwQ-0 wants to merge 16 commits into
Conversation
Keep real Linux allocation refusal in the resize ownership test while leaving room for runtime mappings and avoiding high-watermark logging under the limit. Preallocate bounded workspace slices and defer closing EXPLAIN rows on all exits.
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
Which issue(s) this PR fixes:
Related to #32008. Release-specific adaptation of #32458; this does not establish closure of the historical OOM.
What this PR does / why we need it:
On 4.2, transaction workspace copies can outlive their statement without participating in the CN allocation budget. This change places those copies on independent transaction generations of the existing HashBuild CN ledger, preserving its recovery-capacity semantics and physical Free as the refund owner. Dynamic headroom uses retained pre-sample backing so pending allocations and freed/reallocated backing cannot reuse an old sample's credit.
The release also needs publication prerequisites: stage merge/dump/compaction results before replacement, preserve statement boundaries on failure, adopt regenerated rowids rather than duplicating them, and retain persisted-but-unrecorded objects through bounded shared-claim cleanup. Sinker admission precedes persistence, and GC producers are fenced against Engine close. This selects the required local ownership mechanisms without importing the complete #29646/#30988 changes or changing wire/storage formats or user settings.
Design and independent review:
docs/design/txn-workspace-memory-4.2.md(design-first revision 2f84010, followed by separately recorded implementation review).Validation:
Cross-statement merges remain separated by statement region to preserve rollback ownership. The associated batch/commit cost must pass the performance gate. Local copy/merge tests or microbenchmarks do not substitute for it. Keep this PR draft until the remaining acceptance gates are resolved.
Target refresh: 4.2-dev advanced from 42aac81 to d471786 (#32496) during validation. Independently reviewed the complete increment: only GetTableDef property filtering overlaps a source file, with no hunk or ownership/admission dependency. No forced sync was needed. The frozen 42aac81 vs bef35e7 comparison isolates this backport; merge-combination qualification remains separate.
No original experiment namespace/PVC/receiver changes, formal rerun or production deployment are included.