[
https://issues.apache.org/jira/browse/FLINK-6263?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16843135#comment-16843135
]
Truong Duc Kien commented on FLINK-6263:
----------------------------------------
I think this is a duplicate of https://issues.apache.org/jira/browse/FLINK-3066
The workaround mentioned in that bug is
{quote}Set the number of retries to a value above 0. By default Kafka sets it
to 0 to avoid duplicates.
{quote}
> Leader error in Kafka producer on leader change (broker restart/failrue)
> ------------------------------------------------------------------------
>
> Key: FLINK-6263
> URL: https://issues.apache.org/jira/browse/FLINK-6263
> Project: Flink
> Issue Type: Bug
> Components: Connectors / Kafka
> Affects Versions: 1.2.0
> Reporter: Gyula Fora
> Priority: Major
>
> We have observed the following error in the Kafka producer
> java.lang.Exception: Failed to send data to Kafka: This server is not the
> leader for that topic-partition.
> at
> org.apache.flink.streaming.connectors.kafka.FlinkKafkaProducerBase.checkErroneous(FlinkKafkaProducerBase.java:376)
> at
> org.apache.flink.streaming.connectors.kafka.FlinkKafkaProducerBase.invoke(FlinkKafkaProducerBase.java:293)
> at
> org.apache.flink.streaming.api.operators.StreamSink.processElement(StreamSink.java:38)
> at
> org.apache.flink.streaming.runtime.io.StreamInputProcessor.processInput(StreamInputProcessor.java:185)
> at
> org.apache.flink.streaming.runtime.tasks.OneInputStreamTask.run(OneInputStreamTask.java:63)
> at
> org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:261)
> at org.apache.flink.runtime.taskmanager.Task.run(Task.java:656)
> at java.lang.Thread.run(Thread.java:745)
> Caused by: org.apache.kafka.common.errors.NotLeaderForPartitionException:
> This server is not the leader for that topic-partition.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)