Repository navigation
[4.2] fix(frontend): clean partial query result metadata batch - #27500
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.
I reviewed exact head daeece841e7fc934c34481b6be20fe941022459f. The production ownership fix is sound, but the new regression test does not assert the behavior it is named for.
TestBuildQueryResultMetaBatchCleansPartialBatchOnAppendFailure only checks err != nil and bat == nil. Those conditions were already true before this fix. defer mpool.DeleteMPool(mp) does not make a leak fail the test: for a normal pool, DeleteMPool logs live bytes but does not turn them into a test failure.
I verified this directly by temporarily removing the production cleanup while keeping the PR test unchanged; the focused test still exited 0. Please assert the ownership oracle before deleting the pool, for example require.Zero(t, mp.CurrNB()). With that assertion added, the exact-head fix passes the focused test for 10 uncached runs and the unfixed implementation fails for the intended retained-allocation reason.
|
Resolved at exact head I found that
Validation: focused test x10, full |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Re-reviewed exact head 096cc4a. The revised regression is mutation-sensitive: removing the builder cleanup leaves all 16 vectors retained and fails the test. Ownership is closed on every partial-error/panic path; successful ownership transfers to saveMeta, whose defer cleans after synchronous serialization. Focused count=10, focused race count=10, full pkg/frontend, diff check, and current CI all pass. Approving.
Merge Queue Status
This pull request spent 55 seconds in the queue, with no time running CI. Waiting for
All conditions
ReasonPull request #27500 has been dequeued Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.
HintYou should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. Tick the box to put this pull request back in the merge queue (same as
|
What type of PR is this?
Which issue(s) this PR fixes:
issue #27406
What this PR does / why we need it:
Backport #27455 to 4.2-dev.
Keep ownership of the query-result metadata batch inside the builder until every metadata field is appended. Any append error releases all previously populated vectors before returning; a successful return transfers the completed batch to its caller.
The production fix applied cleanly to the newest 4.2-dev tip. Its regression test was placed into the older 4.2 test layout without bringing unrelated main-only tests.
Validation: