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? |
|
Deep self-review at exact head The one-line cursor advance closes the relevant invariant: each generated parallel offset is assigned to exactly one per-CN-derived scope. The second scope now receives the next slice, while Validation:
The existing local-address placement and non-unit/descending-step partition behavior are independent pre-existing concerns outside this cursor-fix diff; this change neither introduces nor expands them. GitHub does not allow |
…-owned scheduling (#26109) ## What type of PR is this? - [ ] API-change - [x] BUG - [x] Improvement - [x] Documentation - [ ] Feature - [x] Test and CI - [x] Code Refactoring ## Which issue(s) this PR fixes Related to #25451. This does **not** close the canonical compute-group implementation gate. ## Outcome and scope Rebased on `main` at `0b195e4f5a23c06a40552a8db3e7fdf182979a3a`. 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 - Writable AP workspaces retain ingress participation. LOCAL input is ingress-only and is allocated only after successful compile/placement. - General vector-index scan IR from current main retains the ingress/ordinal invariant; no resurrection of the removed IVF-only function-scan IR. - Exact service ID wins over aliases; local routes use the real ingress address. Authoritative empty/excluded/draining pools fail closed rather than manufacturing local membership. - Interrupted LOCAL upload now terminates at the **network protocol boundary**: cancel interrupts both pipe and network I/O; cleanup joins the watcher and producer before freeing buffers or reusing session/ExecCtx state. - Removed unbounded discard-to-EOF and consecutive-error retries. Packet retries cannot reconstruct a partially consumed frame, and successful packets previously reset the error budget indefinitely. - UDF file import shares the same repaired lifecycle. Storage write errors and panics cancel the producer before joining; its duplicate watcher is removed. - Compatibility tradeoff: a failed/canceled upload before protocol EOF closes 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 - [x] Full `./pkg/frontend` normal: 25.795s; full race: 41.427s. - [x] Focused protocol tests: pre-cancel, invalid config, blocked request write, idle read, partial header/body, blocked pipe, pipe failure, disconnect, EOF, next-command reuse after late cancel, and allocator balance. - [x] Runner error/panic and UDF storage error/panic prove cleanup does not wait for client EOF, with exactly-once disconnect/free assertions. - [x] Each lifecycle test received its own `-race -count=100` run; final focused race also includes the added allocator-balance assertions. No repeated full package stress. - [x] `go vet` via controlled CGo wrapper `-vet=all -run '^$'`; ordinary package execution evidence is recorded separately above. `gofmt`, `git diff --check`, and Python AST parsing pass. - [x] Reuse unchanged rebase evidence: schedule full suite, compile focused `TestScheduleQueryWorkers`, and placement A/B benchmarks against the same main. - [ ] Full compile suite is **not green** in this environment: five Parquet fanout tests fail identically on clean main `0b195e4f5a` with matched native inputs. They are not attributed to this PR and are not hidden/skipped. ### Real service: 10.222.1.55, two CNs - [x] Final normal binary SHA-256: `b076571701a5ae6b38733d22f5e23e4527fcdf90b5bdb6a312441c3a8750d6b4`. - [x] On both ingress ports: two committed rows plus one uncommitted row; read-your-writes, peer isolation and rollback; normal LOCAL result and subsequent command on the same connection. - [x] KILL QUERY with **no upload EOF**: idle client, incomplete header, incomplete body and continuing packet sender; server closes connection and aborted LOAD leaves no rows. UDF import cancellation publishes no function. - [x] Final normal witness passes twice on the same instance; each run verifies database teardown. Service was stopped afterward; no local mo-service started. - [x] Separate white-box build enables existing `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. - [x] An initial always-on injection interfered with bootstrap discovery and 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.md` and `validate.py`. Use only a disposable test-owned two-CN instance, never shared/production data. Retained run logs: `/mnt/nvme/xupeng/pr26109-validation.TZpKhg` on 55. ### Performance and limitations Placement allocation profile is unchanged from clean main: all-workers `10192 B/op, 7 allocs/op`; max-workers `11600 B/op, 9 allocs/op`. Three short samples 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.
What this fixes
compileGenerateSeriesParallelassigned every CN from the first offset segment because the shared offset cursor never advanced. With two CNs this duplicated the first segment and omitted later values.Change
This correctness fix was isolated while rescoping #26109; it is independent of the rejected workload-policy model.
Validation
-race -count=50): PASS./pkg/sql/compile: PASS./pkg/sql/compileunder race: PASSgo build ./pkg/sql/compile: PASSgo vet ./pkg/sql/compile: PASSThe multi-CN SQL regression is included for CI execution.