Skip to content

test(external): verify cleanup when filling a missing saved column fails - #33046

Merged
XuPeng-SH merged 1 commit into
mainfrom
fix/31625-zonemap-vector-leak
Nov 21, 2026
Merged

XuPeng-SH merged 1 commit into
mainfrom
fix/31625-zonemap-vector-leak

Conversation

@XuPeng-SH

@XuPeng-SH XuPeng-SH commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does

Related to #31625. After rebasing onto main, #33045 already removes the temporary vectors this PR originally fixed. This follow-up adds a missing error-path test to the upstream saved-result reader fixture.

The test reads a real saved column, then forces the allocation for a missing column's NULL fill to fail. It checks that the original allocation error reaches the caller, the block offset and published row count do not advance, and the loaded column and caller-owned buffers are released.

Validation

  • Existing and new saved-result projection subtests pass under race.
  • With only the new subtest omitted, the missing-column append error branch has zero hits. Enabling the subtest covers that branch in the same fixture.
  • Go vet and incremental golangci-lint passed.

@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 →

@mergify

mergify Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is merged.

@XuPeng-SH

XuPeng-SH commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor Author

mo-bot review · mo-bot-local · done

Commit: 4f924a88263a205379c7f7244f04b887035020a5

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

mo-bot review · mo-bot-local · review

Commit: 4f924a88263a205379c7f7244f04b887035020a5

Assessment: request_changes

The ownership fix releases temporary vectors after successful copies and on append failure. Correct the physical column mapping in the regression’s reordered control.

Model: gpt-6.2-sol / xhigh

Session: 01a1f0a0-5126-78f3-9ab8-ef4e87f2f119 · slot 0 · generation 3

  • P3 pkg/sql/colexec/external/reader_zonemap_leak_test.go:147: The hidden-last subtest moves v to the first output position and changes its physical field index to 0. The fixture stores v at field 1.
    Impact: The control passes while reading VARCHAR bytes into the INT32 output. Its row-count and memory assertions miss the incorrect values.
    Evidence: Adding a value assertion to the submitted fixture showed v returning 1818326537 for the first row, where the fixture wrote 0. Keep v at physical field 1 and __mo_filepath at physical field 0 in both projection orders, and assert the returned values.

Validation:

  • With corrected ordinals, both projection orders and the forced append-failure check passed on the candidate, including three iterations under race detection. The baseline retained 4,608 bytes and two objects in both the hidden-first and append-failure cases.

  • The normal external package run passed 709 tests. Its sole failure was a MinIO startup connection refusal in the Arrow integration test, which passed on an isolated retry. Matching receipts and logs are indexed in review-evidence.md.

Limitations:

  • Local validation exercised the production reader with real MO-format objects in an in-memory file service. SQL frontend execution was outside local validation.

@XuPeng-SH

XuPeng-SH commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor Author

mo-bot review · mo-bot-local · done

Commit: 2b4fd22abc9629e08da513fb509d2e6d180e597f

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

mo-bot review · mo-bot-local · review

Commit: 2b4fd22abc9629e08da513fb509d2e6d180e597f

Assessment: approve

The reader frees each owned temporary after copying and frees any unfinished temporary on error. The loaded batch retains ownership of file vectors. The revised regression resolves the prior finding by preserving physical column ordinals and checking all 64 saved values in both projection orders.

Model: gpt-6.2-sol / xhigh

Session: 01a1f0a0-5126-78f3-9ab8-ef4e87f2f119 · slot 0 · generation 3

Validation:

  • Both projection orders, the filter mapping controls, and the forced Union allocation-error probe passed on the candidate.

  • The baseline retained 4,608 bytes in both the hidden-first case and the forced error case. The hidden-last control passed.

  • Isolation preflight, native-input verification, and git diff --check passed. review-evidence.md records the matching receipts and logs.

Limitations:

  • Local tests exercised the production reader with real MO-format result files in an in-memory file service. SQL frontend execution was outside local coverage, and broad CI was pending in the frozen snapshot.

@XuPeng-SH
XuPeng-SH force-pushed the fix/31625-zonemap-vector-leak branch from 2b4fd22 to 3f8a6d2 Compare November 21, 2026 17:50
@XuPeng-SH XuPeng-SH changed the title fix(external): release zonemap temporary vectors test(external): verify cleanup when filling a missing saved column fails Nov 21, 2026
@matrix-meow matrix-meow added size/S Denotes a PR that changes [10,99] lines and removed size/M Denotes a PR that changes [100,499] lines labels Nov 21, 2026
@XuPeng-SH

XuPeng-SH commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor Author

mo-bot review · mo-bot-local · done

Commit: 3f8a6d2d745aceac504c2d624fceaa196e2e7668

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

mo-bot review · mo-bot-local · review

Commit: 3f8a6d2d745aceac504c2d624fceaa196e2e7668

Assessment: approve

The new subtest reuses the saved-result fixture and forces NULL-fill allocation to fail after a real column has been copied. It verifies that the reader returns the allocation error, leaves the block offset and published row count at zero, and releases the loaded data and caller buffers.

Model: gpt-6.2-sol / xhigh

Session: 01a1ee80-0d82-7030-a965-b51f496c3054 · slot 2 · generation 1

Validation:

  • Verified the frozen patch, pinned policy, and discussion ledger. See scope.stdout and receipt 1795284281703393071-2.

  • The saved-result projection and filter-mapping tests passed under race detection. See zonemap-retry.stdout and receipt 1795284571231741193-2.

  • With the same production reader, the pinned base fixture hit the missing-column error return zero times and the candidate hit it once. See coverage-check.stdout and receipts 1795284595327215699-2 and 1795284602106291499-2.

Limitations:

  • Local execution covered the focused reader tests using real saved-result blocks in an in-memory file service.

@XuPeng-SH
XuPeng-SH merged commit 03f5d05 into main Nov 21, 2026
@XuPeng-SH
XuPeng-SH deleted the fix/31625-zonemap-vector-leak branch November 21, 2026 20:19
fengttt added a commit to fengttt/matrixone that referenced this pull request Nov 21, 2026
main now carries the squashed forms of the PRs this branch was stacked on,
through matrixorigin#33027. The merged tree is this branch's own commits
(4de8e4e..1cc5610) replayed onto main, with three conflicts and one
semantic follow-up resolved:

- top: processBatchResident takes main's ordering specs (matrixorigin#33042) and keeps
  this branch's retained-pool prologue.
- external/reader_zonemap: main's rewritten saved-result reader (matrixorigin#33045)
  writes output vectors, including filled missing columns, through the
  operator's output pool; the loaded block stays on proc's pool.
- group/collation_metadata_test: main's form of the same offset fix.
- external/reader_zonemap_test (matrixorigin#33046): the capacity-failure cases bind
  an accounted output view instead of a per-vector allocation account, and
  pre-size the first column so the failure still lands on the second.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

This branch was previously deployed

1 inactive deployment
ci — 3f8a6d2d Deployed Nov 21, 2026 by XuPeng-SH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Denotes a PR that changes [10,99] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants