nileshkumar3 commented on PR #21609: URL: https://github.com/apache/kafka/pull/21609#issuecomment-3995012467
> > > Note: Although the producer side already has validated the partition size is > 0, the stream side (like [here](https://github.com/apache/kafka/blob/c77a96d13238c3127dc8cf016d437efb5e64bfa9/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamsMetadataState.java#L480)) 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](https://github.com/apache/kafka/commit/86511ce4ddff31128b884cc008ee0efc8e7157fa) , the `shouldFailWhenSourceTopicHasNoPartitionsInMetadata` test can still pass because the `IllegalStateException` will be thrown in the `partitionForKey` method, right? I mean, if possible, we should fix from the root, instead of adding validation here and there, but still fail the application. WDYT? yes what you think make sense. we should add validation at the root. before streamsMetadataState.onChange in StreamThread and StreamsPartitionAssginor. -- 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]
