Skip to content

fix(sql): harden remote scheduling failure paths - #25492

Merged
XuPeng-SH merged 9 commits into
matrixorigin:mainfrom
XuPeng-SH:refactor_schedule_phase2_0706
Jul 6, 2026
Merged

XuPeng-SH merged 9 commits into
matrixorigin:mainfrom
XuPeng-SH:refactor_schedule_phase2_0706

Conversation

@XuPeng-SH

@XuPeng-SH XuPeng-SH commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • BUG
  • Code Refactoring

Which issue(s) this PR fixes:

issue #25451

What this PR does / why we need it:

  • remove compile-time CN ping filtering and rely on cluster-service work-state discovery
  • keep AP multi-CN scans local when CN candidates are empty
  • harden remote run stream setup, cleanup, and session-close handling
  • add unhappy-path coverage for remote sender cancellation, stream close, and CN work-state discovery

Tests

  • GOFLAGS=-mod=mod CGO_CFLAGS="-I$(pwd)/cgo -I$(pwd)/thirdparties/install/include" CGO_LDFLAGS="-L$(pwd)/thirdparties/install/lib -lusearch_c" LD_LIBRARY_PATH="$(pwd)/cgo:$(pwd)/thirdparties/install/lib" go build -ldflags="-extldflags '-L$(pwd)/cgo -lmo -L$(pwd)/thirdparties/install/lib -Wl,-rpath,\$ORIGIN/lib'" ./pkg/sql/schedule ./pkg/sql/colexec ./pkg/sql/compile ./pkg/vm/engine/disttae
  • GOFLAGS=-mod=mod CGO_CFLAGS="-I$(pwd)/cgo -I$(pwd)/thirdparties/install/include" CGO_LDFLAGS="-L$(pwd)/thirdparties/install/lib -lusearch_c" LD_LIBRARY_PATH="$(pwd)/cgo:$(pwd)/thirdparties/install/lib" go vet -ldflags="-extldflags '-L$(pwd)/cgo -lmo -L$(pwd)/thirdparties/install/lib -Wl,-rpath,\$ORIGIN/lib'" ./pkg/sql/schedule ./pkg/sql/colexec ./pkg/sql/compile ./pkg/vm/engine/disttae
  • GOFLAGS=-mod=mod CGO_CFLAGS="-I$(pwd)/cgo -I$(pwd)/thirdparties/install/include" CGO_LDFLAGS="-L$(pwd)/thirdparties/install/lib -lusearch_c" LD_LIBRARY_PATH="$(pwd)/cgo:$(pwd)/thirdparties/install/lib" go test -ldflags="-extldflags '-L$(pwd)/cgo -lmo -L$(pwd)/thirdparties/install/lib -Wl,-rpath,\$ORIGIN/lib'" -count=1 -timeout 240s ./pkg/sql/schedule ./pkg/sql/colexec ./pkg/sql/compile ./pkg/vm/engine/disttae
  • GOFLAGS=-mod=mod CGO_CFLAGS="-I$(pwd)/cgo -I$(pwd)/thirdparties/install/include" CGO_LDFLAGS="-L$(pwd)/thirdparties/install/lib -lusearch_c" LD_LIBRARY_PATH="$(pwd)/cgo:$(pwd)/thirdparties/install/lib" go test -race -ldflags="-extldflags '-L$(pwd)/cgo -lmo -L$(pwd)/thirdparties/install/lib -Wl,-rpath,\$ORIGIN/lib'" -count=1 -timeout=240s -run 'Test(MessageSenderSendPipelineReturnsWhenSendObservesContextCancel|MessageSenderOnClientReceiveBatchReturnsStreamClosed|MessageSenderOnClientReceiveBatchContextDone|ReceiveMsgAndForward|ReceiveMessageFromCnServerIfConnector)' ./pkg/sql/compile

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@matrix-meow matrix-meow added the size/L Denotes a PR that changes [500,999] lines label Jul 6, 2026
@mergify mergify Bot added kind/bug Something isn't working kind/refactor Code refactor labels Jul 6, 2026
@XuPeng-SH
XuPeng-SH merged commit 3a01a19 into matrixorigin:main Jul 6, 2026
23 checks passed
@XuPeng-SH
XuPeng-SH deleted the refactor_schedule_phase2_0706 branch July 6, 2026 17:39
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## What type of PR is this?

- [x] BUG
- [x] Code Refactoring

## Which issue(s) this PR fixes:

issue matrixorigin#25451

## What this PR does / why we need it:

- remove compile-time CN ping filtering and rely on cluster-service
work-state discovery
- keep AP multi-CN scans local when CN candidates are empty
- harden remote run stream setup, cleanup, and session-close handling
- add unhappy-path coverage for remote sender cancellation, stream
close, and CN work-state discovery

## Tests

