Akanksha-kedia opened a new pull request, #18715: URL: https://github.com/apache/pinot/pull/18715
## Description `IdealState.getInstanceStateMap(segmentName)` can return `null` when a segment exists in the partition set but has no instance assignments (e.g., during cluster initialization or partition rebalance). The previous code called `.containsValue()` directly on the result without a null check, which would throw a `NullPointerException`. ## Fix Extract `getInstanceStateMap()` result to a local variable and guard the `containsValue` call: - If `instanceStateMap` is `null`, treat the segment as non-consuming (safe default: include it in the result) ## Tests Existing unit tests cover this code path. No functional behavior change for the normal case (non-null map). ## Checklist - [x] No new public APIs without documentation - [x] Backward compatible change - [x] Code follows existing patterns in the codebase -- 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]
