Current state: "Under Discussion"
Discussion thread: here
JIRA: here [Change the link from KAFKA-1 to your own ticket]
Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).
__consumer_offsets is an internal topic storing the offsets of consumer groups. Its partition count is used to determine group coordinators via the following formula leader_of_partition(abs(hash(CONSUMER_GROUP_NAME)) % __CONSUMER_OFFSETS_PARTITION_COUNT). The partition count can be increased similarly to any other topic, but the new number is only picked up on broker startup. Once a Kafka cluster is running in production it is a good practice for brokers to be restarted in a rolling manner to assure availability during upgrades (regardless of whether the upgrades are to the infrastructure, underlying OS, packages or Kafka itself). However, during a rolling restart a subset of brokers are using the old partition count and a subset of brokers are using the new one. This leaves consumer groups in undefined and erroring states for the duration of the fleet bounce. This KIP proposes brokers to start using the new partition count of __consumer_offsets without requiring a restart whenever they detect a change to the topic to minimise the time during which consumer groups are in undefined states.
Graphs to support the motivation

The above graph demonstrates the noticeable increase in FindCoordinator requests for the duration of a rolling restart on a 2 broker cluster. During the experiment no consumers were added or removed from the consumer group but such a change in a real situation would not trigger a consumer group rebalance.

The above graph demonstrates a noticeable drop in successful offset commits to __consumer_offsets for the duration of the rolling restart. This means that consumption progress is not being recorded.
No public interfaces will be changed.
Reference implementation: https://github.com/apache/kafka/compare/trunk...clolov:kafka:consumer_offsets
The proposal is for individual brokers to refresh the partition count of __consumer_offsets without requiring a restart whenever they detect a change in the topic. Currently, such a change is propagated in the cluster through a LeaderAndISR request sent to all affected brokers by the controller. There already is a branch in the code path which invokes specific behaviour if the affected topic is __consumer_offsets. We alter that code path and invoke the refresh method so that the GroupCoordinator entity starts using the new partition count.
The test setup which can reproduce the problem is as follows:
Setup
leader_of_partition(abs(hash(consumer_group)) % 55) = leader_of_partition(48) = broker 2.leader_of_partition(abs(hash(test_consumer_group)) % 65) = leader_of_partition(43) = broker 1Current (3.3.1) behaviour
I believe the above scenario (or its negative) can be added as an integration test once an approach which mitigates it has been implemented.