Skip to content

fix(vector): return append rollback failures on 4.2-dev - #32186

Merged
XuPeng-SH merged 3 commits into
matrixorigin:4.2-devfrom
aunjgr:fix/allocator-rollback-errors-4.2
Nov 4, 2026
Merged

XuPeng-SH merged 3 commits into
matrixorigin:4.2-devfrom
aunjgr:fix/allocator-rollback-errors-4.2

Conversation

@aunjgr

@aunjgr aunjgr commented Nov 4, 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:

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.

Backport the safety semantics of 940d0f7: reject invalid checkpoint bounds and row-range overflow with a terminal error before mutation, propagate rollback failures through retained-batch append, and preserve the original allocation error after successful rollback.

Keep the 2 GiB allocator ceiling and existing join storage unchanged. Adapt to the release branch without importing main-only metadata, Parquet or expression changes.
@aunjgr
aunjgr requested a review from XuPeng-SH as a code owner November 4, 2026 14:26
@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 commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

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

Commit: a0823720a7e8af8f168f62da1a71d29bb4057316

Review completed. Read the assessment.

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

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

Commit: a0823720a7e8af8f168f62da1a71d29bb4057316

Assessment: approve

The narrow rollback fix reuses existing invariant classification, preserves valid rollback behavior and cleanup ownership, and adds no state. The integration-test fence preserves denial assertions. No actionable defects remain.

Model: gpt-6.1-sol / max

Session: 01a1a004-9884-72c0-ad39-f096c4209c4a · slot 1 · generation 0

Validation:

  • Local source audit passed: frozen head, clean checkout, expected four-file scope, git diff --check and gofmt. source-audit.log matches checks/1793816501821552049-2.json, exit 0.

  • Reviewed both rollback consumers, terminal cleanup, spill classification and existing prefix, bitmap, reuse and accounting tests.

  • Supplied author evidence reports passing full vector/colexec suites, static checks and TestIssue29399AuthorizationScopeAndRevokedRole on Go 1.26.4.

  • Frozen current-head CI records 12 successes, 13 skipped checks and 2 neutral checks, including successful UT, static analysis, coverage and multi-CN BVT.

Limitations:

  • Go/native and embedded-cluster tests were not rerun locally. Supplied CI and author results were reused; raw test logs are not embedded.

This branch was previously deployed

1 inactive deployment
ci — a0823720 Deployed Nov 4, 2026 by aunjgr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/api-change kind/bug Something isn't working size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants