You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Monika Garg <ga...@gmail.com> on 2013/10/25 11:39:24 UTC

Please explain the behaviour of bin/kafka-list-topic.sh command

Hi

My zookeeper node in Kafka is storing the data for a partition like this:

{ "controller_epoch":3, "isr":[ 1, 3 ], "leader":1, "leader_epoch":1,
"version":1 }

So what I am thinking is the command *bin/kafka-list-topic.sh *uses the
above data from zookeeper in fetching the its output* + *some additional
info the command provides is replicas.

The  command output is like this:

topic: newTopic    partition: 0    leader: 1    replicas: 3,1    isr: 1,3
topic: newTopic    partition: 1    leader: 3    replicas: 1,3    isr: 3,1

1.So where from the replicas details the command(bin/kafka-list-topic.sh)
fetches.

2. When I am stopping my broker-3,it should be removed from "isr":[1,3] of
zookeeper,as broker-3 is no more a living node now.But it is not getting
removed from there and might be thats why I am getting the
command(bin/kafka-list-topic.sh) as below:

topic: newTopic    partition: 0    leader: 1    replicas: 3,1    isr: 1,3
topic: newTopic    partition: 1    leader: 1    replicas: 1,3    isr: 1,3

*which is not correct*.

Please help in understanding the behaviour and output.



-- 
*Moniii*

Re: Please explain the behaviour of bin/kafka-list-topic.sh command

Posted by Jun Rao <ju...@gmail.com>.
1. The information is obtained from ZK. For details, see
https://cwiki.apache.org/confluence/display/KAFKA/Kafka+data+structures+in+Zookeeper

2. Broker 3 should be dropped our of isr. Are you running the latest code
from the 0.8 branch? Any error in the controller and state-change log?

Thanks,

Jun


On Fri, Oct 25, 2013 at 2:39 AM, Monika Garg <ga...@gmail.com> wrote:

> Hi
>
> My zookeeper node in Kafka is storing the data for a partition like this:
>
> { "controller_epoch":3, "isr":[ 1, 3 ], "leader":1, "leader_epoch":1,
> "version":1 }
>
> So what I am thinking is the command *bin/kafka-list-topic.sh *uses the
> above data from zookeeper in fetching the its output* + *some additional
> info the command provides is replicas.
>
> The  command output is like this:
>
> topic: newTopic    partition: 0    leader: 1    replicas: 3,1    isr: 1,3
> topic: newTopic    partition: 1    leader: 3    replicas: 1,3    isr: 3,1
>
> 1.So where from the replicas details the command(bin/kafka-list-topic.sh)
> fetches.
>
> 2. When I am stopping my broker-3,it should be removed from "isr":[1,3] of
> zookeeper,as broker-3 is no more a living node now.But it is not getting
> removed from there and might be thats why I am getting the
> command(bin/kafka-list-topic.sh) as below:
>
> topic: newTopic    partition: 0    leader: 1    replicas: 3,1    isr: 1,3
> topic: newTopic    partition: 1    leader: 1    replicas: 1,3    isr: 1,3
>
> *which is not correct*.
>
> Please help in understanding the behaviour and output.
>
>
>
> --
> *Moniii*
>