- GOFLAGS=-mod=mod CGO_CFLAGS="-I$(pwd)/cgo
-I$(pwd)/thirdparties/install/include"
CGO_LDFLAGS="-L$(pwd)/thirdparties/install/lib -lusearch_c"
LD_LIBRARY_PATH="$(pwd)/cgo:$(pwd)/thirdparties/install/lib" go build
-ldflags="-extldflags '-L$(pwd)/cgo -lmo
-L$(pwd)/thirdparties/install/lib -Wl,-rpath,\\$ORIGIN/lib'"
./pkg/sql/schedule ./pkg/sql/colexec ./pkg/sql/compile
./pkg/vm/engine/disttae
- GOFLAGS=-mod=mod CGO_CFLAGS="-I$(pwd)/cgo
-I$(pwd)/thirdparties/install/include"
CGO_LDFLAGS="-L$(pwd)/thirdparties/install/lib -lusearch_c"
LD_LIBRARY_PATH="$(pwd)/cgo:$(pwd)/thirdparties/install/lib" go vet
-ldflags="-extldflags '-L$(pwd)/cgo -lmo
-L$(pwd)/thirdparties/install/lib -Wl,-rpath,\\$ORIGIN/lib'"
./pkg/sql/schedule ./pkg/sql/colexec ./pkg/sql/compile
./pkg/vm/engine/disttae
- GOFLAGS=-mod=mod CGO_CFLAGS="-I$(pwd)/cgo
-I$(pwd)/thirdparties/install/include"
CGO_LDFLAGS="-L$(pwd)/thirdparties/install/lib -lusearch_c"
LD_LIBRARY_PATH="$(pwd)/cgo:$(pwd)/thirdparties/install/lib" go test
-ldflags="-extldflags '-L$(pwd)/cgo -lmo
-L$(pwd)/thirdparties/install/lib -Wl,-rpath,\\$ORIGIN/lib'" -count=1
-timeout 240s ./pkg/sql/schedule ./pkg/sql/colexec ./pkg/sql/compile
./pkg/vm/engine/disttae
- GOFLAGS=-mod=mod CGO_CFLAGS="-I$(pwd)/cgo
-I$(pwd)/thirdparties/install/include"
CGO_LDFLAGS="-L$(pwd)/thirdparties/install/lib -lusearch_c"
LD_LIBRARY_PATH="$(pwd)/cgo:$(pwd)/thirdparties/install/lib" go test
-race -ldflags="-extldflags '-L$(pwd)/cgo -lmo
-L$(pwd)/thirdparties/install/lib -Wl,-rpath,\\$ORIGIN/lib'" -count=1
-timeout=240s -run
'Test(MessageSenderSendPipelineReturnsWhenSendObservesContextCancel|MessageSenderOnClientReceiveBatchReturnsStreamClosed|MessageSenderOnClientReceiveBatchContextDone|ReceiveMsgAndForward|ReceiveMessageFromCnServerIfConnector)'
./pkg/sql/compile

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## What type of PR is this?

- [x] BUG
- [x] Code Refactoring

## Which issue(s) this PR fixes:

issue matrixorigin#25451

## What this PR does / why we need it:

- remove compile-time CN ping filtering and rely on cluster-service
work-state discovery
- keep AP multi-CN scans local when CN candidates are empty
- harden remote run stream setup, cleanup, and session-close handling
- add unhappy-path coverage for remote sender cancellation, stream
close, and CN work-state discovery

## Tests

- GOFLAGS=-mod=mod CGO_CFLAGS="-I$(pwd)/cgo
-I$(pwd)/thirdparties/install/include"
CGO_LDFLAGS="-L$(pwd)/thirdparties/install/lib -lusearch_c"
LD_LIBRARY_PATH="$(pwd)/cgo:$(pwd)/thirdparties/install/lib" go build
-ldflags="-extldflags '-L$(pwd)/cgo -lmo
-L$(pwd)/thirdparties/install/lib -Wl,-rpath,\\$ORIGIN/lib'"
./pkg/sql/schedule ./pkg/sql/colexec ./pkg/sql/compile
./pkg/vm/engine/disttae
- GOFLAGS=-mod=mod CGO_CFLAGS="-I$(pwd)/cgo
-I$(pwd)/thirdparties/install/include"
CGO_LDFLAGS="-L$(pwd)/thirdparties/install/lib -lusearch_c"
LD_LIBRARY_PATH="$(pwd)/cgo:$(pwd)/thirdparties/install/lib" go vet
-ldflags="-extldflags '-L$(pwd)/cgo -lmo
-L$(pwd)/thirdparties/install/lib -Wl,-rpath,\\$ORIGIN/lib'"
./pkg/sql/schedule ./pkg/sql/colexec ./pkg/sql/compile
./pkg/vm/engine/disttae
- GOFLAGS=-mod=mod CGO_CFLAGS="-I$(pwd)/cgo
-I$(pwd)/thirdparties/install/include"
CGO_LDFLAGS="-L$(pwd)/thirdparties/install/lib -lusearch_c"
LD_LIBRARY_PATH="$(pwd)/cgo:$(pwd)/thirdparties/install/lib" go test
-ldflags="-extldflags '-L$(pwd)/cgo -lmo
-L$(pwd)/thirdparties/install/lib -Wl,-rpath,\\$ORIGIN/lib'" -count=1
-timeout 240s ./pkg/sql/schedule ./pkg/sql/colexec ./pkg/sql/compile
./pkg/vm/engine/disttae
- GOFLAGS=-mod=mod CGO_CFLAGS="-I$(pwd)/cgo
-I$(pwd)/thirdparties/install/include"
CGO_LDFLAGS="-L$(pwd)/thirdparties/install/lib -lusearch_c"
LD_LIBRARY_PATH="$(pwd)/cgo:$(pwd)/thirdparties/install/lib" go test
-race -ldflags="-extldflags '-L$(pwd)/cgo -lmo
-L$(pwd)/thirdparties/install/lib -Wl,-rpath,\\$ORIGIN/lib'" -count=1
-timeout=240s -run
'Test(MessageSenderSendPipelineReturnsWhenSendObservesContextCancel|MessageSenderOnClientReceiveBatchReturnsStreamClosed|MessageSenderOnClientReceiveBatchContextDone|ReceiveMsgAndForward|ReceiveMessageFromCnServerIfConnector)'
./pkg/sql/compile

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## What type of PR is this?

