Repository navigation
fix(mpool): make on-heap ownership observable - #27497
Merged
XuPeng-SH merged 8 commits intoAug 23, 2026
Merged
Conversation
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? |
XuPeng-SH
approved these changes
Aug 23, 2026
XuPeng-SH
left a comment
Contributor
There was a problem hiding this comment.
Deep-reviewed exact head 476a5f5f766c78f54f115254747887431e3c7580. The normal-pool, NoLock teardown, late/cross-pool Free, global ownership counters, per-pool diagnostics, and metric publication paths close consistently. Local race/lifecycle stress and the focused frontend cleanup tests passed; I found no blocking correctness or lifecycle issue.
VioletQwQ-0
pushed a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Fixes matrixorigin#27404 ## What this PR does / why we need it: Keep the strong pointer registry and make its explicit-Free ownership contract observable instead of relying on GC semantics that the registry intentionally prevents. - Account successful on-heap MPool allocations globally by live bytes, live objects, and high-water mark without changing off-heap admission or resource accounting. - Export live-byte and live-object Prometheus gauges, and include per-pool outstanding ownership plus optional allocation/free call sites in diagnostics. - Warn when a normal pool is deleted with outstanding on-heap ownership while preserving metadata for a valid late Free. Treat NoLock pool deletion as its terminal bulk-release boundary. - Document that every successful non-empty allocation must reach Free, except for NoLock allocations released by pool teardown. - Fix the test-only missing cleanup sites surfaced by the ownership audit. The hot path keeps only bounded global atomic accounting. Per-pool diagnostics scan the authoritative sharded registry at report/delete boundaries, avoiding per-allocation labels or unbounded diagnostic state. The added benchmark shows no allocation-count regression (one allocation per on-heap Alloc/Free cycle); exact-main comparisons showed roughly 7% median overhead for normal-pool 64 B and 1 KiB cycles, with noisier NoLock/large-object results. Validation: - full pkg/common/mpool, pkg/util/metric/v2, pkg/util/metric/mometric, and pkg/frontend tests - focused lifecycle, failed-allocation, cross-pool, double-free, and concurrent on/off-heap tests - race stress (100 repetitions) for lifecycle/teardown/concurrent accounting and metric refresh - full race tests for pkg/common/mpool and pkg/util/metric/mometric - build and vet for affected packages - high-risk ownership audit across vector, batch, reuse, publication, and frontend; no remaining outstanding-on-heap warnings --------- Co-authored-by: XuPeng-SH <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0
pushed a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Fixes matrixorigin#27404 ## What this PR does / why we need it: Keep the strong pointer registry and make its explicit-Free ownership contract observable instead of relying on GC semantics that the registry intentionally prevents. - Account successful on-heap MPool allocations globally by live bytes, live objects, and high-water mark without changing off-heap admission or resource accounting. - Export live-byte and live-object Prometheus gauges, and include per-pool outstanding ownership plus optional allocation/free call sites in diagnostics. - Warn when a normal pool is deleted with outstanding on-heap ownership while preserving metadata for a valid late Free. Treat NoLock pool deletion as its terminal bulk-release boundary. - Document that every successful non-empty allocation must reach Free, except for NoLock allocations released by pool teardown. - Fix the test-only missing cleanup sites surfaced by the ownership audit. The hot path keeps only bounded global atomic accounting. Per-pool diagnostics scan the authoritative sharded registry at report/delete boundaries, avoiding per-allocation labels or unbounded diagnostic state. The added benchmark shows no allocation-count regression (one allocation per on-heap Alloc/Free cycle); exact-main comparisons showed roughly 7% median overhead for normal-pool 64 B and 1 KiB cycles, with noisier NoLock/large-object results. Validation: - full pkg/common/mpool, pkg/util/metric/v2, pkg/util/metric/mometric, and pkg/frontend tests - focused lifecycle, failed-allocation, cross-pool, double-free, and concurrent on/off-heap tests - race stress (100 repetitions) for lifecycle/teardown/concurrent accounting and metric refresh - full race tests for pkg/common/mpool and pkg/util/metric/mometric - build and vet for affected packages - high-risk ownership audit across vector, batch, reuse, publication, and frontend; no remaining outstanding-on-heap warnings --------- Co-authored-by: XuPeng-SH <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0
pushed a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Fixes matrixorigin#27404 ## What this PR does / why we need it: Keep the strong pointer registry and make its explicit-Free ownership contract observable instead of relying on GC semantics that the registry intentionally prevents. - Account successful on-heap MPool allocations globally by live bytes, live objects, and high-water mark without changing off-heap admission or resource accounting. - Export live-byte and live-object Prometheus gauges, and include per-pool outstanding ownership plus optional allocation/free call sites in diagnostics. - Warn when a normal pool is deleted with outstanding on-heap ownership while preserving metadata for a valid late Free. Treat NoLock pool deletion as its terminal bulk-release boundary. - Document that every successful non-empty allocation must reach Free, except for NoLock allocations released by pool teardown. - Fix the test-only missing cleanup sites surfaced by the ownership audit. The hot path keeps only bounded global atomic accounting. Per-pool diagnostics scan the authoritative sharded registry at report/delete boundaries, avoiding per-allocation labels or unbounded diagnostic state. The added benchmark shows no allocation-count regression (one allocation per on-heap Alloc/Free cycle); exact-main comparisons showed roughly 7% median overhead for normal-pool 64 B and 1 KiB cycles, with noisier NoLock/large-object results. Validation: - full pkg/common/mpool, pkg/util/metric/v2, pkg/util/metric/mometric, and pkg/frontend tests - focused lifecycle, failed-allocation, cross-pool, double-free, and concurrent on/off-heap tests - race stress (100 repetitions) for lifecycle/teardown/concurrent accounting and metric refresh - full race tests for pkg/common/mpool and pkg/util/metric/mometric - build and vet for affected packages - high-risk ownership audit across vector, batch, reuse, publication, and frontend; no remaining outstanding-on-heap warnings --------- Co-authored-by: XuPeng-SH <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #27404
What this PR does / why we need it:
Keep the strong pointer registry and make its explicit-Free ownership contract observable instead of relying on GC semantics that the registry intentionally prevents.
The hot path keeps only bounded global atomic accounting. Per-pool diagnostics scan the authoritative sharded registry at report/delete boundaries, avoiding per-allocation labels or unbounded diagnostic state. The added benchmark shows no allocation-count regression (one allocation per on-heap Alloc/Free cycle); exact-main comparisons showed roughly 7% median overhead for normal-pool 64 B and 1 KiB cycles, with noisier NoLock/large-object results.
Validation: