Repository navigation
refactor(schedule): expose bounded statement scheduling trace - #25581
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? |
51c1de7 to
058b022
Compare
LeftHandCold
left a comment
There was a problem hiding this comment.
当前 head aeb2b92d41 仍有 merge blocker,提交 REQUEST_CHANGES。
-
已有的默认 EXPLAIN 兼容性问题尚未修复:普通
EXPLAIN、EXPLAIN ANALYZE、EXPLAIN PHYPLAN仍无条件追加包含动态 CN 信息的 scheduling 块,且没有对应test/distributedgolden 变更。当前 CI 的 Compose optimistic/pessimistic、Standalone optimistic/pessimistic/proxy 共 5 条 BVT 均失败。请优先改为显式 option/session 开关;若产品决定修改默认输出,则必须完成动态值归一化、兼容性决策和全部 BVT 更新。 -
新增 inline blocker:短 TP/AP-one-CN 明知最终不会持久化,仍无条件 record + Snapshot + Clone scheduling trace。当前实现的等价 microbenchmark 是
1232 B/op, 8 allocs/op,会给所有本地短语句增加 GC 压力。请增加 normal-local 的低/零分配 fast path 和 allocation 回归覆盖。
已确认上一轮的两个问题在本 head 上有实质修复:持久化 trace 不再包含 pipeline address,pool/candidate 迭代也增加了 cancellation check。
本地验证:
git diff --check通过go test -race -count=1 ./pkg/sql/schedule ./pkg/clusterservice ./pkg/vm/engine/disttae/route通过- 按仓库 CGo 配置,
pkg/sql/compile、pkg/frontend、pkg/vm/engine/disttae、pkg/vm/engine/memoryengine、pkg/util/trace/impl/motrace全包测试通过 - 相关
go vet通过
|
已更新到
新增 session 变量
重新沿完整调用链核对后,正常复用路径是:
该路径不会再次调用 已新增连续 10 次 prepared reuse 的回归测试:每次 fresh recorder 都只有 1 个 reused-placement attempt;模拟 retry 后才出现第 2 个 retry-placement attempt,并在代码中补充该生命周期契约说明。 验证通过:
|
|
@LeftHandCold 逐项回复最新 review:
|
XuPeng-SH
left a comment
There was a problem hiding this comment.
Reviewed latest head 77baac8bca across scheduling semantics, candidate discovery/pool resolution compatibility, current-CN routing, prepared/retry lifecycle, bounded trace ownership and persistence, EXPLAIN opt-in behavior, cancellation, concurrency, resource bounds, and hot-path allocation.
No blocking correctness, robustness, leak/hang/OOM, compatibility, or performance issue found. The feature patch after merging current main is content-equivalent to the previously reviewed patch; only a hunk line offset changed in pkg/sql/compile/compile.go.
Local verification passed:
go test -race -count=1 ./pkg/sql/schedule ./pkg/clusterservice ./pkg/vm/engine/disttae/routego test -count=1 ./pkg/sql/compile ./pkg/frontendgo veton all affected production packagesgit diff --checkBenchmarkTraceRecorderNormalLocalExport: 0 B/op, 0 allocs/op (46-56 ns/op locally)
The new GitHub Actions run for the merge commit is still in progress. This is a COMMENT review because the authenticated account is also the PR author and GitHub does not permit self-approval.
gouhongshen
left a comment
There was a problem hiding this comment.
Reviewed latest head 77baac8bca.
No blocking issue found.
- Default
EXPLAINremains stable; scheduling preview is explicit opt-in. - Candidate discovery/pool resolution share a snapshot and propagate cancellation through routing loops.
- Persisted trace avoids pipeline-address exposure; normal local export remains allocation-free.
- Prepared-statement reuse and retry attempt lifecycles have regression coverage.
Verified locally: go test -count=1 ./pkg/sql/schedule ./pkg/clusterservice ./pkg/vm/engine/disttae/route. Latest CI, including Standalone/Compose BVT and upgrade compatibility, is green. Local pkg/sql/compile and pkg/frontend builds are blocked only by missing usearch.h, roaring.h, and xxhash.h; their PR CI checks passed.
What type of PR is this?
Which issue(s) this PR fixes:
issue #25451
What this PR does / why we need it:
Separates AP multi-CN scheduling into explicit candidate discovery, tenant/label pool resolution, and pure worker placement. The new engine capability preserves the legacy
Engine.Nodespath for engines that have not adopted both provider interfaces.Adds a bounded, ownership-safe per-statement scheduling trace:
EXPLAIN.The change keeps discovery cancellation-aware, carries one cluster snapshot through current-CN state and pool resolution, validates selected worker routes, and bounds trace/EXPLAIN memory and output.
Verification
go test -count=1 ./pkg/sql/schedule ./pkg/clusterservice ./pkg/vm/engine/disttae/route-mod=mod:pkg/sql/compile,pkg/frontend,pkg/vm/engine/disttae,pkg/vm/engine/memoryengine, andpkg/util/trace/impl/motrace-racecoverage for schedule/compile/frontend/clusterservice/route.go vet -mod=mod -tags matrixone_testacross affected packages.