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? |
gouhongshen
left a comment
There was a problem hiding this comment.
Codex automated review
No actionable regressions found. The normalization matches RemoteRun’s retained root-Dispatch ownership, runs before registration/goroutines, preserves ordinary remote dispatch routes, and adds focused positive/negative coverage. Existing PR discussion had no substantive reviews or inline threads. CI is green; local focused testing was unavailable because the required prebuilt libmo.dylib is absent.
XuPeng-SH
left a comment
There was a problem hiding this comment.
[P1] Normalize dispatch owners when RemoteRun falls back to local execution
The !checkPipelineStandaloneExecutableAtRemote(s) branch on lines 105-107 only descends into PreScopes, so it never records a Dispatch in this scope's own operator tree. This is inconsistent with RemoteRun: the same predicate makes it call s.MergeRun(c), which executes the entire scope (including its root/operator-tree Dispatch) on the caller CN. registerLocalDispatchReceivers likewise registers that whole fallback tree on the caller. Any matching receiver therefore keeps its compile-time FromAddr, sends prepare-notify to the dormant target CN, and never attaches to the active dispatch on the caller; the valid query retries/waits until its context is cancelled.
I reproduced this on the exact head with a Remote scope targeting cn2, a root dispatch, and a child connector whose external WaitRegister forces the standalone check to return false. After normalization on cn1, the receiver's owner was still cn2 (expected cn1). The existing TestGroupShuffleBucketsByCNIfNeeded documentation also identifies this reachable local-fallback/compile-time-FromAddr mismatch as a hang. Please collect dispatch UUIDs from every operator tree that the fallback MergeRun retains locally (and add root plus nested-dispatch regression cases), rather than scanning only the pre-scopes.
|
@LeftHandCold need change |
d97b35e to
7d9860c
Compare
gouhongshen
left a comment
There was a problem hiding this comment.
Codex automated review
No actionable regressions found. The normalization matches RemoteRun’s retained root-Dispatch placement, stops at rejected scopes, runs before registration and goroutine startup, and preserves ordinary remote operator routes. Focused local tests could not start because libmo.dylib is absent; exact-head CI and reported focused/race suites passed.
…gin#26025) ## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Fixes matrixorigin#25816 ## What this PR does / why we need it: For a nested `RemoteRun`, encoding can retain a root `Dispatch` on the caller CN while sending its child scope to the target CN. The decoded receiver metadata, however, still carries the compile-time target CN in `FromAddr`. When runtime placement selects a different caller CN, the retained `Dispatch` is registered and executed on that caller, but the receiver sends its prepare notification to the dormant compile-time target. The active `Dispatch` never receives its stream and waits indefinitely. This change normalizes `FromAddr` before remote-pipeline registration, limited to receiver UUIDs owned by a root `Dispatch` that standalone `RemoteRun` actually retains and executes on the current caller. Ordinary remotely executed operator trees remain unchanged. Since matrixorigin#25990, a non-standalone remote scope is rejected by `failRemoteRunBeforeStart`; it no longer falls back to local `MergeRun`. Normalization therefore stops at rejected scopes and does not rewrite routes owned by their root, nested operators, or descendants. Regression tests pin that rejection boundary. The change does not alter planning, the wire format, dispatch semantics, RPC timeouts, or cluster topology. Validation on latest `main` (`90e3400436`): - focused regression, `-count=20` - focused regression with `-race -count=3` - full `pkg/sql/compile` package - full `pkg/sql/compile` package with `-race` - `go build -mod=readonly ./pkg/sql/compile` - `go vet -mod=readonly ./pkg/sql/compile` - `git diff --check` The original issue reproduction was also validated on `10.222.1.50` before this review follow-up: commit `51f629bd202b38b33fd5fc7d6b3052b0c8242db4` was built with `make dev-build TYPECHECK=0`, the 2-CN dev cluster was recreated, and the reproduction query completed repeatedly through both CNs with identical expected results, no lingering query, timeout, panic, receiver error, restart, or OOM kill. Regression coverage includes retained-root placement, ordinary remote-tree negative control, rejected root and nested dispatches, rejected descendants, unrelated UUIDs, and nil input. --------- Co-authored-by: XuPeng-SH <[email protected]>
…gin#26025) ## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Fixes matrixorigin#25816 ## What this PR does / why we need it: For a nested `RemoteRun`, encoding can retain a root `Dispatch` on the caller CN while sending its child scope to the target CN. The decoded receiver metadata, however, still carries the compile-time target CN in `FromAddr`. When runtime placement selects a different caller CN, the retained `Dispatch` is registered and executed on that caller, but the receiver sends its prepare notification to the dormant compile-time target. The active `Dispatch` never receives its stream and waits indefinitely. This change normalizes `FromAddr` before remote-pipeline registration, limited to receiver UUIDs owned by a root `Dispatch` that standalone `RemoteRun` actually retains and executes on the current caller. Ordinary remotely executed operator trees remain unchanged. Since matrixorigin#25990, a non-standalone remote scope is rejected by `failRemoteRunBeforeStart`; it no longer falls back to local `MergeRun`. Normalization therefore stops at rejected scopes and does not rewrite routes owned by their root, nested operators, or descendants. Regression tests pin that rejection boundary. The change does not alter planning, the wire format, dispatch semantics, RPC timeouts, or cluster topology. Validation on latest `main` (`90e3400436`): - focused regression, `-count=20` - focused regression with `-race -count=3` - full `pkg/sql/compile` package - full `pkg/sql/compile` package with `-race` - `go build -mod=readonly ./pkg/sql/compile` - `go vet -mod=readonly ./pkg/sql/compile` - `git diff --check` The original issue reproduction was also validated on `10.222.1.50` before this review follow-up: commit `51f629bd202b38b33fd5fc7d6b3052b0c8242db4` was built with `make dev-build TYPECHECK=0`, the 2-CN dev cluster was recreated, and the reproduction query completed repeatedly through both CNs with identical expected results, no lingering query, timeout, panic, receiver error, restart, or OOM kill. Regression coverage includes retained-root placement, ordinary remote-tree negative control, rejected root and nested dispatches, rejected descendants, unrelated UUIDs, and nil input. --------- Co-authored-by: XuPeng-SH <[email protected]>
…gin#26025) ## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Fixes matrixorigin#25816 ## What this PR does / why we need it: For a nested `RemoteRun`, encoding can retain a root `Dispatch` on the caller CN while sending its child scope to the target CN. The decoded receiver metadata, however, still carries the compile-time target CN in `FromAddr`. When runtime placement selects a different caller CN, the retained `Dispatch` is registered and executed on that caller, but the receiver sends its prepare notification to the dormant compile-time target. The active `Dispatch` never receives its stream and waits indefinitely. This change normalizes `FromAddr` before remote-pipeline registration, limited to receiver UUIDs owned by a root `Dispatch` that standalone `RemoteRun` actually retains and executes on the current caller. Ordinary remotely executed operator trees remain unchanged. Since matrixorigin#25990, a non-standalone remote scope is rejected by `failRemoteRunBeforeStart`; it no longer falls back to local `MergeRun`. Normalization therefore stops at rejected scopes and does not rewrite routes owned by their root, nested operators, or descendants. Regression tests pin that rejection boundary. The change does not alter planning, the wire format, dispatch semantics, RPC timeouts, or cluster topology. Validation on latest `main` (`90e3400436`): - focused regression, `-count=20` - focused regression with `-race -count=3` - full `pkg/sql/compile` package - full `pkg/sql/compile` package with `-race` - `go build -mod=readonly ./pkg/sql/compile` - `go vet -mod=readonly ./pkg/sql/compile` - `git diff --check` The original issue reproduction was also validated on `10.222.1.50` before this review follow-up: commit `51f629bd202b38b33fd5fc7d6b3052b0c8242db4` was built with `make dev-build TYPECHECK=0`, the 2-CN dev cluster was recreated, and the reproduction query completed repeatedly through both CNs with identical expected results, no lingering query, timeout, panic, receiver error, restart, or OOM kill. Regression coverage includes retained-root placement, ordinary remote-tree negative control, rejected root and nested dispatches, rejected descendants, unrelated UUIDs, and nil input. --------- Co-authored-by: XuPeng-SH <[email protected]>
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #25816
What this PR does / why we need it:
For a nested
RemoteRun, encoding can retain a rootDispatchon the callerCN while sending its child scope to the target CN. The decoded receiver metadata,
however, still carries the compile-time target CN in
FromAddr. When runtimeplacement selects a different caller CN, the retained
Dispatchis registeredand executed on that caller, but the receiver sends its prepare notification to
the dormant compile-time target. The active
Dispatchnever receives itsstream and waits indefinitely.
This change normalizes
FromAddrbefore remote-pipeline registration, limitedto receiver UUIDs owned by a root
Dispatchthat standaloneRemoteRunactually retains and executes on the current caller. Ordinary remotely executed
operator trees remain unchanged.
Since #25990, a non-standalone remote scope is rejected by
failRemoteRunBeforeStart; it no longer falls back to localMergeRun.Normalization therefore stops at rejected scopes and does not rewrite routes
owned by their root, nested operators, or descendants. Regression tests pin
that rejection boundary.
The change does not alter planning, the wire format, dispatch semantics, RPC
timeouts, or cluster topology.
Validation on latest
main(90e3400436):-count=20-race -count=3pkg/sql/compilepackagepkg/sql/compilepackage with-racego build -mod=readonly ./pkg/sql/compilego vet -mod=readonly ./pkg/sql/compilegit diff --checkThe original issue reproduction was also validated on
10.222.1.50beforethis review follow-up: commit
51f629bd202b38b33fd5fc7d6b3052b0c8242db4was built with
make dev-build TYPECHECK=0, the 2-CN dev cluster was recreated,and the reproduction query completed repeatedly through both CNs with identical
expected results, no lingering query, timeout, panic, receiver error, restart,
or OOM kill.
Regression coverage includes retained-root placement, ordinary remote-tree
negative control, rejected root and nested dispatches, rejected descendants,
unrelated UUIDs, and nil input.