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

   ## Problem
   
   The broker builds a segment's partition function from its ZK partition 
metadata in `SegmentPartitionUtils`. Bad metadata JSON and a missing column are 
already caught and turned into "no valid partition info", but the 
`PartitionFunctionFactory` call was not. When the broker cannot build the 
function, it throws out of the routing build and **one segment fails routing 
for the whole table** (`PUT /routing` returns 500, and the partition pruner and 
`SegmentPartitionMetadataManager` cannot initialize). This happens when:
   
   - the function name is unknown to this broker, e.g. written by a newer 
version during a rolling upgrade or rollback, or registered by a plugin that is 
not on the broker's classpath, or
   - the function config is invalid for the function.
   
   ## Change
   
   Both paths now handle it the same way as invalid metadata JSON:
   
   - `extractPartitionInfo` (single partition column) returns 
`INVALID_PARTITION_INFO`, so the segment is never pruned.
   - `extractPartitionInfoMap` (multiple partition columns) drops only the 
column whose function cannot be built and keeps the others.
   
   The failure is logged at WARN with the function name, column, segment and 
table. The rest of the table keeps routing and pruning normally.
   
   ## Tests
   
   - `SegmentPartitionUtilsTest.testUnbuildablePartitionFunctionIsInvalid`: 
single column returns `INVALID_PARTITION_INFO`; multi column keeps the 
buildable column and drops the other.
   - 
`SinglePartitionColumnSegmentPrunerTest.testUnbuildablePartitionFunctionKeepsSegmentAndTableRoutable`:
 the pruner initializes with one unknown-function segment, keeps that segment 
for every predicate and still prunes the others; `refreshSegment` with an 
unknown function does the same.
   
   Both fail without the change (`IllegalArgumentException: No partition 
function registered for name: NoSuchPartitionFunction`). All `pinot-broker` 
routing tests (272) pass.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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