Table of Contents |
---|
Status
Current state: Under DiscussionAccepted
Discussion thread: here
JIRA: KAFKA-4925
Released: 0.11.0
Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).
...
We will add a new broker config: group.initial.rebalance.delay.ms
This config will specify the time, in milliseconds, that the GroupCoordinator should will use to delay the initial rebalance when the first member joins an empty group. Once the time has expired the rebalance will occur with any members that are part of the group.
Proposed Changes
Add the group.initial.rebalance.delay.ms to KafkaConfig with a default value of 3 seconds(?).
Change the GroupCoordinator so that upon receiving the initial JoinGroupRequest for a new or empty group, it will change the group’s state to InitialRebalance and delay the operation by min(rebalanceTimeout, group.initial.rebalance.delay.ms). If new members arrive when the group is in the InitialRebalance state, they will be added to the group . When and the delay will be reset to min(remainingRebalanceTimeout, group.initial.rebalance.delay.ms) . When the delay expires the group’s state will transition to PreparingRebalance and the join group will be completed.
...
- Existing users will see a delay in the initial rebalance. If this is not desired they can configure group.initial.rebalance.delay.ms to zero.
Test Plan
- Will add system tests with various settings timeouts and ensure we get the correct number of rebalances.
- Ensure all existing System/Integration/Unit tests continue to behave as before.
...
Add the delay config to the consumer and add new field to JoinGroupRequest: This would result in a protocol bump.
Use session.timeout.ms as the initial delay: We felt that this overloading of session.timeout.ms would be both confusing to users and make it more difficult to configure for all scenarios.
Derive the delay from session.timeout.ms: Same as above
- Fixed hard-coded delay: We didn’t feel that there is a magic delay that is going to work for everyone.