Issue Description
A consumer group is constantly in PreparingRebalance
status.
Possible Causes
1. A new consumer joins the consumer group.
2. A running consumer stops running and leaves the consumer group. Common causes for this include consumer restart, consumer application crash, and heartbeat timeout of consumer process reporting. For more information, see Configuration Guide for Common Parameters in CKafka. 3. The number of partitions changes (partitions are added or deleted).
Solutions
Rebalancing is inevitable in cases 1 and 3. Normally, rebalancing can be completed in 30s. If there is a longer rebalancing process, submit a ticket for assistance. If the rebalancing is caused by heartbeat timeout or excessive interval between two polls, you can adjust the following parameters:
session.timeout.ms=10000
heartbeat.interval.ms=3000
max.poll.interval.ms=300000
If a consumer subscribes to many topics, you can try reducing the topics to which the consumer group subscribes.
Was this page helpful?