Skip to content

fix: close HTTP trace and CI fixture ownership gaps - #30472

Merged
XuPeng-SH merged 6 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/ci-ut-systemic-20261017
Oct 17, 2026
Merged

XuPeng-SH merged 6 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/ci-ut-systemic-20261017

Conversation

@XuPeng-SH

@XuPeng-SH XuPeng-SH commented Oct 17, 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:

Fixes #30463
Fixes #30450
Fixes #30452

Related to #30453: corrects shared-fixture failure propagation and preserves the existing startup retry policy when a discovery deadline carries its diagnostic cause. The underlying discovery/I/O delay remains unclosed.

Related to #30454 and #30322: fixes inconsistent correlation-test cleanup budgets and cumulative branch-cleanup budgets. Production DROP/catalog latency is not claimed fixed.

Related to #30209: fixes a deterministic normal-stop publication/cancellation propagation skew with a failing old-code control; the exact historical CI interleaving was not reproduced.

Related to #30461: retain and validate the existing main deadline correction without duplicating it. #30204 already uses malformed ..invalid addresses in cmd/embed; no DNS fixture patch is added. #30309's original shell cancellation failure remains unproved; this PR does not claim to close it.

What this PR does / why we need it:

Ownership and failure boundaries

  • Create one HTTP trace at the existing transport wrapper for each marked object-storage HTTP request. Trace callbacks retain their own state after return; a trace-local mutex protects concurrent hooks. Remove premature pool return and cross-request hook composition. Lazy listing, retries, response bodies and multipart requests use the same ownership boundary. Missing or ambiguous timing pairs do not produce fabricated durations.
  • Keep failed shared-cluster initialization local to that generation. Reuse the existing reset owner only after affirmative rollback completion; incomplete cleanup or rollback panic keeps admission closed and the owner available for explicit recovery. Healthy initialized clusters still reuse the existing fixture.
  • Give Group/Window spill success fixtures bounded private ledgers instead of inheriting the host emergency disk-headroom limit. Operators sharing a Process explicitly share its generation. Finalizers check zero memory, spill bytes and FDs before closing; disk/FD rejection controls remain intact. Release old resources before replacing them with I/O-failure mocks.
  • Let independent metadata scenarios and cleanup statements own their deadlines. The correlation test uses one existing two-minute SQL operation policy for workload and teardown, replacing unrelated ten-/twenty-second cleanup assumptions. Each cleanup and absence verification has its own bounded context; failures retain the statement and elapsed time. Existing SQL/privilege assertions and the two-CN fixture remain intact.
  • Preserve the catalog-fence startup classifier's existing deadline policy when moerr.AttachCause appends the known refresh diagnostic. Every branch is still classified, so unrelated errors, rollback failures, unknown commits, cancellation and an inactive bootstrap owner cannot become successful admission. Global error representation, discovery, backoff and startup deadlines are unchanged.
  • Move the existing pipeline error classifier to its current process outcome owner and reuse it before HashBuild publishes dependency terminals. A normal ancestor stop publishes successful nil-map retirement before sibling cancellation arrives. Both the published build terminal and returned error retain the classified failure, so a later normal stop cannot erase an earlier independent cancellation; producer/query failure causes preserve their existing type and diagnostics. Query cancellation, independent/marked/mixed errors remain failures. Partial build resources stay owned by Reset/Free, without a false SendSucceed ownership transfer.

Validation

Linux/amd64, Go 1.27.1, matching CGo libraries, matrixone_test, bounded package/build parallelism:

  • Incremental gofmt, vet, repository molint and golangci-lint pass for the complete ten-package PR closure against merge-base d9cf2dd4e2; the final HashBuild correction reruns its owning package and compile consumer, reusing valid checks for the other eight unchanged packages.
  • Owning-package race tests pass for fileservice, process, hashbuild, compile, group, window, embed and sqlintegration. Group/Window retain the shared-generation, failure-admission and zero-resource cleanup oracles.
  • Normal-mode packages: fileservice, process, hashbuild, compile, group and window.
  • Original PR fix(parser): reject empty CTE bodies to avoid Format panic #30151 TestSQLFileAccessTenantStageCDC/file_TVF_and_Hive_planning_admission executes under the complete embed race run.
  • Issue [Bug]: Group/Window spill success fixtures depend on more than 16 GiB of free host disk #30450 negative/positive control: the same injected 8 GiB available-disk answer fails the original Group/Window fixtures and passes the corrected fixtures, including real disk/FD admission-failure oracles. No disk filling or production cap relaxation.
  • Exact issue29095 visibility matrix and issue29876 correlation roots pass under race. The updated correlation root, including database/publication/account absence checks, passes in 17.882s; cleanup virtual-time regressions pass without real sleeps. Existing two-CN join coordinator test passes, including remote execution, early LIMIT, empty inputs, parallel insert row counts and prepared reuse.
  • New callback/HashBuild regression roots each pass 100 race repetitions. Restoring the old HashBuild or shared-initializer implementation makes the respective new regression fail.
  • The final ten-scenario HashBuild retirement table covers raw failure before late stop on both outputs, producer/query cause substitution with stable error code/detail, mixed fatal errors, repeated Reset with one terminal/PASS, and failure-to-success reuse. Restoring the pre-fix finalizer fails the reverse-order and cause-substitution regressions; the fix passes 100 race repetitions. Final whole HashBuild/compile race packages pass (1.885s/11.419s) and normal packages pass (0.293s/9.036s). The existing real two-CN join coordinator root also passes under race at the final revision (12.827s owning-package runtime), including early-stop and empty-product cases.
  • Deterministic cleanup deadline tests cover 20s+20s independent successes and a 31s failure followed by a successful second cleanup using virtual time. Correlation cleanup additionally covers 15s/25s success after workload cancellation, failure beyond two minutes followed by successful independent cleanup, and remaining-resource/query-failure oracles.
  • Real WithTimeoutCause/AttachCause classifier and service.Start negative controls fail before the fix. Corrected tests cover wrapped/repeated diagnostics, same-text non-diagnostics, mixed errors, owner cancellation and successful admission. The complete cnservice race package passes (9.743s).
  • Current complete embed race package passes (631.333s), including all four real upgrade-recovery scenarios (82.99s), the original SQL/CDC trace path, and the new main checkpoint/GC/restart consumer. Startup regressions pass adaptive 24/100/100 race repetitions; complete cnservice and cleanup regression also pass normal mode.

Cost, compatibility and limits

A before/after object-wrapper microbenchmark using the same fake HTTP transport (three samples per path) measures median 1489 ns / 848 B / 8 allocations before versus 1859 ns / 1680 B / 22 allocations after for reused connections: about 370 ns, 832 B and 14 allocations extra per request. The cold-connection hook path measures 1860 ns / 848 B / 8 allocations before versus 2543 ns / 2128 B / 25 allocations after. These are synthetic wrapper/hook costs, not measured network or object-storage throughput. The HashBuild follow-up retains an already-computed failure result and adds no classification call or success-path work. The fix adds no response-body copy, wait for callback completion, persistent format, catalog, wire or configuration change.

No production timeout, new retry mechanism, skip or broad serialization is added. The correlation cleanup budget change is explicitly test-local and uses the existing two-minute SQL allowance; successful operations do not wait for that allowance. Four bounded catalog queries verify removal. This PR repairs the demonstrated startup classification defect, not the underlying discovery/I/O slowdown, production DROP latency or unproved shell cancellation incident. Local results do not imply the new remote CI has passed.

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

@mergify mergify Bot added kind/bug Something isn't working kind/test-ci labels Oct 17, 2026
@matrix-meow matrix-meow added the size/XL Denotes a PR that changes [1000, 1999] lines label Oct 17, 2026

@XuPeng-SH XuPeng-SH left a comment •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed head 0af5740. No actionable source findings.

The previous HashBuild error-classification finding is fixed: the normalized failure is now both returned and published, so a later normal stop cannot erase it. The regression covers reverse-order retirement and cause preservation; the prior implementation fails those assertions.

Local final validation receipts are all green, including normal/race hashbuild and compile tests, 100 retirement iterations, SCA checks, and the selected two-CN suite. Full remote CI was still pending at review time; required CI must pass before merge.

Copy link
Copy Markdown
Contributor Author

Post-merge Linux/amd64/Go1.27.1 CPU/CGo functional verification at b111224b0c624773389b390cd3cf1223126b6ee2 found incomplete Group fixture closure for #30450.

Full normal and race owning-package runs both fail on the same seven remaining Group roots (371 pass / 11 failed test events per mode), with automatic spill cap=1 below the unchanged host headroom threshold. Window passes 532 events in each mode; fileservice, process and HashBuild owning packages also pass normal/race (fileservice's external-credential skips remain explicit).

Only an overlay adding an explicit 1GiB proc.Base.Lim.SpillSize in those seven test Processes makes the unchanged selected assertions pass 11/11 in both normal/race. The missed paths obtain their generation directly, or pass a selected generation that bypasses the new helper's private-ledger branch.

#30450 was reopened with existing developer XuPeng-SH; exact roots, commands, errors, scope and diagnostic limits: #30450 (comment)

This is the existing fixture dependency remaining after a partial fix, not a new production regression or a reason to relax the production disk guard. Independent real MinIO external-object read/change-rejection also passes normal/race at this SHA; historical broad-CI flake claims are not substituted for these actual runs. Further SQL/recovery consumers are tracked separately in this audit.

Copy link
Copy Markdown
Contributor Author

补齐本轮当前 main 4226537e5094995155eab9c2a883db649ff7b95b 的功能验收记录:将磁盘可用采样独立配置为8GiB时,#30450 已报告的7个 Group 根仍失败,Window控制通过,exit1。不填盘、不修改生产阈值或弱化断言;属于既有夹具修复范围未闭环,不另报新生产回归。已在原 issue 更新:#30450 (comment) 。完整命名根/错误/overlay见 /workspace/work/pr-audit-continue18/logs/main-spill8g.log,保留开发,不转测。

@iamlinjunhong iamlinjunhong mentioned this pull request Nov 1, 2026
2 of 7 tasks
XuPeng-SH added a commit that referenced this pull request Nov 2, 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:

- #30414

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

Support query-level nprobe for IVF rank options, with query override
taking precedence over the session setting and existing fallback.
Propagate the value through planning to IVFFLAT and IVFPQ, and document
tuning, approximate search and GPU prerequisites. Invalid or unknown
rank options now return errors instead of being ignored.

The existing 4.2 AUTO behavior falls back to PRE on an empty result; a
nonempty short page does not trigger fallback. Approximate search can
therefore still return fewer rows or miss neighbors.

Validation: native libraries and service built on macOS arm64 CPU;
parser, planner and protobuf package tests, vet and incremental lint
passed. The rank-options SQL case passed twice (63/63 each), and the
vector directory passed with 1836 successful statements and two existing
ignored statements. The tester did not compare JDBC metadata. CI remains
pending. GPU search was not run, and the original high-dimensional data
and queries were unavailable; these results do not establish recall for
that dataset or arbitrary data.

Performance: option parsing and parameter selection add bounded
per-query work; increasing nprobe can increase search cost. Default
probe behavior is preserved.

Related main PR: #31753

CI repair: selectively backport the fileservice HTTP-trace lifetime fix
from #30472 while preserving the 4.2 interfaces. Each actual HTTP
request owns its trace, and concurrent callbacks synchronize timing
state. This removes the pooled-trace reset race observed in the file
TVF/Hive SQL test, including lazy List and multipart requests.

Repair validation on Linux/amd64, Go 1.26.4: complete fileservice normal
and race tests passed; four directly affected concurrency tests each
passed 100 race repetitions; the exact
`TestSQLFileAccessTenantStageCDC/file_TVF_and_Hive_planning_admission`
regression and its parent cleanup passed under race. Scoped vet and
golangci-lint passed. The in-memory RoundTrip benchmark measured 1.33 us
/ 368 B / 2 allocations unmarked and 3.44 us / 1,344 B / 22 allocations
traced. Fresh GitHub CI remains pending.

The subsequent UT failures were in initial statistics-test connection
setup (HAKeeper ID-allocation timeout before any statistics SQL) and
stale-index fixture cleanup. Both exact tests pass three race
repetitions (`-count=3`, not separate processes) at head `1038d07054`
and at clean 4.2-dev baseline `260678bace0`; their fixtures and native
inputs match. This is bounded attribution evidence, not proof that
HAKeeper availability is fixed.

The stale-index fixture now reports a failed DROP on the owning test and
checks catalog absence after successful cleanup, instead of silently
leaving a database for the next subcase. It retains the existing timeout
and semantic assertions. All four standalone DROP INDEX cells and both
stale-generation sibling tests pass under race with the new cleanup
checks; scoped vet/lint and independent Astra medium review pass. No
statistics timeout or reconnect workaround was added. New-head hosted CI
remains pending.

---------

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

This branch was previously deployed

1 inactive deployment
ci — a7b6b67c Deployed Oct 17, 2026 by XuPeng-SH
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 kind/test-ci size/XL Denotes a PR that changes [1000, 1999] lines

Projects

None yet

2 participants