Skip to content

feat: enable local Sirius TPC-H benchmark - #27202

Merged
XuPeng-SH merged 14 commits into
matrixorigin:mainfrom
aunjgr:feature/sirius-local-cn-benchmark
Aug 18, 2026
Merged

XuPeng-SH merged 14 commits into
matrixorigin:mainfrom
aunjgr:feature/sirius-local-cn-benchmark

Conversation

@aunjgr

@aunjgr aunjgr commented Aug 16, 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:

Refs #26159

Parent issue: #26154

What this PR does / why we need it:

Enable the explicitly opt-in, one-to-one local CN/Sirius sidecar profile needed to run the remaining TPC-H end-to-end validation.

  • add cn.sirius.benchmark-no-gc and fail closed unless the launcher observed tn.GCCfg.disable-gc=true in every TN configuration it actually started;
  • provide a bounded process-local benchmark lease authority and audit recorder while preserving the durable, replayed lease requirement for normal Sirius deployments;
  • admit the explicit benchmark authority at the compiler and resolver boundaries without allowing ordinary non-durable managers;
  • validate the proof before command-mode or embedded CN startup allocates service resources;
  • preserve one-to-one CN/sidecar ownership with service-scoped runtime state and the existing exact mTLS SPKI authorization; and
  • document the standalone sidecar and single-CN TPC-H benchmark configuration.

This PR enables the benchmark runtime but does not close #26159: the live native-versus-Sirius Q1-Q22 differential and failure-injection run remains to be executed.

Test coverage

  • full package tests: pkg/sql/plan/substrait, pkg/cnservice, pkg/sql/compile, cmd/mo-service, and pkg/embed;
  • canonical Substrait export coverage for TPC-H Q1-Q22;
  • focused race tests repeated 100 times for benchmark proof, lease/protector lifecycle, resolver startup, and early startup rejection;
  • CGo-aware build and go vet for all affected packages; and
  • diff whitespace and forbidden-dependency checks.

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

Found one snapshot-safety blocker:

[P1] Do not accept a CN-local TN stanza as proof that the actual TN disabled GC

Config.verifySiriusBenchmarkNoGC currently uses benchmarkTNNoGC || c.getTNServiceConfig().GCCfg.DisableGC. The first term is launcher-owned proof, but the second is merely user-controlled TOML in the CN process. In the standalone mo-service -cfg <cn.toml> path, this process starts only the CN; it neither starts nor observes the remote TN. A CN file containing:

service-type = "CN"
[cn.sirius]
enabled = true
benchmark-no-gc = true
[tn.GCCfg]
disable-gc = true

has benchmarkTNNoGC == false, yet verifySiriusBenchmarkNoGC() returns nil. I reproduced this on the exact PR head with a focused startup test. The actual TN can still have GC enabled, while this admits the process-local lease manager and no-op protector; objects may then be collected while a Sirius read lease is live.

Please derive this proof only from a startup mode that owns/observes the exact TN lifecycle (for example the -launch manifest's parsed TN services, or a real runtime proof from TN/HAKeeper). A CN-only -cfg must fail closed instead of trusting a sibling [tn.GCCfg] section. The embedded path needs the same ownership guarantee. Please also update the documentation and add a negative test for this standalone bypass.

Validation on a977f9365b02658a93ef12b0d6f49224b16a6064: all changed-package tests passed; focused benchmark/startup/lifecycle tests passed under -race -count=20. The counterexample above fails because the current validation returns nil.

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

The benchmark admission still has a snapshot-safety blocker.

[P1] A CN-only process can self-assert that the remote TN disabled GC

Config.verifySiriusBenchmarkNoGC accepts c.benchmarkTNNoGC || c.getTNServiceConfig().GCCfg.DisableGC. Only the first value is launcher-owned proof. In the ordinary mo-service -cfg <cn.toml> path, the process starts a CN and does not own or observe the actual TN, but TOML decoding still accepts a sibling TN stanza:

service-type = "CN"
[cn.sirius]
enabled = true
benchmark-no-gc = true
[tn.GCCfg]
disable-gc = true

I reproduced this on the exact head: after decoding this config, benchmarkTNNoGC is false but cfg.verifySiriusBenchmarkNoGC() returns nil. The local lease manager/no-op protector is therefore admitted even if the actual TN continues GC, so objects can be reclaimed while Sirius holds a read lease. The documentation also explicitly instructs standalone CN users to rely on this unsafe sibling stanza.

Please accept the no-GC proof only from a startup mode that owns or observes the actual TN lifecycle. The -launch path's parsed TN configs can provide that proof; a CN-only -cfg must fail closed. Add a negative regression test for the configuration above and update the standalone documentation. Any embedded path must enforce the same ownership relationship rather than trusting unrelated user-configurable TN fields.

Validation on a977f9365b02658a93ef12b0d6f49224b16a6064: make thirdparties and make cgo passed. A focused counterexample test failed because validation returned nil, confirming the bypass.

@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 re-review of exact head 6387dd3.

The previous P1 manifest role-confusion blocker is closed. validateLaunchManifest parses and role-validates every static manifest list before any service starts, and each service-list starter independently fails closed as well. The launcher-owned no-GC proof now covers every TN that this static launch generation can start; standalone CN and embedded startup remain rejected without launcher proof.

I also re-audited the benchmark lease/protector, resolver identity binding, runtime publication/cleanup, configuration entry points, and failure paths. The process-local authority is explicit and bounded, normal Sirius still requires durable replayed leases, and I found no new blocking issue.

Fresh validation on this exact head: all tests passed for cmd/mo-service, pkg/cnservice, pkg/embed, pkg/sql/compile, and pkg/sql/plan/substrait; focused launcher/benchmark/resolver/runtime tests passed under -race -count=20; go vet and git diff --check passed.

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

mergify Bot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-08-18 11:11 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • ❌ Checks failed · in-place
  • 🚫 Left the queue — 2026-08-18 12:55 UTC · at 30dc8a81ef3a13b9fea10102e4ddc38a3db0c6ef

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

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 18, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-08-18 14:25 UTC · Rule: main · triggered by @aunjgr with the merge queue checkbox
  • 🟠 Checks running · in-place
  • 🚫 Left the queue — 2026-08-18 14:34 UTC · at d8c2ad50d7ff01aaab3244661a420a119cc7ef84

This pull request spent 8 minutes 39 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

The pull request can't be updated

This pull request seems to come 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, or update the branch manually.

Failing checks:

Hint

You should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue, 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

This branch was previously deployed

1 inactive deployment
ci — d8c2ad50 Deployed Aug 18, 2026 by mergify[bot] via Matrixone Utils CI / Coverage #46895
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/documentation Improvements or additions to documentation kind/enhancement kind/feature kind/test-ci size/L Denotes a PR that changes [500,999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Subtask]: Add compatibility and end-to-end coverage for Substrait offload

5 participants