Repository navigation
[4.2] fix(frontend): release query result metadata batch - #27499
Conversation
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? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Reviewed exact head 48948738263f220f056eb33dab07ed14bf9d6ef6.
saveMeta is the sole owner of the completed metadata batch. The 4.2 object writer synchronously marshals/compresses every vector into writer-owned byte buffers during Write and retains no batch/vector reference, so deferring metaBat.Clean(ses.pool) is safe after Write, through WriteEnd, and on every writer-construction/write/error/panic return. No competing cleanup owner or use-after-free path was found; the separate partial-construction ownership case remains isolated in #27500.
Validation: exact-head Test_saveQueryResultMeta passed under -race, count=5, with an additional temporary oracle asserting the session mpool returned to its pre-saveMeta live-byte baseline. git diff --check passed. No blocking correctness or lifecycle issue found.
Merge Queue Status
This pull request spent 28 seconds in the queue, including 1 second running CI. Required conditions to merge
|
What type of PR is this?
Which issue(s) this PR fixes:
issue #27405
What this PR does / why we need it:
Backport #27454 to 4.2-dev.
Release the temporary query-result metadata batch after object serialization completes. The writer stores serialized buffers rather than the input batch, so saveMeta retains ownership through every success and writer-error path and can safely clean it on return.
The source commit applied cleanly to the newest 4.2-dev tip.
Validation: