At Current 2022, we introduced KIP-848: The Next Generation of the Consumer Rebalance Protocol. Almost a year after, its development is well under way! In this talk, we will dive into all aspects of the new protocol, look into the architecture of Apache Kafka's brand new group coordinator, discuss the upgrade path for both the consumers and the brokers, and finally update the community about where we stand in the development.
Apache Kafka's Next-Gen Rebalance Protocol: Towards More Stable and Scalable Consumer Groups
1. Apache Kafka's Next-Gen Rebalance Protocol
Towards More Stable and Scalable Consumer Groups
David Jacot
Apache Kafka PMC
Staff Software Engineer II, Confluent
2. Consumer Group 101
01
New Consumer Rebalance Protocol
02
New Group Coordinator
03
New Consumer
04
Conclusion
05
2
Agenda
81. Server Side Assignors
81
Your Own
● Pluggable
● PartitionAssignor
interface
Range
1 1 2 2
5 5
3 3 4 4
6 6
A
B
C
D
Uniform
1 3
5
5
3 1
2 4
6
4
4 2
A
B
C
D 6
82. Upgrade Path
● The new Group Coordinator is fully backward compatible.
● The new Group Coordinator will become the default in the
future release of Apache Kafka (version TBD).
82
86. New Configurations
● group.protocol (generic, consumer or auto)
○ generic - old consumer group protocol and threading model
○ consumer - new consumer group protocol and threading model
● group.local.assignors (default: null)
○ null means that the server uses the default one
86
88. Live Consumer Upgrade, How?
88
Group Coordinator
Group Foo
Consumer A
(group.protocol=generic)
Consumer B
(group.protocol=generic)
Consumer C
(group.protocol=generic)
Old Protocol
Old Protocol
Old Protocol
89. New Protocol
Live Consumer Upgrade, How?
89
Group Coordinator
Consumer A
(group.protocol=consumer)
Consumer B
(group.protocol=generic)
Consumer C
(group.protocol=generic)
Old Protocol
Old Protocol
Group Foo
90. New Protocol
Live Consumer Upgrade, How?
90
Group Coordinator
Consumer A
(group.protocol=consumer)
Consumer B
(group.protocol=generic)
Consumer C
(group.protocol=generic)
Old Protocol
Old Protocol
Group Foo
91. New Protocol
New Protocol
Live Consumer Upgrade, How?
91
Group Coordinator
Group Foo
Consumer A
(group.protocol=consumer)
Consumer B
(group.protocol=consumer)
Consumer C
(group.protocol=generic)
Old Protocol
92. New Protocol
New Protocol
New Protocol
Live Consumer Upgrade, How?
92
Group Coordinator
Group Foo
Consumer A
(group.protocol=consumer)
Consumer B
(group.protocol=consumer)
Consumer C
(group.protocol=consumer)
94. Where are we?
● ~120 pull requests merged so far!
● The new Group Coordinator is almost fully implemented.
● The new Consumer’s threading model is being merged to trunk.
We are working on implementing the new consumer group
protocol.
● Our aim is to release a preview of both soon!
94