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.
Reviewed exact head 812aeaa2b7d6077be7a0f478323d7fdeb5c9efb4 against merge-base 43c37847b16d37cfa8b9eef4235ba4388b5e25ce. No subagents, no product edits, no CI wait.
Decision: no verified merge-blocking finding in this review. This is a self-authored PR, so this COMMENT is not an independent APPROVE.
Design/ownership: the fix restores the existing distinction between an execution failure, external query cancellation and successful fragment Stop. Scope/Compile still own outcome arbitration; immutable JoinMap snapshots own published errors; the existing generation-specific registration/terminal and cancel registry own remote settlement. There is no second state machine, retained outcome cache, persistence format or wire-field change. RC retry precedence and SI first-failure policy remain explicit. This is a corrective fix/cleanup, not a new capability requiring a feature design document.
Read and traced all 47 changed files: failure markers/public unwrapping, Pipeline and Scope cleanup, nested/parallel result collection, immutable JoinMap snapshots, normal/Stop terminal decoding and fail-closed reuse, registry waiter/attachment/generation cleanup, reuse-disabled subscription cancellation, dispatch rollback, the retired retry metric and test-fixture ownership. Substantive declared Error, an independent deadline and late retry cannot be turned into success by cleanup; normal Stop does not cancel a shared producer or surviving subscriber. Local terminal publication precedes bounded remote settlement. Exact-owner deletion prevents a stale generation from deleting its replacement.
Independent validation on this head, Go 1.26.4 darwin/arm64, CPU CGo rebuilt through the top-level owner with verified dependencies:
- Ten targeted compile test roots: normal and race PASS; four additional separate-process race repetitions PASS (
floor(30/6.084)=4, not cached/in-process repetition). - Complete compile, process, colexec, dispatch and vm/message packages: race PASS, terminal command exit 0.
- Real two-CN public SQL contract, both connection-reuse settings: injected failure after partial input, healthy untargeted/request-isolation controls, forwarder close, actual overflow error 1690/22003, and prepared FK metadata cleanup: all five selected DML roots race PASS. Public injected failure/FK cases also passed normally.
- Unchanged adjacent
TestIssue29492MultiCNCancellationCleanup: race PASS (17.10s test / 19.575s package), challenging cancellation/teardown independently of the new fixture. - Diff whitespace check PASS. Initial missing-native and mistaken package-selection attempts are not counted as product failures or passing validation; corrected commands above reached terminal success.
Historical comment disposition: read all three prior COMMENT reviews; there are no human inline findings. Earlier no-wait-cycle reasoning is superseded by the explicit current local-terminal-before-remote-wait ordering. Latest terminal/registration changes were revalidated rather than inheriting stale passes. Obsolete Err-channel/backoff/forced-delete tests were retired with their implementations; conflict, rollback, terminal, generation, DOP/lazy-branch and shared-owner behavior remain tested at the canonical owners.
Engineering/performance: production +597/-577, tests +1985/-1310, docs zero. The test increment is justified by distinct failure/provenance/reuse/ownership contracts rather than repeated setup; real overflow/FK controls do not use the injector as their oracle. Failure provenance is error-path work; terminal decoding is shared rather than repeated, and removed retry/channel bookkeeping is not replaced by another retained structure. No fresh throughput benchmark, TPCC/Kill-CN incident reproduction, GPU/Linux runtime validation or universal “no regression” claim is made. Stored data/offline upgrade semantics are unchanged; mixed-version rolling upgrade is outside this review. Local evidence: /private/tmp/mo-review-five.HHHg3U/29619-*.log.
Publish local terminals before waiting for remote stop responses, while retaining late execution failures in the existing scope result collectors. Retire unsubmitted inputs without waiting for nonexistent DOP producers, consolidating the cleanup owner and removing redundant wrappers. Cover both ordering failures and unordered remote LIMIT without expanding cluster fixtures.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep review of commit 52facc0f5f0fe4c0b5815d2f71add97748e48d56 covering design, ownership, unhappy paths, performance, and implementation/test quality. No subagents were used.
No new blocking P1/P2 defect was confirmed. One nonblocking P3 cleanup omission remains. Required CI is still pending; this review does not establish an all-green merge gate.
[P3] Remove the unused constructor left by the retired registration-retry protocol.
pkg/common/moerr/error.go:1078 still defines NewRemoteDispatchNotRegistered. This PR removes its only production caller (newRemoteDispatchNotRegisteredYetError), the classifier, TryGetProcByUuid, and the notification retry path. A repository-wide symbol search now finds only the constructor definition, numeric constant, and error catalog entry. Delete the unused constructor so the callable API no longer advertises the retired protocol. Preserve numeric error-code allocation; do not renumber unrelated codes. This is a maintenance issue, not a current execution or performance failure.
Historical review concerns were checked against the current owners and retained behavior tests: failure provenance and nested RC retry, local/remote teardown ordering and late failure collection, unstarted DOP retirement, registration-generation cancellation, StopSending with reuse disabled, request-scoped fault injection, and shared fixture cleanup. Their fixes are present in this commit.
| Audit | Result |
|---|---|
| Ownership | Generation terminals and owner-scoped registration cleanup replace parallel error channels; stream close remains guarded by closeOnce. |
| Wait termination | Local consumers are released before required remote settlement. Optional Stop/FIN cleanup shares one query-rooted budget; required settlement retains independent authority. This is not a whole-query or physical-close 30-second guarantee. |
| Retained state | UUID registrations and waiter references have reachable generation-specific release; result queues are bounded by admitted work. No unbounded retention was demonstrated in the changed paths. |
| Test quality | Tests cover public SQL error codes, partial-result failure, cancellation, reuse on/off, and healthy queries on the same connection. Retired retry-only tests and duplicate fixture destruction were removed. |
Validation reuse was checked against the exact complete patch fingerprint: 22c302d8bfdde53e287415a31abe564ca5cebcdbcf6829b7a8bc97f2c535ca26. Relevant owning-package normal/race runs, eight selected tests with 100 race repetitions each, real two-CN SQL contracts, and incremental static checks passed. The earlier failed Stop-fallback fixture expectation was corrected and superseded by the passing full compile normal/race and stress runs. Unchanged suites were not rerun merely for this review.
Performance evidence for this revision versus the previous PR revision (812aeaa) contains 93,184 validated SQL statements. Eight warm cells cover reuse on/off, SUM/early stop, and 1/8 clients; median QPS changes range from -1.59% to +7.63%. Some small-sample P99 medians rose about 7%. Larger ABBA tail comparisons cover only reuse-enabled SUM with 8 clients and reuse-disabled early stop with 8 clients; those did not show a stable regression. The other six cells retain smaller warm diagnostics. This is not a production-tail or all-workload guarantee, nor a fresh comparison against latest main.
| Category | Added | Deleted | Net |
|---|---|---|---|
| Implementation | 671 | 641 | +30 |
| Tests | 2,175 | 1,382 | +793 |
| Documentation | 0 | 0 | 0 |
The implementation increase earns concrete failure-preservation and bounded-cleanup benefits. Test growth was reviewed by behavior and boundary rather than treated as exempt from complexity review.
At submission, the head is unchanged and CI has no failed checks; Ubuntu UT, Linux/arm64 SCA, PROXY BVT, and COMPOSE PESSIMISTIC BVT are still running. Coverage has passed. Latest main contains one additional unary-function refactor and GitHub reports the PR mergeable. The original historical chaos/DROP interleaving and physical CN-kill behavior are not claimed as reproduced by these tests.
What type of PR is this?
Which issue(s) this PR fixes:
Addresses #29588's confirmed execution-layer failure-to-success defect. Attribution of the historical Chaos incident remains unverified.
What this PR does / why we need it:
A producer failure after partial input could be normalized into success when sibling cleanup canceled its pipeline. Preserve the producer's frozen failure through terminal publication, nested scopes, remote notifications and statement settlement, while retaining Compile's RC/SI retry policy and concrete public error codes.
Successful consumer retirement also needs to stay control flow. The PROXY BVT metadata query in
prepare_ddl_schema_change.sql:112expected count 0 but returnedinternal error: pipeline consumer finished: the join-map error snapshot converted the new successful-stop sentinel to a substantive internal error. Snapshot its immutable structural control marker using the existing cancellation representation. The scope still decides success from its exact cancellation cause and live query; declared failures and substantive or independent deadline leaves remain errors. If a consumer stopped before its parent query deadline, preserve the later query deadline rather than returning the stale stop diagnostic.The complete change closes existing execution owners:
No protocol or persistent format changes, new state machine, goroutine, cache, database/network operation or retry layer. The complete cancellation-owner change requires an offline full-cluster upgrade; mixed-version rolling upgrades are not established.
Validation
Final revision:
52facc0f5f0fe4c0b5815d2f71add97748e48d56. Linux/amd64, Go 1.26.4, GOMAXPROCS=8, locally built CPU native artifacts, repository CGo test wrapper.3980208is retained. Focused terminal/actual parent/RC retry assertions and migrated registration/rollback/generation/retirement tests passed individually bounded 100-repeat race runs.Performance and limitations
Terminal arbitration uses the existing decoders once and adds no per-row allocation, stored state, goroutine or database/network I/O. Removing notify retry timers/backoff and legacy receiver completion fields/writes reduces lifecycle work. Stream-reuse-disabled mode remains supported. Shared moerr wire identifiers remain unchanged; unsupported terminal-less registrations and retry fallbacks are retired.
Optional teardown uses one temporary context/timer per owning cleanup group instead of a fresh FIN budget per notify sender, with no per-row work or new goroutines. Required Stop settlement remains separately bounded. The 30-second shared limit covers optional protocol waits, not physical backend closure or the entire statement.
Fresh paired two-CN performance validation compared
812aeaa2with52facc0fafter rebase: 27,648 verified SQL statements across reuse on/off, SUM and early-stop, and 1/8 clients; warm throughput medians ranged from -1.59% to +7.63%. Some small-sample P99 medians rose about 7%, so a bounded ABBA follow-up checked 65,536 more statements in reuse-enabled SUM and reuse-disabled early-stop at 8 clients with 8,192 samples per cell/round. Their P99 changed -8.81% and -7.37%; the apparent tail regression did not reproduce in those measured cells. These local diagnostics establish no stable regression here, not a production throughput/P99 guarantee.Prior paired snapshot microbenchmarks measured 15 allocations / 717 B before versus 2 allocations / 56 B after; this unchanged evidence is retained, not a new SQL throughput or P99 guarantee. No real TPCC Kill-CN chaos, physical network-corruption reproduction or historical incident attribution is claimed. Native overflow produced zero rows before error; nested white-box tests establish partial-input failure handling.
The branch was cleanly rebased onto upstream main
625404fd7d. Range-diff confirms all eight inherited commits are unchanged; affected binder/readutil consumers were revalidated. The previous PR head812aeaa2has no failed CI checks. CI for the new pushed revision is pending and is not claimed successful.This follow-up: implementation +79/-69 (net +10), tests +216/-98 (net +118), documentation 0. Complete PR: implementation +671/-641 (net +30), tests +2175/-1382 (net +793), documentation 0. No file moves are counted as reductions. The small implementation increase buys a parent-owned resource bound while deleting duplicate reuse authorization; tests cover that bound and preserve independent settlement.