Repository navigation
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? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
BLOCKING REVIEW — GitHub does not allow the PR author to submit REQUEST_CHANGES on their own PR. One correctness blocker remains. The new workload-policy path assumes at most one catalog row per (account_id, variable_name), but that invariant is not enforced: mo_mysql_compatibility_mode is keyed only by configuration_id, while doSetGlobalSystemVariable performs a transactional read-then-insert. Two sessions concurrently doing the first SET GLOBAL query_workload_policy can both observe no row and insert distinct auto-increment IDs. The initial cache load then picks one row by result order, and the periodic revalidation rejects the duplicate forever; later SETs update both rows and cannot heal it. This can make every query for the account fail after the refresh interval. Please make creation unique/atomic (or otherwise define and enforce one authoritative row), apply the same cardinality rule during initial load, and add a concurrent first-SET plus restart/refresh regression test.
LeftHandCold
left a comment
There was a problem hiding this comment.
Requesting changes for one production-reachable regression in the new LOAD routing path. When an account's load policy selects a non-ingress CN, LOAD DATA LOCAL INFILE is also materialized as a remote external-scan scope, but the uploaded byte stream exists only in the ingress process's in-memory pipe and is not part of remote ProcessInfo. The remote reader therefore cannot consume the client data and the ingress upload goroutine can block. Please preserve or fail explicitly at this ingress-only boundary and add a focused regression for a remote load policy plus LOAD DATA LOCAL.
aptend
left a comment
There was a problem hiding this comment.
Reviewed exact head f4aebae95e42a917173e734332a692516263def6. Two production-reachable correctness blockers remain.
P1 — Keep workload-routed scans local when the transaction workspace has writes
compileQuery derives AP/TP execution from GetExecType(..., c.getHaveDDL(), ...), so a transaction with prior DML but no DDL can still be classified as AP. evaluateQueryPlacement then permits a workload rule such as current_cn: excluded to select only remote workers; the only semantic current-CN override is for the IVF entries scan.
This breaks read-your-writes. For example: BEGIN; INSERT ...; followed by a sufficiently large SELECT can execute its table scan entirely on another CN. CNTxnSnapshot carries transaction metadata, locks, options, and flags, but not the ingress CN workspace. The remote pipeline creates a fresh workspace, and its RemoteDataSource strips the empty-block marker representing in-memory workspace data. The SELECT can therefore omit rows inserted earlier in the same transaction.
Please require the ingress/current CN whenever TxnOperator.GetWorkspace() is non-nil and not read-only (or reject a policy that excludes it), and add a regression covering prior in-memory INSERT + AP policy with current_cn: excluded + SELECT read-your-writes.
P1 — Preserve the ingress-only boundary for LOAD DATA LOCAL INFILE
The workload path routes every external source through constructWorkloadScopeForExternal, including LOAD DATA LOCAL INFILE, and marks it remote when the selected LOAD worker is not the ingress CN. However, the client-uploaded bytes exist only in the ingress process’s in-memory io.PipeReader; that reader is not serialized in remote ProcessInfo. The remote external reader therefore cannot consume the client stream, while the ingress upload writer can block waiting for a reader.
Please pin LOCAL INFILE execution to the ingress CN (or reject incompatible remote LOAD placement before starting the upload) and add a focused remote-load-policy regression.
|
已完成 latest-main rebase、全量 comment 复盘和提交前 deep self-review;PR 已 squash 到 exact head 4279bae,base 为 main@1c292cf20e113b296a3db2cb6a65e00af2ea2327。 历史 review closure:
最新两个 P1 的根因修复:
额外正确性 closure:remote DML 的 last_insert_id 通过已有 terminal JSON envelope 可选回传;旧 client 会忽略新字段,新 client 接收旧 server 的缺省零值,error path 不覆盖既有 session ID。LOCAL worker materialization 使用 canonical ingress route,避免同一 CN 的地址别名误变 RemoteRun。 性能 / unhappy-path:
最终验证:
请基于 4279bae 重新 review。当前唯一未 resolve 的 inline LOAD LOCAL thread 已由上述 ingress ownership boundary 和回归测试在代码层闭合。 |
Blocking product review — exact head 4279baeThis is an author-side blocking review. GitHub does not allow the PR author (the authenticated account here) to submit a formal REQUEST_CHANGES review on their own PR, so this comment is the authoritative “do not merge” decision and I am converting the PR back to Draft. I re-reviewed #25451 from the product contract backward, rather than treating the existing Phase 9 design as a requirement. The implementation has closed many real correctness issues, but the public model is still wrong. More patches to the current JSON will not fix that boundary. P0 — pool is not a real resource identityIn pkg/sql/schedule/workload_policy.go, a rule contains both PoolIdentity and Labels. The JSON requires both pool and labels, but ResolveWorkloadPolicy uses the labels to obtain workers while PoolIdentity is primarily intent/diagnostic identity. Consequences:
A stable product cannot promise execution on pool ap while actually selecting whatever CNs happen to match an independent label map. P0 — TP/AP is an unstable policy keyqueryWorkloadClass in pkg/sql/compile/scheduler.go maps the planner's ExecTypeTP and ExecTypeAP variants directly to public tp/ap policy buckets. GetExecType in pkg/sql/plan/stats.go derives those modes from statistics, block count, cost thresholds, prepared-versus-direct execution, index/plan shape, DDL state, and force-one-CN constraints. Therefore the same SQL can change target pools after ANALYZE, an index change, parameter/prepare differences, optimizer work, or an upgrade. TP/AP describes a current execution strategy; it is not durable business workload identity. Freezing it into an account policy makes placement and availability behavior unpredictable. P1 — the public JSON exposes unrelated internal responsibilitiesThe proposed account JSON combines:
These are not one product object. In particular:
The result is a low-level scheduler serialization format presented as a long-lived account API. P1 — too much compatibility machinery is being committed before the product object is definedThis PR adds a catalog table, account cache lifecycle, publication/reconciliation RPC, bootstrap upgrade gate, parser/DDL surface, metrics, and broad frontend integration across 75 files. Those mechanisms are expensive to change after release. The repeated correctness fixes were valuable, but they also show that we are hardening an API before agreeing what resource it controls and what users may rely on. What is valuable and should be kept or extractedThe following work is directionally sound and can survive a product re-scope:
These should be extracted only where they have an independent consumer or stable internal contract; do not retain catalog/RPC/cache machinery merely to preserve sunk work. Required re-scope before this can return to review
The product-first rationale and outcome-gated roadmap are recorded in #25451: |
|
Product-first rescope pushed in The previous workload-policy implementation is removed rather than patched around its unstable identity model. This PR is now the draft Milestone-A contract: canonical immutable compute-group identity, account/role authorization generations, authenticated Proxy handoff, ingress-vs-execution boundaries, transaction/local ownership, receiver-side RemoteRun fencing, lifecycle/rolling-upgrade semantics, and a normative acceptance matrix. CI root cause closure: the former Ubuntu UT failure in The independently confirmed |
|
Code fix pushed at Implemented only the independently closed execution-safety slice:
I removed the partial self-reported compute-group metadata/resolver/RemoteRun scaffold instead of pushing an unauthenticated or incomplete protocol. The Draft RFC remains the authority for that later Milestone-B work. Validation passed: full schedule/compile and frontend packages, the exact issue-25782 regression, focused race x20, formatting/diff checks, and an independent blocker-only review (APPROVE). |
|
Force-pushed the latest-main rebase at The re-review pass fixed the remaining ingress-owned execution gaps: exact-ID candidate priority independent of discovery order, rejection of same-address/different-ID aliases, canonical local address materialization, cancellation before the LOCAL fast return, no LOCAL pipe before compile acceptance, and joined cleanup on both success and runner failure. The outdated LOAD DATA LOCAL review thread is now closed by code and regression coverage. Local validation passed for full The PR intentionally remains Draft because it defines—but does not claim to implement—the Milestone-B compute-group authorization/generation/RemoteRun contract. |
|
Deep-review update pushed at This pass closes three additional code blockers: runner-panic upload ownership is now joined before statement cleanup, authoritative Draining ingress state can no longer be re-added by local fallback, and IVF ingress proof now uses the same ID-first hard constraint/canonical route as writable workspaces. Each new regression fails under the unfixed semantics and passes after the change. The RFC/matrix also now close authority-liveness renewal versus membership-generation churn, ticket claimant/restart ownership, unclaimed-route drain behavior, receiver incarnation/replay handling, prepared reauthorization, and multi-hop A -> B -> C grant propagation. Local full tests/race for frontend, schedule, and compile; focused race x100; build; vet; Issue #25782; and allocation benchmarks pass. Title and body have been rewritten to state the exact scope. The PR remains Draft because this is the Milestone-A contract plus legacy correctness fixes, not a claim that Milestone B is implemented. |
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? |
gouhongshen
left a comment
There was a problem hiding this comment.
Codex automated review
Prior blockers remain fixed, including dirty-workspace routing, LOAD DATA LOCAL ownership, canonical local routing, draining handling, and cleanup paths. One new blocker remains: required ingress can be re-added by empty-worker fallback when only a draining same-address alias with a different service ID is resolved.
P1 - Do not re-add required ingress after resolved aliases are ineligible (pkg/sql/schedule/placement.go:350)
With RequireCurrentCN, a resolved candidate {ID: "stale", Addr: current.Addr, State: Draining} does not match ingress {ID: "current", Addr: current.Addr} because ID-first matching rejects non-empty ID aliases. Eligibility then drops the draining alias. Since resolvedCurrentStateChecked is already true, this branch skips another rejection and ensureCurrentWorker re-adds the ingress, returning satisfied placement. The query therefore runs on an ingress identity absent from the resolved pool and bypasses the draining state. Required-ingress placement must fail closed when an authoritative resolved snapshot cannot prove ingress membership; add a mismatched-ID draining/drained regression.
|
Addressed the latest P1 in The fix makes the ingress-ownership invariant independent of post-filter worker count: whenever
The ordering remains fail-closed and diagnostic: an exact ingress candidate that is Draining/Drained is still rejected with its current-CN state reason before membership proof, while a genuinely unresolved legacy request still retains local fallback. Added regressions for mismatched-ID same-address Draining and Drained aliases, authoritative empty resolution, and the unresolved fallback control. Local verification:
Please re-review the new head. |
gouhongshen
left a comment
There was a problem hiding this comment.
Codex automated review
上一轮唯一阻塞项(权威解析仅剩不同 ID 的 draining/drained 地址别名时,required ingress 被 fallback 重新加入)已在 5b4fbbc 修复,并有回归覆盖;未解析的 legacy fallback 属于明确兼容契约。此前 dirty-workspace、LOAD DATA LOCAL、canonical route、drain/cleanup/IVF 问题已修复;旧 workload-policy 控制面问题已随 rescope 移除。当前无 blocking 或 non-blocking finding。
aptend
left a comment
There was a problem hiding this comment.
Re-reviewed exact head 5b4fbbc43c00b1fb9aa0dbdebbaf1efeab8c9bab after the RFC rescope and all ingress-owned execution fixes. My prior writable-workspace and LOAD DATA LOCAL blockers are closed: AP multi-CN writable workspaces require authoritative ingress membership and retain the local all-data partition; LOCAL is ingress-only, rejects incompatible strict placement before pipe creation, and the accepted path owns/closes/joins/clears the reader and upload producer across success, runner error, cancellation, and panic. IVF entries use the same service-ID-first proof and canonical in-process route.
The latest fix also closes the remaining fallback edge: any authoritative resolved pool—including empty or fully filtered results—must positively contain the exact ingress identity; a same-address/different-ID draining or drained alias can no longer be converted into local execution. Conflicting exact ingress states fail closed independent of order, while the explicitly unresolved legacy fallback remains distinct. The RFC and normative matrix clearly mark Milestone B implementation gates as unimplemented and specify immutable identity, authorization, generation/drain/replay fences, and Q1-Q3 bounds. Focused schedule regressions pass under -race -count=10; exact-head UT, SCA, coverage, and both BVT jobs are green. No blocker found.
iamlinjunhong
left a comment
There was a problem hiding this comment.
Reviewed exact head 5b4fbbc43c00b1fb9aa0dbdebbaf1efeab8c9bab against refreshed origin/main@263567cf1a56da904788bc6d1d613ff19cb44783 (merge-base e0a66b63ec87762167eec73fbc8590a269e05de3). The new main commit touches only planner charset compatibility and does not overlap this PR.
My prior two P1 integration findings are closed: the author explicitly replied, then the product rescope removed the workload-policy proto/bootstrap/catalog control plane entirely. I re-read the complete 9-file diff, the scheduling/materialization callers, workspace Readonly contract, IVF local-partition path, and the LOAD DATA LOCAL pipe lifecycle. Authoritative empty/aliased/ineligible pools now fail closed for ingress-owned execution; accepted LOCAL execution creates the pipe only after compile and closes, joins, and clears it on success, runner error, panic, and cancellation. I found no remaining P0/P1/P2/P3 issue.
Fresh local evidence: all 13 added schedule regressions passed; pkg/sql/schedule build/vet passed; four representative identity/state counterexamples passed -race -count=100; the full schedule package passed once under race. Focused compile/frontend execution was unavailable locally because the isolated worktree has no cgo/libmo.dylib; exact-head GitHub checks are all completed with no failing conclusion (UT, SCA, coverage, and BVT included).
aunjgr
left a comment
There was a problem hiding this comment.
Reviewed exact head . Ingress-owned execution now fails closed against authoritative empty, aliased, or ineligible pools; writable workspaces retain the local partition, IVF routing canonicalizes the exact service identity, and creates its pipe only after accepted placement and joins/clears the producer on success, error, cancellation, and panic. The RFC keeps the unimplemented compute-group milestone explicitly separated from these scheduler fixes. The full schedule package plus focused compile/frontend lifecycle regressions pass locally, and all required checks are green. No blocker found.
aunjgr
left a comment
There was a problem hiding this comment.
Corrected review summary for exact head 5b4fbbc43c00b1fb9aa0dbdebbaf1efeab8c9bab: ingress-owned execution fails closed against authoritative empty, aliased, or ineligible pools; writable workspaces retain the local partition; IVF routing canonicalizes exact service identity; and LOAD DATA LOCAL creates its pipe only after accepted placement and joins and clears the producer on every exit. The RFC keeps the unimplemented compute-group milestone separate from these fixes. The full schedule package plus focused compile and frontend lifecycle regressions pass locally, and all required checks are green. No blocker found.
|
Tick the box to add this pull request to the merge queue (same as
|
What type of PR is this?
Which issue(s) this PR fixes
Related to #25451. This does not close the canonical compute-group implementation gate.
Outcome and scope
Rebased on
mainat0b195e4f5a23c06a40552a8db3e7fdf182979a3a.Latest repair:
6a96463a66.This PR separates a draft canonical compute-group RFC/acceptance matrix from
independently useful legacy ingress-scheduling and LOCAL-upload correctness
fixes. It does not implement compute-group identity, authorization, admission,
or the future distributed drain protocol. The rejected workload-policy
DDL/catalog/RPC/cache and raw-label product model remain removed. RFC owner
approval and Milestone-B implementation/validation remain separate gates.
Implementation
ingress-only and is allocated only after successful compile/placement.
invariant; no resurrection of the removed IVF-only function-scan IR.
address. Authoritative empty/excluded/draining pools fail closed rather than
manufacturing local membership.
cancel interrupts both pipe and network I/O; cleanup joins the watcher and
producer before freeing buffers or reusing session/ExecCtx state.
retries cannot reconstruct a partially consumed frame, and successful packets
previously reset the error budget indefinitely.
panics cancel the producer before joining; its duplicate watcher is removed.
its client connection; clients must reconnect. Successful EOF retains normal
connection reuse. No successful-upload size cap or per-row cache is added.
RFC correction
DrainRequested publication is not a distributed claim barrier. The authority
must collect generation/incarnation-fenced receiver seals, serialized against
local/remote claim admission, before publishing effective Draining. A stale
Ready cache and valid lease cannot bypass an acknowledged seal. Missing acks
produce bounded pending/failure responses and retain DrainRequested, not false
success. Lease expiry alone cannot stand in for an acknowledgement; permanently
lost participants require a separately reviewed execution-fencing protocol.
This explicitly trades drain availability for a clock-independent safety rule.
Test plan
Automated regression and static checks
./pkg/frontendnormal: 25.795s; full race: 41.427s.idle read, partial header/body, blocked pipe, pipe failure, disconnect, EOF,
next-command reuse after late cancel, and allocator balance.
for client EOF, with exactly-once disconnect/free assertions.
-race -count=100run; final focusedrace also includes the added allocator-balance assertions. No repeated full
package stress.
go vetvia controlled CGo wrapper-vet=all -run '^$'; ordinary packageexecution evidence is recorded separately above.
gofmt,git diff --check,and Python AST parsing pass.
TestScheduleQueryWorkers, and placement A/B benchmarks against the same main.fanout tests fail identically on clean main
0b195e4f5awith matched nativeinputs. They are not attributed to this PR and are not hidden/skipped.
Real service: 10.222.1.55, two CNs
b076571701a5ae6b38733d22f5e23e4527fcdf90b5bdb6a312441c3a8750d6b4.read-your-writes, peer isolation and rollback; normal LOCAL result and
subsequent command on the same connection.
incomplete body and continuing packet sender; server closes connection and
aborted LOAD leaves no rows. UDF import cancellation publishes no function.
database teardown. Service was stopped afterward; no local mo-service started.
SetForceScanOnMultiCN(true)only after SQL/ISCP readiness; the LOAD/transaction witness passes twice with
the same tiny data. This is injection evidence, not normal performance.
Temporary injection code is removed and is not in the commit.
failed required-ingress placement. That run is excluded, its data quarantined,
and the successful gated injection used a fresh data directory.
QA reproduction is committed under
optools/testdata/load_local_lifecycle/README.mdandvalidate.py.Use only a disposable test-owned two-CN instance, never shared/production data.
Retained run logs:
/mnt/nvme/xupeng/pr26109-validation.TZpKhgon 55.Performance and limitations
Placement allocation profile is unchanged from clean main: all-workers
10192 B/op, 7 allocs/op; max-workers11600 B/op, 9 allocs/op. Three shortsamples showed no obvious latency regression, but do not establish a <=2%
p50/p95 or end-to-end SQL performance gate. LOCAL repair removes failure-path
work and a redundant UDF watcher, without changing normal per-packet payload
allocation. Future compute-group benchmarks/acceptance remain unclaimed.
CI is not awaited as part of this delivery. The separate generate_series offset
defect remains tracked by #27069.