Repository navigation
fix: preserve block filters for remote table scans - #27043
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.
Deep reviewed at 907f265. The remote range-expansion invariant is restored without exporting coordinator-owned Fold executor IDs or mutating reusable scope templates: raw block predicates are copied per message, session variables are folded before serialization, and the receiving Compile creates and frees its own Fold executors. Exact base/head round-trip evidence shows the base drops the block filter while this head restores it. I also checked nested scopes, empty scalar literals, old-sender/new-receiver compatibility, error cleanup, generation/reuse boundaries, and integration with current main 6b81a6d. Focused tests, adaptive race stress (3 tests x100), full compile tests/race, build, vet, and dependent frontend build pass. No blocking findings. The repository-wide Ubuntu UT job is still in progress; all completed CI checks are green.
Merge Queue Status
This pull request spent 17 minutes 22 seconds in the queue, with no time running CI. Waiting for
All conditions
ReasonPull request #27043 has been dequeued Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.
Failing checks:
HintYou should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. Tick the box to put this pull request back in the merge queue (same as
|
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue #26960 ## What this PR does / why we need it: Backport of #27043 to 4.2-dev. Remote table-scan pipelines serialized the plan node, but the receiving CN never restored Node.BlockFilterList into its execution Source. Remote range expansion therefore received no block predicates and scanned the full committed persisted partition. This change: - carries raw block-filter expressions in a per-message node copy without mutating the reusable coordinator scope; - folds session variables before serialization, then creates and evaluates receiver-owned Fold executors on the remote CN; - restores block filters for old-sender/new-receiver rolling upgrades; - keeps decoded scopes as raw reusable templates and preserves empty scalar literals across protobuf serialization. Validation: - GOWORK=off go build -mod=readonly ./pkg/sql/compile - GOWORK=off go vet -mod=readonly ./pkg/sql/compile - focused remote block-filter regression tests - focused race stress for all three new tests with count=100 - full pkg/sql/compile tests, with and without the race detector Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
## 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#26960 ## What this PR does / why we need it: Remote table-scan pipelines serialized the plan node, but the receiving CN never restored Node.BlockFilterList into its execution Source. Remote range expansion therefore received no block predicates and scanned the full committed persisted partition. This change: - carries raw block-filter expressions in a per-message node copy without mutating the reusable coordinator scope; - folds session variables before serialization, then creates and evaluates receiver-owned Fold executors on the remote CN; - restores block filters for old-sender/new-receiver rolling upgrades; - keeps decoded scopes as raw reusable templates and preserves empty scalar literals across protobuf serialization. Validation: - GOWORK=off go build -mod=readonly ./pkg/sql/compile - GOWORK=off go vet -mod=readonly ./pkg/sql/compile - GOWORK=off go test -mod=readonly -count=1 -timeout=10m ./pkg/sql/compile - focused remote block-filter regression tests with -race -count=100 - GOWORK=off go test -mod=readonly -race -count=1 -timeout=15m ./pkg/sql/compile Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
## 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#26960 ## What this PR does / why we need it: Remote table-scan pipelines serialized the plan node, but the receiving CN never restored Node.BlockFilterList into its execution Source. Remote range expansion therefore received no block predicates and scanned the full committed persisted partition. This change: - carries raw block-filter expressions in a per-message node copy without mutating the reusable coordinator scope; - folds session variables before serialization, then creates and evaluates receiver-owned Fold executors on the remote CN; - restores block filters for old-sender/new-receiver rolling upgrades; - keeps decoded scopes as raw reusable templates and preserves empty scalar literals across protobuf serialization. Validation: - GOWORK=off go build -mod=readonly ./pkg/sql/compile - GOWORK=off go vet -mod=readonly ./pkg/sql/compile - GOWORK=off go test -mod=readonly -count=1 -timeout=10m ./pkg/sql/compile - focused remote block-filter regression tests with -race -count=100 - GOWORK=off go test -mod=readonly -race -count=1 -timeout=15m ./pkg/sql/compile Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
## 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#26960 ## What this PR does / why we need it: Remote table-scan pipelines serialized the plan node, but the receiving CN never restored Node.BlockFilterList into its execution Source. Remote range expansion therefore received no block predicates and scanned the full committed persisted partition. This change: - carries raw block-filter expressions in a per-message node copy without mutating the reusable coordinator scope; - folds session variables before serialization, then creates and evaluates receiver-owned Fold executors on the remote CN; - restores block filters for old-sender/new-receiver rolling upgrades; - keeps decoded scopes as raw reusable templates and preserves empty scalar literals across protobuf serialization. Validation: - GOWORK=off go build -mod=readonly ./pkg/sql/compile - GOWORK=off go vet -mod=readonly ./pkg/sql/compile - GOWORK=off go test -mod=readonly -count=1 -timeout=10m ./pkg/sql/compile - focused remote block-filter regression tests with -race -count=100 - GOWORK=off go test -mod=readonly -race -count=1 -timeout=15m ./pkg/sql/compile Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #26960
What this PR does / why we need it:
Remote table-scan pipelines serialized the plan node, but the receiving CN never restored Node.BlockFilterList into its execution Source. Remote range expansion therefore received no block predicates and scanned the full committed persisted partition.
This change:
Validation: