kafka
protocol_error
ai_generated
true
org.apache.kafka.common.errors.RebalanceInProgressException: Rebalance in progress; cannot complete assignment
ID: kafka/rebalance-protocol-mismatch
85%Fix Rate
88%Confidence
1Evidence
2024-02-15First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.5.0 | active | — | — | — |
| 3.6.0 | active | — | — | — |
| 3.7.0 | active | — | — | — |
Root Cause
Consumer group protocol mismatch between static membership and dynamic assignment triggers rebalance loop.
generic中文
消费者组的静态成员和动态分配协议不匹配,导致重平衡循环。
Official Documentation
https://kafka.apache.org/documentation/#consumerrebalanceWorkarounds
-
80% success Set 'partition.assignment.strategy' to 'org.apache.kafka.clients.consumer.RangeAssignor' and ensure all consumers use the same protocol version.
Set 'partition.assignment.strategy' to 'org.apache.kafka.clients.consumer.RangeAssignor' and ensure all consumers use the same protocol version.
-
85% success Disable static group membership by removing group.instance.id from consumer config and rebalance with 'KafkaConsumer#enforceRebalance'.
Disable static group membership by removing group.instance.id from consumer config and rebalance with 'KafkaConsumer#enforceRebalance'.
-
90% success Upgrade broker to 3.7+ and enable cooperative rebalance protocol with 'CooperativeStickyAssignor'.
Upgrade broker to 3.7+ and enable cooperative rebalance protocol with 'CooperativeStickyAssignor'.
中文步骤
设置 'partition.assignment.strategy' 为 'org.apache.kafka.clients.consumer.RangeAssignor',并确保所有消费者使用相同的协议版本。
从消费者配置中移除 group.instance.id 以禁用静态成员,并使用 'KafkaConsumer#enforceRebalance' 触发重平衡。
升级代理到 3.7+ 并使用 'CooperativeStickyAssignor' 启用协作式重平衡协议。
Dead Ends
Common approaches that don't work:
-
90% fail
Restarting does not resolve protocol mismatch; rebalance triggers again on rejoin.
-
70% fail
Longer timeout delays detection but does not fix assignment logic.
-
60% fail
Removing static membership may cause duplicate assignments and offset commits.