Repository navigation
refactor(schedule): introduce staged query placement - #25537
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? |
|
Correction to my earlier LGTM: the delayed runtime pass found a real blocker.
Concretely:
That means a single-remote-worker MINUS/INTERSECT can now receive coordinator-local feeders through local-only connectors, and the multi-scope path can also break when the current-CN side still carries an id-only sentinel with empty I would treat this as a blocker. The safe fix is to keep MINUS/INTERSECT on the coordinator unless all feeder scopes are already on the chosen worker, or add a stage-aware feeder/merge path that materializes the inputs on the same worker and uses a real cross-CN dispatch when needed. |
…tch source address (#25556) ## What type of PR is this? - [x] BUG ## Which issue(s) this PR fixes: issue #25554 ## What this PR does / why we need it: PR #25537 replaced `isSameCN` with `sameExecutionNode` in `constructDispatchLocalAndRemote`. The new function correctly treats empty-vs-non-empty addresses as different execution nodes, but `compileExternScanParallelWrite` still hardcoded an empty address for the source scope, causing: 1. dispatch Prepare sees RemoteRegs + FuncId=`SendToAnyLocalFunc` → raises `"SendToAnyLocalFunc should not send to remote"` 2. Runtime tries to connect to empty address via morpc → `"dial tcp4: missing address"` infinite retry 3. Query hangs forever until workflow timeout **Fix**: Pass the current CN address (`c.addr`) to `constructScopeForExternal` in `compileExternScanParallelWrite`, so `sameExecutionNode` correctly identifies source and target as the same local node. **Affected**: All LOAD DATA with compressed files (flate/bz2/gzip/lz4) where `mcpu > 1`. Not specific to any compression type. ## Verification - `go vet ./pkg/sql/compile/` ✅ - `go test ./pkg/sql/compile/` ✅ - Added `TestSameExecutionNodeMatchesByAddressForLocalScope` regression test ✅ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.8 <[email protected]> --------- Co-authored-by: Claude Opus 4.8 <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: XuPeng-SH <[email protected]>
) ## What type of PR is this? - [ ] API-change - [ ] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [x] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#25451 ## What this PR does / why we need it: This PR introduces the next scheduler refactor step after the current-CN placement policy work: - separates query worker decisions from scan/stage materialization - adds explicit stage placement decisions for single-worker and query-worker stages - keeps scan placement decisions in the schedule package with focused unhappy-path coverage - preserves local sentinel semantics while materializing executable engine nodes only at compile boundaries - updates compile tests for stage placement, scan placement, current-CN route handling, and execution-node identity matching
…tch source address (matrixorigin#25556) ## What type of PR is this? - [x] BUG ## Which issue(s) this PR fixes: issue matrixorigin#25554 ## What this PR does / why we need it: PR matrixorigin#25537 replaced `isSameCN` with `sameExecutionNode` in `constructDispatchLocalAndRemote`. The new function correctly treats empty-vs-non-empty addresses as different execution nodes, but `compileExternScanParallelWrite` still hardcoded an empty address for the source scope, causing: 1. dispatch Prepare sees RemoteRegs + FuncId=`SendToAnyLocalFunc` → raises `"SendToAnyLocalFunc should not send to remote"` 2. Runtime tries to connect to empty address via morpc → `"dial tcp4: missing address"` infinite retry 3. Query hangs forever until workflow timeout **Fix**: Pass the current CN address (`c.addr`) to `constructScopeForExternal` in `compileExternScanParallelWrite`, so `sameExecutionNode` correctly identifies source and target as the same local node. **Affected**: All LOAD DATA with compressed files (flate/bz2/gzip/lz4) where `mcpu > 1`. Not specific to any compression type. ## Verification - `go vet ./pkg/sql/compile/` ✅ - `go test ./pkg/sql/compile/` ✅ - Added `TestSameExecutionNodeMatchesByAddressForLocalScope` regression test ✅ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.8 <[email protected]> --------- Co-authored-by: Claude Opus 4.8 <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: XuPeng-SH <[email protected]>
) ## What type of PR is this? - [ ] API-change - [ ] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [x] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#25451 ## What this PR does / why we need it: This PR introduces the next scheduler refactor step after the current-CN placement policy work: - separates query worker decisions from scan/stage materialization - adds explicit stage placement decisions for single-worker and query-worker stages - keeps scan placement decisions in the schedule package with focused unhappy-path coverage - preserves local sentinel semantics while materializing executable engine nodes only at compile boundaries - updates compile tests for stage placement, scan placement, current-CN route handling, and execution-node identity matching
…tch source address (matrixorigin#25556) ## What type of PR is this? - [x] BUG ## Which issue(s) this PR fixes: issue matrixorigin#25554 ## What this PR does / why we need it: PR matrixorigin#25537 replaced `isSameCN` with `sameExecutionNode` in `constructDispatchLocalAndRemote`. The new function correctly treats empty-vs-non-empty addresses as different execution nodes, but `compileExternScanParallelWrite` still hardcoded an empty address for the source scope, causing: 1. dispatch Prepare sees RemoteRegs + FuncId=`SendToAnyLocalFunc` → raises `"SendToAnyLocalFunc should not send to remote"` 2. Runtime tries to connect to empty address via morpc → `"dial tcp4: missing address"` infinite retry 3. Query hangs forever until workflow timeout **Fix**: Pass the current CN address (`c.addr`) to `constructScopeForExternal` in `compileExternScanParallelWrite`, so `sameExecutionNode` correctly identifies source and target as the same local node. **Affected**: All LOAD DATA with compressed files (flate/bz2/gzip/lz4) where `mcpu > 1`. Not specific to any compression type. ## Verification - `go vet ./pkg/sql/compile/` ✅ - `go test ./pkg/sql/compile/` ✅ - Added `TestSameExecutionNodeMatchesByAddressForLocalScope` regression test ✅ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.8 <[email protected]> --------- Co-authored-by: Claude Opus 4.8 <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: XuPeng-SH <[email protected]>
) ## What type of PR is this? - [ ] API-change - [ ] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [x] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#25451 ## What this PR does / why we need it: This PR introduces the next scheduler refactor step after the current-CN placement policy work: - separates query worker decisions from scan/stage materialization - adds explicit stage placement decisions for single-worker and query-worker stages - keeps scan placement decisions in the schedule package with focused unhappy-path coverage - preserves local sentinel semantics while materializing executable engine nodes only at compile boundaries - updates compile tests for stage placement, scan placement, current-CN route handling, and execution-node identity matching
…tch source address (matrixorigin#25556) ## What type of PR is this? - [x] BUG ## Which issue(s) this PR fixes: issue matrixorigin#25554 ## What this PR does / why we need it: PR matrixorigin#25537 replaced `isSameCN` with `sameExecutionNode` in `constructDispatchLocalAndRemote`. The new function correctly treats empty-vs-non-empty addresses as different execution nodes, but `compileExternScanParallelWrite` still hardcoded an empty address for the source scope, causing: 1. dispatch Prepare sees RemoteRegs + FuncId=`SendToAnyLocalFunc` → raises `"SendToAnyLocalFunc should not send to remote"` 2. Runtime tries to connect to empty address via morpc → `"dial tcp4: missing address"` infinite retry 3. Query hangs forever until workflow timeout **Fix**: Pass the current CN address (`c.addr`) to `constructScopeForExternal` in `compileExternScanParallelWrite`, so `sameExecutionNode` correctly identifies source and target as the same local node. **Affected**: All LOAD DATA with compressed files (flate/bz2/gzip/lz4) where `mcpu > 1`. Not specific to any compression type. ## Verification - `go vet ./pkg/sql/compile/` ✅ - `go test ./pkg/sql/compile/` ✅ - Added `TestSameExecutionNodeMatchesByAddressForLocalScope` regression test ✅ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.8 <[email protected]> --------- Co-authored-by: Claude Opus 4.8 <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: XuPeng-SH <[email protected]>
What type of PR is this?
Which issue(s) this PR fixes:
issue #25451
What this PR does / why we need it:
This PR introduces the next scheduler refactor step after the current-CN placement policy work: