Skip to content

[4.2] fix(frontend): release query result metadata batch - #27499

Merged
mergify[bot] merged 1 commit into
matrixorigin:4.2-devfrom
aunjgr:backport/27405-4.2
Aug 23, 2026
Merged

mergify[bot] merged 1 commit into
matrixorigin:4.2-devfrom
aunjgr:backport/27405-4.2

Conversation

@aunjgr

@aunjgr aunjgr commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

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:

  • full pkg/frontend suite

@aunjgr
aunjgr requested a review from XuPeng-SH as a code owner August 23, 2026 11:20
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@mergify mergify Bot added the queued label Aug 23, 2026
@mergify

mergify Bot commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-08-23 12:18 UTC · Rule: release-4.2 · triggered by rule Automatic queue on approval for release-4.2
  • ✅ Checks skipped · PR is already up-to-date
  • ✅ Merged — 2026-08-23 12:19 UTC · at 48948738263f220f056eb33dab07ed14bf9d6ef6 · squash

This pull request spent 28 seconds in the queue, including 1 second running CI.

Required conditions to merge
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • github-review-approved [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone CI / SCA Test on Linux/arm64
    • check-neutral = Matrixone CI / SCA Test on Linux/arm64
    • check-skipped = Matrixone CI / SCA Test on Linux/arm64
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone CI / UT Test on Ubuntu/x86
    • check-neutral = Matrixone CI / UT Test on Ubuntu/x86
    • check-skipped = Matrixone CI / UT Test on Ubuntu/x86
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Utils CI / Coverage
    • check-neutral = Matrixone Utils CI / Coverage
    • check-skipped = Matrixone Utils CI / Coverage
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
    • check-neutral = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
    • check-skipped = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)
    • check-neutral = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)
    • check-skipped = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)

@mergify
mergify Bot merged commit 6f85f17 into matrixorigin:4.2-dev Aug 23, 2026
27 of 28 checks passed
@mergify mergify Bot removed the queued label Aug 23, 2026

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working size/XS Denotes a PR that changes [1, 9] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants