You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Thanh Hong Dai <hd...@tma.com.vn> on 2015/11/11 11:57:57 UTC

Why do we need broker id in the Zookeeper directory for consumer offset?

According to the documentation:

 

Consumer Offsets

Consumers track the maximum offset they have consumed in each partition.
This value is stored in a ZooKeeper directory if offsets.storage=zookeeper.
This valued is stored in a ZooKeeper directory. 

 

/consumers/[group_id]/offsets/[topic]/[broker_id-partition_id] -->
offset_counter_value (persistent node)

 

Why is broker id part of the path? Isn't partition_id + topic + group_id
sufficient?

 

This design also raises another question: What would happen when one of the
broker dies, but the partition is replicated elsewhere and can be read? Do
we have to read the partition from the beginning (since we need to read from
another broker, the broker id changes), or is there any mechanism to
identify that the offset is still usable?