Repository navigation
Conversation
Backport the Window allocation-lifecycle repair to the 4.2.1 hotfix branch. Retire inherited account-owned buffers before terminal account completion while preserving reuse of unaccounted storage. Cover prepared SQL and account lifecycle controls.
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
|
|
|
mo-bot review · Commit: "interrupted" |
What type of PR is this?
Which issue(s) this PR fixes:
Related to #31089. Backports the Window lifecycle fix from #31127 to the 4.2.1 hotfix branch.
What this PR does / why we need it:
A prepared JOIN followed by a Window can leave account-owned input and expression buffers alive after execution. Window Reset clears their logical data but retains their backing, so allocation-account finalization reports an invariant failure and suspends admission for subsequent account-owning queries on the same CN.
Release the Window-owned buffers belonging to an allocation account at Reset, detach the result wrapper's borrowed references, and clear freed expression slots. Continue reusing unaccounted buffers. The change scans Window's buffered vector slots at Reset; it does not add per-row work or change account admission policy.
On base
87866e6d2822, a three-row prepared JOIN with an unpartitioned cumulative SUM reproducedallocation account invariant failure(48 bytes, four allocations); a subsequent JOIN failed withallocation account admission is suspended. A direct Window/registry control reproduced the same transition and showed that freeing Window's retained buffers releases the suspension. The user's incident has not yet been correlated with this specific query shape.Validation on macOS arm64, Go 1.26.4, with native libraries built from this hotfix source:
GitHub CI is pending. The standalone customer workload and Linux runtime have not been tested in this local run.