22

We have encountered few exception on production environment:

UnknownTopicOrPartitionException: This server does not host this topic-partition

As per my analysis, one possible workaround for this issue is increasing no of retries since this is a retriable exception.

I am facing some difficulties which reproducing this issue locally. I tried bringing down broker while producing but it is failing with TimeoutException.

I am looking for suggestions to reproduce this issue.

vatsal mevada
  • 5,148
  • 7
  • 39
  • 68
  • 1
    This usually happens when partition is electing the new leader. – amethystic Jun 13 '17 at 09:29
  • And as per my understanding that happens when the current leader goes down. Right? So by that logic when I am producing messages and I brings down current broker then I should be able to reproduce this exception? – vatsal mevada Jun 13 '17 at 14:55
  • What's your version of Kafka? Besides, I don't think it's easy to reproduce this issue. – amethystic Jun 14 '17 at 02:03
  • My kafka version is 0.10.0.1. Increasing the no of retries should reduce the possibility of this exception right? – vatsal mevada Jun 14 '17 at 06:52
  • 1
    `LeaderNotAvailableException` might be more possible to be observed on the producer side. `UnknownTopicOrPartitionException ` is more likely thrown by ReplicaFetcherThread. – amethystic Jun 14 '17 at 08:13
  • I have the same issue, all nodes are up , still it thinks other guy is down. I checked, network, hostname etc..seems like restart only solves it for short period of time. – chandank Oct 27 '17 at 17:37
  • I saw this log in the broker after killing all brokers as well as zookeeper, but leave the consumers running. Then wipe all zookeeper and kafka logs and restart zookeeper and the brokers. Will see these errors as well as timeouts on the consumer side like: `TimeoutException: Timeout of 60000ms expired before the position for partition mylocaltopic could be determined`. – awgtek Jul 22 '22 at 00:56

1 Answers1

10

If you get this error log during topic creation process, there is an open issue for this:

KAFKA-6221 ReplicaFetcherThread throws UnknownTopicOrPartitionException on topic creation

at some point of time during batch creating topics, it's likely that UpdateMetadata requests got processed later than FetchRequest, therefore metadata cache was not updated on a timely basis.

issue was about log messages that have no impact on cluster health.

gokhansari
  • 2,379
  • 1
  • 27
  • 33