Skip to content

fix(mpool): remove capacity class limit for parallel hash build - #26669

Merged
mergify[bot] merged 3 commits into
matrixorigin:mainfrom
aptend:fix/26663-allocation-capacity-class
Aug 4, 2026
Merged

mergify[bot] merged 3 commits into
matrixorigin:mainfrom
aptend:fix/26663-allocation-capacity-class

Conversation

@aptend

@aptend aptend commented Aug 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:

issue #26663

What this PR does / why we need it:

TPCH Q9 with four shuffle joins and max_dop=64 creates 256 parallel shuffle HashBuild workers. Each worker registers a recovery capacity controller, but AllocationCapacityClass used uint8 and reserved zero for the default controller, so the 256th registration failed with allocation account invariant failure before query execution.

This PR:

  • expands AllocationCapacityClass from uint8 to uint32;
  • preserves the 16-byte allocationLease layout by removing obsolete explicit padding;
  • adds a regression test that registers and cleanly releases 256 HashBuild recovery capacity controllers.

Local validation:

  • go build, go vet, and full unit tests for pkg/common/mpool and pkg/vm/process;
  • focused HashBuild spill regression test;
  • focused race tests with -count=100 and full-package race tests for both owning packages.

@aptend
aptend requested review from XuPeng-SH and aunjgr as code owners August 4, 2026 03:11
@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.

Deep-reviewed exact head 9d6b12a051d51861fc04d1695ca455ffe0f81876.

The uint32 capacity-class namespace fixes the reachable 256th-worker failure without changing the 16-byte allocationLease footprint. I traced all class consumers through mpool, vector allocation selections, HashBuild spill/recovery, and reset/terminal cleanup: there are no narrowing conversions or serialized representations, registration remains mutex-serialized and nonzero/unique, and live registrations are rejected at terminal completion.

Independent validation:

  • parent 21908973304c4117ee2f19670d1d8acd218cd0fb fails exactly on registration 256 with allocation account invariant failure;
  • PR head passes 257 sequential registrations, uint32 wrap/default-zero skipping, occupied-ID skipping, and 512 concurrent unique registrations;
  • focused counterexamples pass under -race -count=10;
  • go vet and full tests pass for pkg/common/mpool and pkg/vm/process;
  • focused HashBuild accounted-spill lifecycle tests pass;
  • current CI is green.

No blocking findings.

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

mergify Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-08-04 04:24 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • ❌ Checks failed · in-place
  • 🚫 Left the queue — 2026-08-04 05:30 UTC · at f7c755a10ba5506893c24ff1a6ad6eaedb30ad35

This pull request spent 1 hour 5 minutes 24 seconds in the queue, with no time running CI.

Waiting for
  • any of: [🛡 GitHub branch protection]
    • check-neutral = Matrixone CI / UT Test on Ubuntu/x86
    • check-skipped = Matrixone CI / UT Test on Ubuntu/x86
    • check-success = Matrixone CI / UT Test on Ubuntu/x86
  • any of: [🛡 GitHub branch protection]
    • check-neutral = Matrixone CI / SCA Test on Linux/arm64
    • check-skipped = Matrixone CI / SCA Test on Linux/arm64
    • check-success = Matrixone CI / SCA Test on Linux/arm64
  • any of: [🛡 GitHub branch protection]
    • 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)
    • check-success = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
  • any of: [🛡 GitHub branch protection]
    • check-neutral = Matrixone Utils CI / Coverage
    • check-skipped = Matrixone Utils CI / Coverage
    • check-success = Matrixone Utils CI / Coverage
