yashmayya opened a new pull request, #19173:
URL: https://github.com/apache/pinot/pull/19173

   A colocated join can return wrong rows when broker pruning is on. This fixes 
it.
   
   ## The problem
   
   A leaf stage without partition metadata gets one worker per server. Worker 
`n` means "the n-th server, in instance id order".
   
   A colocated join wires the exchange 1-to-1. Worker `n` of one side sends to 
worker `n` of the other side. This is correct only while both sides route over 
the same servers.
   
   Broker pruning decides which servers reach that list. A filter can eliminate 
a different server on each side. Each side then numbers its workers 
differently, and the join pairs rows from two different servers.
   
   Nothing reports the error. Neither side carries a partition class list, so 
`MailboxAssignmentVisitor#checkPartitionClassAgreement` returns without a 
comparison. The query gives wrong results and no exception.
   
   ## The fix
   
   A pre-partitioned leaf now skips broker pruning. It routes without a filter, 
which is what it already does when broker pruning is off.
   
   Two paths need the guard:
   
   - `assignWorkersToNonPartitionedLeafFragment` for a physical table
   - `assignWorkersToNonPartitionedLeafFragmentForLogicalTable` for a logical 
table
   
   ## The cost
   
   These leaves lose the segment pruning that they get today. Their fan-out 
returns to the unpruned size.
   
   The loss is small. This path serves tables that have no partition metadata 
in Pinot. The partition segment pruner needs that metadata, so it prunes 
nothing here. Only the empty-segment pruner and the time pruner apply.
   
   ## Tests
   
   - `testBrokerPruningSkippedForPrePartitionedNonPartitionedLeaf` gives the 
two sides different filtered routing tables. Both sides keep every server, and 
the captured routing request carries no filter.
   - `testBrokerPruningStillAppliesToNonPrePartitionedNonPartitionedLeaf` runs 
the same shape without the colocation hint. That plan is shuffled, so pruning 
stays on and the leaf keeps one worker.
   


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