[ https://issues.apache.org/jira/browse/KAFKA-6046?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16198932#comment-16198932
]
Ted Yu commented on KAFKA-6046:
-------------------------------
Looking at core/src/main/scala/kafka/server/DelayedDeleteRecords.scala :
{code}
case Some(partition) =>
if (partition eq ReplicaManager.OfflinePartition) {
(false, Errors.KAFKA_STORAGE_ERROR, DeleteRecordsResponse.INVALID_LOW_WATERMARK)
} else {
partition.leaderReplicaIfLocal match {
case Some(_) =>
val leaderLW = partition.lowWatermarkIfLeader
(leaderLW >= status.requiredOffset, Errors.NONE, leaderLW)
case None =>
(false, Errors.NOT_LEADER_FOR_PARTITION, DeleteRecordsResponse.INVALID_LOW_WATERMARK)
}
}
{code}
It seems NOT_LEADER_FOR_PARTITION is covered.
> DeleteRecordsRequest to a non-leader
> ------------------------------------
>
> Key: KAFKA-6046
> URL: https://issues.apache.org/jira/browse/KAFKA-6046
> Project: Kafka
> Issue Type: Bug
> Reporter: Tom Bentley
> Fix For: 1.1.0
>
>
> When a `DeleteRecordsRequest` is sent to a broker that's not the leader for the partition
the `DeleteRecordsResponse` returns `UNKNOWN_TOPIC_OR_PARTITION`. This is ambiguous (does
the topic not exist on any broker, or did we just sent the request to the wrong broker?),
and inconsistent (a `ProduceRequest` would return `NOT_LEADER_FOR_PARTITION`).
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
|