[ 
https://issues.apache.org/jira/browse/KAFKA-2042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14379015#comment-14379015
 ] 

Jun Rao commented on KAFKA-2042:
--------------------------------

If I start a console-producer w/o typing in any message, the producer actually 
doesn't send any metadata request immediately. On initializing the producer, we 
update metadata with the bootstrap broker. This sets lastRefreshMs to the 
current time. So, in NetworkClient.poll(), timeToNextMeatadataUpdate will 
actually be the metadata age, which defaults to 300 secs.

In what situation did you discover this problem?

> New producer metadata update always get all topics.
> ---------------------------------------------------
>
>                 Key: KAFKA-2042
>                 URL: https://issues.apache.org/jira/browse/KAFKA-2042
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: Jiangjie Qin
>            Assignee: Jiangjie Qin
>            Priority: Blocker
>             Fix For: 0.8.3
>
>         Attachments: KAFKA-2042.patch, KAFKA-2042_2015-03-24_13:37:49.patch, 
> KAFKA-2042_2015-03-24_13:57:23.patch
>
>
> The new java producer metadata.topics is initially empty so the producer 
> sends TMR with empty topic set. The broker takes the empty requested topic 
> set as all topics, so metadata.cluster contains all topic metadata. Later on, 
> when a new topic was produced, it gets added into the metadata.topics. The 
> next metadata update will only contain the meta data for this new topic, so 
> the metadata.cluster will only have this topic. Since there are a lot of 
> messages are still in the accumulator but has no metadata in 
> metadata.cluster, if a caller thread do a flush(), the caller thread will 
> block forever because the messages sitting in accumulator without metadata 
> will never be ready to send.
> We should add check for the metadata.topics, if it is empty, no TMR should be 
> sent.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to