Skip to content

fix(mpool): avoid coverage crash in realloc failure test - #28467

Merged
XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
iamlinjunhong:m-28451
Sep 9, 2026
Merged

XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
iamlinjunhong:m-28451

Conversation

@iamlinjunhong

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 #28451

What this PR does / why we need it:

fix(mpool): avoid coverage crash in realloc failure test

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

Reviewed exact head ab6165a, the complete single-file diff, the child-process test harness, MPoolStats.RecordAlloc, MPool.ReallocZero and SimpleCAllocator's mmap replacement/error path. No confirmed blocker.

Changing the requested replacement from 1 GiB to 512 MiB preserves the intended physical-allocation failure: it still exceeds the test's current-address-space + 64 MiB RLIMIT_AS allowance, remains on the mmap destination path for both original allocation sizes, and remains below the statistics 1 GiB high-watermark logging boundary implicated by #28451. This avoids unrelated logger allocation while the process is constrained without replacing the real OS failure with a mocked/capacity-rejection path. The test still requires the specific physical-allocator rejection, a nil replacement, restored header/lease, unchanged old-buffer contents and global/profile/pool accounting, followed by zero account usage and registry metadata after freeing. Accounted and unaccounted cases and both original sizes remain intact.

The resource limit remains isolated to an exact-test subprocess with a 30-second test timeout; it is restored before assertions/ordinary test work. No production behavior, test skip, failure assertion or cleanup was removed. This is focused test maintenance and does not trigger a feature/major-refactor design gate.

Exact-head CI run 34306143038 reports success for the relevant Linux UT Coverage job, ordinary Linux UT and SCA. I did not independently execute this Linux-specific RLIMIT_AS test on the macOS review host; the source proof and exact-head coverage result are the validation evidence used here.

@mergify mergify Bot added the queued label Sep 9, 2026
@mergify

mergify Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-09-09 05:31 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • 🟠 Checks running · in-place
  • 🚫 Left the queue — 2026-09-09 05:34 UTC · at 8790d5f07d93ca63e9b7a195db596be71b30746d

This pull request spent 3 minutes 21 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
  • any of: [🛡 GitHub branch protection]
    • check-neutral = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-skipped = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-success = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
  • any of: [🛡 GitHub branch protection]
    • check-neutral = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)
    • check-skipped = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)
    • check-success = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)
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
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-skipped = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-success = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)
    • check-skipped = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)
    • check-success = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • github-review-approved [🛡 GitHub branch protection]

Reason

Pull request #28467 has been dequeued

Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.

The author needs to enable "Allow edits from maintainers" on this pull request.

Hint

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.
If you do update this pull request, 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.

Tick the box to put this pull request back in the merge queue (same as @mergifyio queue).

  • Requeue this pull request

VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…n#28467)

## What type of PR is this?

- [ ] API-change
- [ ] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [ ] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

issue matrixorigin#28451

## What this PR does / why we need it:

fix(mpool): avoid coverage crash in realloc failure test

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
…n#28467)

## What type of PR is this?

- [ ] API-change
- [ ] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [ ] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

issue matrixorigin#28451

## What this PR does / why we need it:

fix(mpool): avoid coverage crash in realloc failure test

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
…n#28467)

## What type of PR is this?

- [ ] API-change
- [ ] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [ ] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

issue matrixorigin#28451

## What this PR does / why we need it:

fix(mpool): avoid coverage crash in realloc failure test

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
iamlinjunhong added a commit to iamlinjunhong/matrixone that referenced this pull request Nov 13, 2026
Carry the unordered spill reset assertion from matrixorigin#32439 and the coverage-safe RLIMIT target from matrixorigin#28467. Capture the increment service installed by the fixture process, and adapt first-replay setup to the target embed API with TCP-only SQL transport. Production backports remain unchanged.
XuPeng-SH added a commit that referenced this pull request Nov 13, 2026
## What type of PR is this?

- [ ] API-change
- [x] BUG
- [x] Improvement
- [ ] Documentation
- [ ] Feature
- [ ] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

Related to #32146.

## What this PR does / why we need it:

Backport the large-variable-length write memory fixes and their
lifecycle dependencies to `v4.2.8-hotfix`. A 196,092-row fixture with
very large JSON/text values completes its batched UPDATE on 4.2.8 but
OOM-kills a 20-GiB CN during the subsequent VARCHAR-to-INT COPY ALTER.
The backports bound CN spill runs and pooled writer retention while
preserving buffer/object ownership through completion, cancellation, and
failure.

Cherry-picked with source provenance, in order: #32081, #32155, #32332,
#32164, #32398, #32454, and #32065. The target branch's existing #32704
is retained. There are no manual production-code changes to the seven
backports.

Validation on head `cc1d6c51a156e232182030b093bbf9bfc1ae95c1`:

