Repository navigation
fix(vector): return append rollback failures instead of panicking - #32167
Conversation
Validate checkpoint bounds, row-range arithmetic and metadata sidecars before mutating rollback state. Return a non-retryable allocation invariant error instead of panicking, and propagate rollback failures through every production caller while preserving the original error identity after successful rollback. Keep the allocator ceiling unchanged. Cover invalid checkpoints and small injected allocator-limit failures, prefix preservation and cleanup without big-data verification.
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? |
|
Validation: CPU unit tests passed for vector, retained-batch append, MergeTop, Order, JSON conversion, multi-update and Parquet callers. The full main-branch static gate passed. Regression tests use small injected allocation limits and invalid checkpoints; no big-data verification was run. The allocator ceiling is unchanged, so this is panic/error-path containment rather than support for allocations above the existing limit. |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 63c40a5238f864efc4065f70c32564f74e7e4dd6
Assessment: approve
Rollback validation now returns terminal invariant errors before mutation, while successful cleanup preserves the original append error object. All production callers propagate rollback failures, continue necessary column cleanup and avoid publishing restored row counts after failure. The fix reuses the existing checkpoint, ownership and error-classification mechanisms. No actionable correctness, design or required-validation gap remains.
Model: gpt-6.1-sol / max
Session: 01a1a004-9884-72c0-ad39-f096c4209c4a · slot 1 · generation 0
Validation:
-
Reviewed every changed hunk in all nine files, the complete indexed discussion and linked issue #32143; distinguished rollback-error containment from the separate oversized-HashBuild segmentation request.
-
Traced all 33 production RollbackAppend calls, allocation retry classification, metadata ownership, borrowed-vector materialization, row/page publication and terminal cleanup across retained batches, sorting, multi-update, JSON and Parquet consumers.
-
Reused supplied exact-head SUCCESS conclusions for shared build, UT, arm64 SCA, UT coverage, proxy/pessimistic compose BVT and CI Required. Assessed the author's CPU-package validation report as attributed evidence; skipped/neutral lanes were not counted as passes.
-
Local bounded frozen-source audit passed: exact clean HEAD, complete nine-file coverage, supplied patch match, git diff --check, every production rollback caller consuming the error, invariant-before-capacity classification and complete discussion-key coverage. See frozen-audit.log, rollback-callers.json and the matching receipt in validation-audit.json.
Limitations:
-
No local Go/native or SQL execution was performed; the supplied snapshot provides CI conclusions without raw logs, and local_validation is empty.
-
This PR retains the existing allocator ceiling. It does not resolve or validate processing a single HashBuild varlen area above that limit.
✅ Merged into
|
## What type of PR is this? - [x] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Related to #32143. Backport of #32167 to `4.2-dev`; this handles allocation-error cleanup, not oversized allocation support. ## What this PR does / why we need it: An allocation refusal must remain a returned query error. On `4.2-dev`, an invalid append checkpoint currently panics during cleanup and can replace the original allocation error. Make `Vector.RollbackAppend` return a terminal allocation-invariant error instead of panicking. Validate checkpoint bounds, negative attempted-row counts and row-range overflow before changing vector length, area, bitmaps or sorted state. Retain owned capacity for eventual `Free`. Propagate rollback failures through both retained join-batch append paths. Continue restoring the other affected columns after one rollback fails, and do not publish a restored batch row count unless every column was restored. Preserve the original error object when rollback succeeds; retain both causes when it fails so an invariant violation is not classified as retryable memory pressure. Adapt the fix to the release branch's checkpoint layout and callers without importing main-only metadata or Parquet changes. Keep allocator ceilings, join row addressing and memory budgets unchanged. ## Validation - CPU tests on Go 1.26.4: complete `pkg/container/vector` and `pkg/sql/colexec` suites passed. - Small regressions cover invalid checkpoint bounds, row-range overflow, allocator refusal, prefix preservation and balanced cleanup; append checkpoint and failed-append reuse controls passed. - Formatting, diff checks and repository convention checks passed. No big-data or GPU verification was run. - Full `make static-check` passed with the release-pinned tools on Go 1.26.4; golangci-lint reported 0 issues. ## CI verification The revoked-role integration test now fences the revocation committed on CN0 before checking denial on CN1, using the existing fixture commit-publication helper. All text/binary prepared and DDL denial assertions remain intact; no sleep, retry or timeout increase. - Exact failing test passes with Go 1.26.4: `TestIssue29399AuthorizationScopeAndRevokedRole` (15.151s). - Complete pre-push gate passes with the release-pinned tools: zero issues. - Latest authoritative `4.2-dev` merged; no main-branch merge.
What type of PR is this?
Which issue(s) this PR fixes:
Related to issue #32143. This contains allocation-error handling; it does not make oversized allocations succeed.
What this PR does / why we need it:
An allocation refusal must remain a returned query error, even when append cleanup cannot restore its checkpoint. RollbackAppend currently panics on invalid checkpoint bounds or missing restoration metadata, which can replace the original allocation error during failure cleanup.
Make RollbackAppend return a terminal allocation-invariant error instead of panicking. Validate restoration bounds and attempted-row arithmetic before mutation, and retain owned capacity for eventual Free. Preserve the original error object unchanged when rollback succeeds; retain both causes when rollback fails so invariant failures cannot be treated as retryable memory pressure.
Update every production rollback caller to propagate the result, including retained join batches, MergeTop, Order, multi-update, JSON conversion and Parquet readers. Continue restoring other affected columns after a rollback failure, and avoid publishing restored batch row counts when rollback did not succeed.
Keep the allocator ceiling, join row addressing and query memory budgets unchanged. Add small CPU regression tests for invalid checkpoints, metadata validation, row-range overflow, allocator-limit refusal, prefix preservation and balanced cleanup.