kAFKA-9651:Handle edge case when partition metadata contains zero partitions#21609
kAFKA-9651:Handle edge case when partition metadata contains zero partitions#21609nileshkumar3 wants to merge 4 commits intoapache:trunkfrom
Conversation
|
@tombentley Can you review this |
|
@nileshkumar3 , thanks for the PR! Please help change the PR title to prefix with Also, please make the PR description format correct and clear. Thanks. |
|
Note: Although the producer side already has validated the partition size is > 0, the stream side (like here) I cannot see all places have the partition size validation. Adding a validation in the partitionFor makes sense to me to avoid missing validation. When we have a fail use case reported, I think we should fix in the root to have re-fetch metadata mechanism or something. |
|
@showuon Added validation in StreamsMetadataState. |
Is this really needed? Let's say, if you don't have the change in the commit: 86511ce , the |
yes what you think make sense. we should add validation at the root. before streamsMetadataState.onChange in StreamThread and StreamsPartitionAssginor. |
Handle edge case where partition metadata contains zero partitions.
Add a defensive check in the producer partition selection path to avoid operating on an empty partition list.
This improves robustness during transient metadata states.