- Fresh native build succeeds with actual-head version/commit metadata.
Formatting and `git diff --check` pass. All seven commits have identical
added/removed lines and paths to their source commits; only #32155 has
documentation-only unchanged-context differences.
- Actual-head full-data run PASS: 196,092 rows, 147,941 converted rows;
PK/row count, payload byte lengths and CRC sums, final statuses, and INT
type verified. All roles report `OOMKilled=false`.
- CN limit and total memory+swap are both 20 GiB, 6 CPUs, GOMEMLIMIT 1
GiB, cache 2 GiB. Sampled CN RSS peak: **12.4115 GiB** (2-second
sampling). Sampled cgroup usage peak: 19.7955 GiB; kernel cgroup
high-water reached 20 GiB, with zero failcnt/OOM. RSS is not total
container memory, so this does not imply 7.6 GiB of container headroom.
- Driver start through final verification: **431.90 s (7m12s)**,
including token UPDATE **221.59 s**, token COPY ALTER **200.84 s**, and
remaining validation/setup. Service startup and cold-backup restore are
excluded.
- Native-toolchain scoped regressions pass: nine owning packages (2,302
tests/subtests); compile import/cancellation selector (153); focused
race checks across mpool, rscthrottler, objectio and ioutil (93). Runs
use `-count=1`, the repository CGo test wrapper, and default vet checks.
No failures; task services are stopped. Full-repository CI/review is not
part of this local validation, and further GitHub results are not
awaited.

The workload measures the MOI offset212 token-table migration, with
placeholder companion tables, rather than all MOI deployment phases.
Logical restore uses a shared DISK backend and changes the original
physical object layout; customer data and raw logs are not included in
this PR. Single-run timings are not a statistical performance benchmark.


Revision `b6b9f3ba40d7bb9e598b2a8846b7ed166b4a48b7` (test-only
follow-up):

- Carries #32439's unordered two-observation reset assertion and
#28467's 512-MiB RLIMIT target; closes the actual fixture-owned
increment service; adapts first-replay setup to this release's embed API
and TCP SQL transport. Production changes in the seven backports remain
identical to their sources.
- New local validation (Darwin/arm64, Go 1.27.1, CGo wrapper,
`-count=1`): owning production packages build; all four changed test
packages vet; `objectio/ioutil` full coverage and race pass; `mpool`
coverage passes; `sql/compile` full normal and race pass with
`TMPDIR=/private/tmp`; first-replay
startup/disconnect/reconnect/prepared SQL passes normal and race.
Spill-reset and fixture-ownership tests each pass `-race -count=100`.
Formatting, diff whitespace, and delivery artifact checks pass.
- Run 43449877707 attempt 1 failed SCA job 131969091882 (`make
static-check-analysis`) on missing `embed.WithDataPath`; coverage job
131969165708 reports that build error, RLIMIT runtime allocation
failure, and the fixture closure assertion. These backported test
defects are addressed here; the old run is not rerun because the push
triggers fresh CI. Pinned molint rebuilt for the local Go version exits
zero but emits inherited analyzer diagnostics; this is not a
zero-diagnostic SCA claim.
- Local Parquet fanout failures also reproduce in an unmodified archive
of target base `b572b5cd95a25d404cd0f0df32629b39c6fff120`; full PR
compile normal/race pass with a short temporary root. No Parquet
code/test is changed. Linux-only RLIMIT execution is reused from
#28467's upstream coverage/race evidence; not executed on this Darwin
host. Original migration and other upstream validation above retain
their stated revisions/configurations; the customer-data migration was
not repeated for these test changes. New CI is not awaited. Raw local
logs remain outside the source tree.

---------

Co-authored-by: aptend <[email protected]>
Co-authored-by: XuPeng-SH <[email protected]>
Co-authored-by: GreatRiver <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: 和光同尘 <[email protected]>
Co-authored-by: jiangxinmeng1 <[email protected]>
XuPeng-SH added a commit that referenced this pull request Nov 20, 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:

Refs #32744

## What this PR does / why we need it:

The Linux physical-reallocation failure test can abort the Go runtime
under its process-local address-space limit. The 1 GiB target crosses
the mpool high-watermark logging threshold before the allocator runs,
and logging or GC can exhaust the 64 MiB headroom.

Backport the 512 MiB target from #28467 and use the 256 MiB headroom
already used on main. The target remains larger than the available
address space and the existing assertions still require a physical
allocator rejection and verify ownership, accounting, profiling and
contents for both source sizes and allocation paths.

If the allocator unexpectedly succeeds, retain the returned allocation
for cleanup so the original assertion remains visible.

Validation:
- Linux/arm64, Go 1.26.4: focused test passed 20 times with coverage and
5 times with coverage across MatrixOne packages.
- Full mpool package passed with coverage and with the race detector.
Incremental go vet, gofmt, and git diff --check passed.
- An emulated amd64 container did not enforce the guest mapping limit,
so native Linux/x86 CI is needed to validate the target runner. The
emulator run did verify the unexpected-success cleanup path.
- The larger process address-space headroom reduces runtime allocation
pressure and remains finite.

Co-authored-by: iamlinjunhong <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

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

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