You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by Wenhao Ji <pr...@gmail.com> on 2021/07/19 15:52:16 UTC

[DISCUSS] [KAFKA-7572] Producer should not send requests with negative partition id

Hi everyone,

I would like to start a discussion about KAFKA-7572 [1] and its
corresponding pull request [2].

The ticket is about a bug that will happen if a user-defined
partitioner returns a negative partition number. KafkaProducer will
try to send this record to a nonexistent partition again and again
until timeout. And eventually, it will print a confusing error log.

The current problem of the PR is that whether we should
- throw an IllegalArgumentException
- or introduce another kind of KafkaException subclass (e.g.
InvalidPartitionException)
when a partitioner returns a negative integer.

As the pull request has not been reviewed for several months since the
last review and I cannot click the "Re-request review" on Github, I
would appreciate it if someone could help me review the code again and
also join us and share some thoughts about the problem.

[1] https://issues.apache.org/jira/browse/KAFKA-7572
[2] https://github.com/apache/kafka/pull/10525

Thanks,
Wenhao