tencent cloud

Feedback

Consumer Group Constantly in PreparingRebalance Status

Last updated: 2024-01-09 14:57:56

    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:
    # Consumer timeout period when the Kafka consumer grouping mechanism is used. If the broker does not receive the heartbeat of the consumer within this period, the consumer will be considered to have failed and the broker will initiate the rebalancing process. Currently, the value of this parameter must fall between 6,000 (value of `group.min.session.timeout.ms`) and 300,000 (value of `group.max.session.timeout.ms`) in the broker.
    session.timeout.ms=10000
    
    # Interval at which the consumer sends a heartbeat when the Kafka consumer grouping mechanism is used. The value of this parameter must be smaller than `session.timeout.ms`, typically less than one-third of it.‌
    heartbeat.interval.ms=3000
    
    # Maximum interval allowed for calling the poll again when the Kafka consumer grouping mechanism is used. If the poll is not called within this time period, the consumer will be considered to have failed and the broker will reinitiate rebalancing to assign the partitions to other consumers.
    max.poll.interval.ms=300000
    If a consumer subscribes to many topics, you can try reducing the topics to which the consumer group subscribes.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support