What will happen to consumer offsets when a new partition is added? Does it stay the same?
标签:
apache-kafka
相关问题
- Delete Messages from a Topic in Apache Kafka
- Serializing a serialized Thrift struct to Kafka in
- Kafka broker shutdown while cleaning up log files
- Getting : Error importing Spark Modules : No modul
- How to transform all timestamp fields when using K
相关文章
- Kafka doesn't delete old messages in topics
- Kafka + Spark Streaming: constant delay of 1 secon
- Spring Kafka Template implementaion example for se
- How to fetch recent messages from Kafka topic
- Determine the Kafka-Client compatibility with kafk
- Kafka to Google Cloud Platform Dataflow ingestion
- Kafka Producer Metrics
- Spark Structured Streaming + Kafka Integration: Mi
Assuming you're talking about the high level consumer/consumer groups, consumer offsets stay the same because offsets are specific to partitions. So, the consumer will begin consuming from the new partition at the beginning or end or at time t depending on the configured start offset. For instance, if the consumer has already consumed up to offset 100000 in partition 1 and 120000 in partition 2, when you add a third partition the consumer will discover the new partition after some period through polling and only reset the offset for that new partition.
One important thing to keep in mind when altering the set of partitions in a topic is hot spotting. If you add a new partition to the topic, historical messages will still be spread across the old partitions, so assuming you're using basic round-robin/hash partitioning the data in the old partitions will remain significantly larger than the data in the new partitions until all partitions have grown large enough for old segments of the old partitions to be deleted.
Yes, it stays the same.
An offset is maintained for each partition separately, so your new partition's offset will start from 0 and won't affect other offsets.