Closed
Description
This ticket is a result of aio-libs/aiokafka#176. The issue is that producer will raise UnknownTopicOrPartitionError to the user if a manual partition reassignment is in process.
How to reproduce:
- Create a multi-broker cluster, for ex. as here https://kafka.apache.org/quickstart#quickstart_multibroker. Say we have 3 nodes:
broker0
,broker1
,broker2
- Set a producer that sends 1 message per second to the replicated topic
- Kill one of the nodes (say
broker2
) and launch another oner with a new config (new nodebroker3
). - Reassign partitions to the new node using instructions here https://kafka.apache.org/documentation/#basic_ops_automigrate
- You will get UnknownTopicOrPartitionError immediately on the producer.
As I understand NotLeaderForPartition
is only raised if node actually contains replication data on it. On reassignment a previous Leader partition will migrate data to a new node and remove it's data, so the error raised will be UnknownTopicOrPartitionError instead.
Java client treats UnknownTopicOrPartitionError
as retriable too:
https://kafka.apache.org/protocol#protocol_error_codes
https://github.com/apache/kafka/blob/0.11.0.0/clients/src/main/java/org/apache/kafka/common/errors/UnknownTopicOrPartitionException.java
Metadata
Metadata
Assignees
Labels
No labels