Jackie-Jiang opened a new pull request, #18775:
URL: https://github.com/apache/pinot/pull/18775

   ## Summary
   
   `MailboxAssignmentVisitor` uses `SINGLETON` to represent a local exchange 
and asserts that sender worker `i` and receiver worker `i` are on the same 
server. For genuine local exchanges this holds by construction — the receiver 
worker map is copied from the sender via 
`WorkerManager#assignWorkersForLocalExchange`.
   
   A colocated semi-join is the exception. `PinotJoinToDynamicBroadcastRule` 
emits a `SINGLETON` `PIPELINE_BREAKER` exchange on the build side purely from 
the `is_colocated_by_join_keys` hint, and the build (sender) leaf and join 
(receiver) leaf are routed independently per table. During a rolling restart, 
some segments are temporarily not queryable, so each side may reroute a 
partition to a different replica — leaving worker `i` on different servers and 
failing the query with:
   
   ```
   IllegalStateException: Got different server for SINGLETON distribution type 
for worker id: ...
   ```
   
   ## Fix
   
   Fall back to a cross-server send for the diverged workers instead of 
throwing, mirroring the behavior the pre-partitioned direct-exchange path 
already had. The exchange stays correct because worker id still maps to the 
same partition on both sides; only locality (one extra network hop) is lost 
until routing re-stabilizes.
   
   Along the way:
   - The 1-to-1 SINGLETON branch, the SINGLETON-with-parallelism branch, and 
the pre-partitioned branch all funnel through a single `computeDirectExchange` 
helper, removing the duplicated mailbox-wiring logic.
   - The SINGLETON-with-parallelism branch no longer asserts co-location (it 
already wired the actual sender/receiver servers via 
`computeDirectExchangeWithParallelism`, so a cross-server send was already 
correct there).
   - The local-exchange validation now gates on `numSenders != numReceivers` 
rather than the rounded-down `parallelism`, so an unequal-but-non-multiple 
count (e.g. 2 senders / 3 receivers) is still rejected instead of silently 
falling into the 1-to-1 path.
   
   A `TODO` is left at the fallback site for a future optimization: matching 
the independently-routed sender/receiver worker assignments upfront so 
co-located data never has to cross the wire.
   


-- 
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]

Reply via email to