924060929 opened a new pull request, #65348:
URL: https://github.com/apache/doris/pull/65348
### What problem does this PR solve?
Related PR: #64793
Problem Summary:
PR #64793 decoupled an exchange's serial flag from the fragment's serial
scan under the FE local-shuffle planner, so a local-shuffle fragment can now
host a **non-serial** RANDOM/HASH exchange whose BE receiver runs on every
instance and waits for the full sender set.
However `DistributePlanner.filterInstancesWhichCanReceiveDataFromRemote`
still funnels the sender's destinations to the first instance per worker
whenever the receiver uses local shuffle (keyed on `LocalShuffleAssignedJob`),
and #64793 only added destination spreading for `BUCKET_SHUFFLE`, not for
RANDOM/HASH. So the sender addresses only instance 0 while the non-first
instances each build a receiver expecting the full sender set — they wait
forever for an EOS that never arrives, and a query such as an MV
partition-union rewrite (a RANDOM exchange feeding a UNION) hangs until query
timeout.
This PR gates the funnel on `ExchangeNode.isSerialOperatorOnBe` instead of
`LocalShuffleAssignedJob`: only a serial exchange runs a single receiver per
worker and may funnel to it; a non-serial exchange must address every receiver
instance. `BUCKET_SHUFFLE` is unchanged (it re-spreads by bucket in
`getDestinationsByBuckets`). This mirrors the `!isSerialOperatorOnBe` gate
already used there.
Verified end-to-end on a cloud single-BE cluster: the co-located `UNION <-
BUCKETED AGGREGATE <- OlapScan` plan hangs at query timeout before the fix and
returns in ~1s after it. Added `DistributePlannerReceiverDestinationTest`
covering the serial / non-serial / shared-broadcast-hash-table cases.
### Release note
Fix a query hang (until timeout) where a non-serial RANDOM/HASH exchange
feeding a local-shuffle receiver fragment addressed only the first instance per
worker, leaving the other instances waiting forever for sender EOS.
### Check List (For Author)
- Test
- [x] Unit Test
- [ ] Regression test
- [ ] Manual test
- [ ] No need to test or manual test.
- Behavior changed:
- [x] No.
- Does this need documentation?
- [x] No.
--
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]