[ https://issues.apache.org/jira/browse/KAFKA-9335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17009915#comment-17009915 ]
ASF GitHub Bot commented on KAFKA-9335: --------------------------------------- abbccdda commented on pull request #7904: KAFKA-9335: Fix StreamPartitionAssignor regression in repartition topics counts URL: https://github.com/apache/kafka/pull/7904 This PR fixes the regression introduced in 2.4 from 2 refactoring PRs: https://github.com/apache/kafka/pull/7249/ https://github.com/apache/kafka/pull/7419/ The bug was introduced by having a logical path leading `numPartitionsCandidate` to be 0, which is assigned to `numPartitions` and later being checked by `setNumPartitions`. In the subsequent check we will throw illegal argument if the `numPartitions` is 0. This bug is both impacting new 2.4 application and upgrades to 2.4 in certain types of topology. The example in original JIRA was imported as a new integration test to guard against such regression. We also verify that without the bug fix application will still fail by running this integration test. ### Committer Checklist (excluded from commit message) - [ ] Verify design and implementation - [ ] Verify test coverage and CI build status - [ ] Verify documentation (including upgrade notes) ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > java.lang.IllegalArgumentException: Number of partitions must be at least 1. > ---------------------------------------------------------------------------- > > Key: KAFKA-9335 > URL: https://issues.apache.org/jira/browse/KAFKA-9335 > Project: Kafka > Issue Type: Bug > Components: streams > Affects Versions: 2.4.0 > Reporter: Nitay Kufert > Assignee: Boyang Chen > Priority: Blocker > Labels: bug > > Hey, > When trying to upgrade our Kafka streams client to 2.4.0 (from 2.3.1) we > encountered the following exception: > {code:java} > java.lang.IllegalArgumentException: Number of partitions must be at least 1. > {code} > It's important to notice that the exact same code works just fine at 2.3.1. > > I have created a "toy" example which reproduces this exception: > [https://gist.github.com/nitayk/50da33b7bcce19ad0a7f8244d309cb8f] > and I would love to get some insight regarding why its happening / ways to > get around it > > Thanks -- This message was sent by Atlassian Jira (v8.3.4#803005)