-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for static membership (KIP-345) and required member ids (KIP-…
…394) KIP-345 adds static membership support. This means that a short period of inactivity of a consumer (e.g. code update) does not trigger a rebalance if the consumer registers again within session_timeout_ms. For now, only the JoinGroupRequest/Response and SyncGroupRequest/Response is adapted (seems to be sufficient to use the new interface). One can use this feature by setting the group_instance_id of AIOKafkaConsumer to a unique value per group member (and retain the value during restarts). Also, a new interface for partition assignors (AbstractStaticPartitionAssignor) has been added so assignors can use the group_instance_ids of all group members. This could be beneficial in containerized deployments, so each container could be assigned to its previous partitions after a rebalance occured. KIP-394 has been introduced to detect invalid JoinGroupRequests on the broker
- Loading branch information
Tobias Rauter
committed
Feb 28, 2020
1 parent
97e3bd2
commit cd44bdc
Showing
6 changed files
with
217 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from kafka.coordinator.assignors.abstract import AbstractPartitionAssignor | ||
import abc | ||
|
||
class AbstractStaticPartitionAssignor(AbstractPartitionAssignor): | ||
""" | ||
Abstract assignor implementation that also supports static assignments (KIP-345) | ||
""" | ||
|
||
|
||
@abc.abstractmethod | ||
def assign(self, cluster, members, member_group_instance_ids): | ||
"""Perform group assignment given cluster metadata, member subscriptions | ||
and group_instance_ids | ||
Arguments: | ||
cluster (ClusterMetadata): metadata for use in assignment | ||
members (dict of {member_id: MemberMetadata}): decoded metadata for | ||
each member in the group. | ||
mmember_group_instance_ids members (dict of {member_id: MemberMetadata}): decoded metadata for | ||
each member in the group. | ||
Returns: | ||
dict: {member_id: MemberAssignment} | ||
""" | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.