Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Status

Current state: AcceptedAdopted for 2.6

Vote thread[Vote] KIP-571: Add option to force remove members in StreamsResetter

...

Sometimes people want to reset the stream application sooner but blocked by the left-over members inside the group coordinator, which only expires after session timeout. When the user configures a long session timeout, it could prevent the group from clearing. We should consider adding support to clean up members by forcing them to leave the group. To do that, we could enhance KafkaAdminClient#removeMembersFromConsumerGroup to support remove all members(static&dynamic) in a certain group.

...

The old constructor RemoveMembersFromConsumerGroupOptions(Collection<MemberToRemove>members) will imply the non removeAll or remove-specific members scenario and it will throw IllegalArgumentException if empty members is provided.

When the newly added constructor RemoveMembersFromConsumerGroupOptions() is used, it implies the removeAll scenario, underlyingly it set field members to an empty set and removeAll() will return true, in this case, KafkaAdminClient#removeMembersFromConsumerGroup will remove all members in the given group, it will first query the members of the given group and then issue a LeaveGroupRequest with all members specified. Accordingly, the RemoveMembersFromConsumerGroupResult also adds a new private method removeAll() to imply different handling in RemoveMembersFromConsumerGroupResult#all,memberResult. .Under the removeAll scenario, RemoveMembersFromConsumerGroupResult#memberInfos should be empty, the memberResult() is not applicable, the all() should directly check if RemoveMembersFromConsumerGroupResult#future 100% succeed, if not, it will throw the first exception it captured.

2) Add cmdline option --force to StreamsResetter

While with the new option, the StreamsResetter will force remove all active members by calling KafkaAdminClient#removeMembersFromConsumerGroup with removeAll speicified specified. All the deleted members' info will be logged out if all removals succeed. Otherwise,  the first member removal error will be thrown. 

...