All conditions
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Matrixone CI / UT Test on Ubuntu/x86
    • check-skipped = Matrixone CI / UT Test on Ubuntu/x86
    • check-success = Matrixone CI / UT Test on Ubuntu/x86
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Matrixone CI / SCA Test on Linux/arm64
    • check-skipped = Matrixone CI / SCA Test on Linux/arm64
    • check-success = Matrixone CI / SCA Test on Linux/arm64
  • any of [🛡 GitHub branch protection]:
    • 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)
    • check-success = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Matrixone Utils CI / Coverage
    • check-skipped = Matrixone Utils CI / Coverage
    • check-success = Matrixone Utils CI / Coverage
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • github-review-approved [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
    • check-neutral = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
    • check-skipped = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-neutral = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-skipped = Matrixone UT Coverage / UT Coverage on Ubuntu/x86

Reason

The merge conditions cannot be satisfied due to failing checks

Failing checks:

Hint

You may have to fix your CI before adding the pull request to the queue again.
If you update this pull request, to fix the CI, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Requeued — the merge queue status continues in this comment ↓.

@mergify

mergify Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-08-04 06:34 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • ✅ Checks passed · in-place
  • ✅ Merged — 2026-08-04 07:18 UTC · at 651b99e1e3c81b5c74381be11e0fe7acbf99b5fe · squash

This pull request spent 43 minutes 59 seconds in the queue, including 42 minutes 38 seconds 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 Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
    • check-neutral = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
    • check-skipped = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
  • 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 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 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 Utils CI / Coverage
    • check-neutral = Matrixone Utils CI / Coverage
    • check-skipped = Matrixone Utils CI / Coverage
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-neutral = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-skipped = Matrixone UT Coverage / UT Coverage on Ubuntu/x86

@mergify mergify Bot removed the dequeued label Aug 4, 2026
@mergify
mergify Bot merged commit 4b01f8b into matrixorigin:main Aug 4, 2026
25 of 26 checks passed
@mergify mergify Bot removed the queued label Aug 4, 2026
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…ixorigin#26669)

TPCH Q9 with four shuffle joins and `max_dop=64` creates 256 parallel shuffle HashBuild workers. Each worker registers a recovery capacity controller, but `AllocationCapacityClass` used `uint8` and reserved zero for the default controller, so the 256th registration failed with `allocation account invariant failure` before query execution.

This PR:

- expands `AllocationCapacityClass` from `uint8` to `uint32`;
- preserves the 16-byte `allocationLease` layout by removing obsolete explicit padding;
- adds a regression test that registers and cleanly releases 256 HashBuild recovery capacity controllers.

Local validation:

- `go build`, `go vet`, and full unit tests for `pkg/common/mpool` and `pkg/vm/process`;
- focused HashBuild spill regression test;
- focused race tests with `-count=100` and full-package race tests for both owning packages.

Approved by: @XuPeng-SH
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…ixorigin#26669)

TPCH Q9 with four shuffle joins and `max_dop=64` creates 256 parallel shuffle HashBuild workers. Each worker registers a recovery capacity controller, but `AllocationCapacityClass` used `uint8` and reserved zero for the default controller, so the 256th registration failed with `allocation account invariant failure` before query execution.

This PR:

- expands `AllocationCapacityClass` from `uint8` to `uint32`;
- preserves the 16-byte `allocationLease` layout by removing obsolete explicit padding;
- adds a regression test that registers and cleanly releases 256 HashBuild recovery capacity controllers.

Local validation:

- `go build`, `go vet`, and full unit tests for `pkg/common/mpool` and `pkg/vm/process`;
- focused HashBuild spill regression test;
- focused race tests with `-count=100` and full-package race tests for both owning packages.

Approved by: @XuPeng-SH
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…ixorigin#26669)

TPCH Q9 with four shuffle joins and `max_dop=64` creates 256 parallel shuffle HashBuild workers. Each worker registers a recovery capacity controller, but `AllocationCapacityClass` used `uint8` and reserved zero for the default controller, so the 256th registration failed with `allocation account invariant failure` before query execution.

This PR:

- expands `AllocationCapacityClass` from `uint8` to `uint32`;
- preserves the 16-byte `allocationLease` layout by removing obsolete explicit padding;
- adds a regression test that registers and cleanly releases 256 HashBuild recovery capacity controllers.

Local validation:

- `go build`, `go vet`, and full unit tests for `pkg/common/mpool` and `pkg/vm/process`;
- focused HashBuild spill regression test;
- focused race tests with `-count=100` and full-package race tests for both owning packages.

Approved by: @XuPeng-SH

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/S Denotes a PR that changes [10,99] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants