Skip to content

test: reduce repeated planner and embedded cluster work in UT racing - #33634

Merged
XuPeng-SH merged 2 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/ut-racing-fixture-cost
Dec 2, 2026
Merged

XuPeng-SH merged 2 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/ut-racing-fixture-cost

Conversation

@XuPeng-SH

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • Test and CI

Why this change

Four successful UT Racing jobs targeting main showed repeated embedded cluster bootstrap and expensive planner setup. One job started 157 embedded clusters. The recurring costs included starting a race-instrumented process for each recursive CTE shape and creating a new catalog for SQL tests that use the same cluster configuration. UT Racing run 46765442646 · UT Racing run 46722755645

What changed

  • Run all 16 recursive CTE shapes and the same-context recovery sequence in one child with a stack limit and deadline. Each independent shape gets a fresh compiler context. Use the first generated column that exceeds the expansion budget for the historical catalog test, and retain both SELECT and UPDATE plan checks.
  • Reuse the existing embedded fixtures for compatible SQL, inventory CAS and multi-CN scenarios. Tests that restart services or change settings retain dedicated clusters. Exercise publication lock escalation with the smallest set of tenants that still proves the locked target and the unlocked gap. Remove a view rebuild immediately before dropping its tenant.
  • Halve the set-operation input while retaining assertions on physical owner placement, SQL results, remote failure, cancellation and recovery. Use a real 4,093-node CTE plan for the result-metadata allocation check. The 12-level benchmark remains available.

Measurements

Local paired runs used the race detector. Timings below apply to the named tests. The package groups run in parallel in CI, so measuring the full-lane gain requires a comparable runner.

Workload Base With this change
Recursive CTE and generated-column tests, three cases 71.5 s, 17 child processes 6.5 s, 1 child process
Integer result-column metadata 18.75 s 2.06 s
Five embedded tests 128.5 s, 5 cluster starts 69.2 s, 3 cluster starts
Full inventory CAS suite 9 starts, 1,363 relation-create events 7 starts, 1,025 events
Full multi-CN SQL integration package 11 starts, 1,871 relation-create events 9 starts, 1,533 events
Set membership owners, GOMAXPROCS=8 28.4 s, 8 owners 17.4 s, 8 owners

For the set-operation tests at CI's GOMAXPROCS=2, the owner and low-budget cases together took 44.4 s on base and 47.5 s with the change. Both exercised two owners and had the same four CPU-dependent subtest skips. The eight-owner run exercised all four witnesses. Catalog event counts measure setup operations. Physical disk bytes were not measured.

Validation

  • On the rebased head, all 22 targeted top-level tests across the seven changed packages passed with -race -short -tags matrixone_test -count=1.
  • The full multi-CN package and all six inventory CAS tests passed on both sides of the local comparison. Four embedded tests also passed three times against a reused cluster.
  • Forcing the planner to build the boolean-source graph in a local negative control made the result-metadata test fail at 5,182 allocations against its limit of 32.
  • Incremental SCA reported zero issues across the seven packages. A local attempt at all four CI SQL integration batches exceeded the workstation's memory capacity and hit baseline timeouts. It is excluded from the timing comparison.

The related change for 4.2-dev is tracked separately. 4.2-dev PR #33631

@XuPeng-SH
XuPeng-SH requested a review from aptend as a code owner December 2, 2026 01:32
@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 commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is merged.

@XuPeng-SH
XuPeng-SH merged commit f9d52a3 into matrixorigin:main Dec 2, 2026
20 of 22 checks passed
@XuPeng-SH
XuPeng-SH deleted the codex/ut-racing-fixture-cost branch December 2, 2026 01:34

This branch was successfully deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/test-ci size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants