BiteTheDDDDt opened a new pull request, #65919:
URL: https://github.com/apache/doris/pull/65919
### What problem does this PR solve?
Issue Number: None
Related PR: None
Problem Summary:
A query can finish planning and then wait in a Workload Group queue before
its plan is serialized. If a selected RANGE or LIST partition is replaced
during that wait, runtime-filter target metadata still references the planned
partition ID, while `OlapScanNode` previously rebuilt runtime-filter partition
boundaries from the current catalog during Thrift serialization. The removed
partition ID was therefore absent from the boundaries sent to BE, which
violated the runtime-filter partition-pruning invariant and failed the query
with `boundary_partition_ids.contains(partition_id)`.
This change snapshots runtime-filter partition boundaries during planning,
from the same catalog view used to select partitions and build scan ranges. It
also snapshots selected partition names so profile/explain generation does not
look up a partition that was replaced after planning. No BE or Thrift protocol
changes are required.
The FE unit test snapshots a RANGE-partitioned scan, mutates the live
`PartitionInfo` and partition map to simulate `REPLACE PARTITION`, and verifies
that serialization and explain output continue to use the planned partition IDs
and names.
### Release note
Fix queued runtime-filter queries failing when selected partitions are
replaced after planning.
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [ ] Regression test
- [x] Unit Test
- `./run-fe-ut.sh --run
org.apache.doris.planner.OlapScanNodeTest#testRuntimeFilterPartitionBoundariesUsePlanningSnapshot,org.apache.doris.nereids.glue.translator.RuntimeFilterPartitionPruneClassifierTest`
- `./build.sh --fe`
- [x] Manual test (add detailed scripts or steps below)
- Reproduced on query port 9333 by queueing an RF partition-pruning
query, replacing its selected partition, and releasing the queue blocker.
- The queued query returned the planned snapshot (`1 | 900`), a new
query returned the replacement data (`1 | 1900`), and BE remained alive.
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason <!-- Add your reason? -->
- Behavior changed:
- [ ] No.
- [x] Yes. Queued queries keep runtime-filter partition metadata and
explain names from their planning snapshot.
- Does this need documentation?
- [x] No.
- [ ] Yes. <!-- Add document PR link here. eg:
https://github.com/apache/doris-website/pull/1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR should
merge into -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]