【kafka】kafka rebalance generation

Insert picture description here

1 Overview

A consumer group can perform any rebalance. In order to better isolate the data on each rebalance, the new version of Consumer has designed the rebalance generation to identify a certain rebalance. The term generation is similar to the concept of "generation" in the JVM generational garbage collector (strictly speaking, JVM FUll GC uses generational). The author translates it into "session", which means the members of a session after rebalance. In the consumer, it is an integer, usually starting from 0. Kafka introduces consumer generation mainly to protect consumer group, especially to prevent invalid offset submission. For example, the last consumer member delayed the submission of the offset due to some reasons, but after the rebalance, the group produced a new group member, and the delayed offset submission carried the old generation information, so this submission will Rejected by the consumer group.

This is the reason why many Kafka users often encounter ILLEGAL GE positive abnormalities when using consumers. In fact, after each group is rebalanced, the generation number will increase by 1, indicating that the group has entered
a new version. As shown in the picture, Generat

Guess you like

Origin blog.csdn.net/qq_21383435/article/details/111413859