- [x] BUG
- [x] Code Refactoring

## Which issue(s) this PR fixes:

issue matrixorigin#25451

## What this PR does / why we need it:

- remove compile-time CN ping filtering and rely on cluster-service
work-state discovery
- keep AP multi-CN scans local when CN candidates are empty
- harden remote run stream setup, cleanup, and session-close handling
- add unhappy-path coverage for remote sender cancellation, stream
close, and CN work-state discovery

## Tests

- GOFLAGS=-mod=mod CGO_CFLAGS="-I$(pwd)/cgo
-I$(pwd)/thirdparties/install/include"
CGO_LDFLAGS="-L$(pwd)/thirdparties/install/lib -lusearch_c"
LD_LIBRARY_PATH="$(pwd)/cgo:$(pwd)/thirdparties/install/lib" go build
-ldflags="-extldflags '-L$(pwd)/cgo -lmo
-L$(pwd)/thirdparties/install/lib -Wl,-rpath,\\$ORIGIN/lib'"
./pkg/sql/schedule ./pkg/sql/colexec ./pkg/sql/compile
./pkg/vm/engine/disttae
- GOFLAGS=-mod=mod CGO_CFLAGS="-I$(pwd)/cgo
-I$(pwd)/thirdparties/install/include"
CGO_LDFLAGS="-L$(pwd)/thirdparties/install/lib -lusearch_c"
LD_LIBRARY_PATH="$(pwd)/cgo:$(pwd)/thirdparties/install/lib" go vet
-ldflags="-extldflags '-L$(pwd)/cgo -lmo
-L$(pwd)/thirdparties/install/lib -Wl,-rpath,\\$ORIGIN/lib'"
./pkg/sql/schedule ./pkg/sql/colexec ./pkg/sql/compile
./pkg/vm/engine/disttae
- GOFLAGS=-mod=mod CGO_CFLAGS="-I$(pwd)/cgo
-I$(pwd)/thirdparties/install/include"
CGO_LDFLAGS="-L$(pwd)/thirdparties/install/lib -lusearch_c"
LD_LIBRARY_PATH="$(pwd)/cgo:$(pwd)/thirdparties/install/lib" go test
-ldflags="-extldflags '-L$(pwd)/cgo -lmo
-L$(pwd)/thirdparties/install/lib -Wl,-rpath,\\$ORIGIN/lib'" -count=1
-timeout 240s ./pkg/sql/schedule ./pkg/sql/colexec ./pkg/sql/compile
./pkg/vm/engine/disttae
- GOFLAGS=-mod=mod CGO_CFLAGS="-I$(pwd)/cgo
-I$(pwd)/thirdparties/install/include"
CGO_LDFLAGS="-L$(pwd)/thirdparties/install/lib -lusearch_c"
LD_LIBRARY_PATH="$(pwd)/cgo:$(pwd)/thirdparties/install/lib" go test
-race -ldflags="-extldflags '-L$(pwd)/cgo -lmo
-L$(pwd)/thirdparties/install/lib -Wl,-rpath,\\$ORIGIN/lib'" -count=1
-timeout=240s -run
'Test(MessageSenderSendPipelineReturnsWhenSendObservesContextCancel|MessageSenderOnClientReceiveBatchReturnsStreamClosed|MessageSenderOnClientReceiveBatchContextDone|ReceiveMsgAndForward|ReceiveMessageFromCnServerIfConnector)'
./pkg/sql/compile

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working kind/refactor Code refactor size/L Denotes a PR that changes [500,999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants