Versions Compared

Key

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

Table of Contents

Status

Current state: "Under Discussion"  Accepted

Discussion thread: here

Vote thread"Will update after discussion" here

JIRA: KAFKA-19784

PR: https://github.com/apache/kafka/pull/20691

...


However, when users call AdminClient.describeConsumerGroups(), the returned MemberDescription objects do not include this rack information. The rack ID is available in the wire protocol but is discarded during response processing in DescribeConsumerGroupsHandler.

The Similar case is for AdminClient.describeShareGroups().
The current status can be summarized as follows:


✅ 是✅ 是✅ 是

Class

Type of Group

contain RackId? 

protocoal response contain rackId?

MemberDescription

Consumer Group

✅ 

ShareMemberDescription

Share Group

❌ 

✅ 

StreamsGroupMemberDescription

Streams Group

✅ 

✅ 

Problem Statement


This limitation creates several issues:

...

kafkaConsumerConfig.customConfig(ConsumerConfig.CLIENT_ID_CONFIG, generateClientIdWithRack(ip, rack));

Image RemovedImage Added


Public Interfaces

...

Code Block
languagejava
titleMemberDescription
public class MemberDescription {
    private final String memberId;
    private final Optional<String> groupInstanceId;
    private final Optional<String> rackId;  // NEWnew FIELDfield
    private final String clientId;
    //omit other codes        
    public Optional<String> rackId() {  // new method
       return rackId;
    }
    //omit other codes
}

2.  Add rack ID support to org.apache.kafka.clients.admin.MemberDescriptionShareMemberDescription:

Code Block
languagejava
title ShareMemberDescription
public class ShareMemberDescription{     
    private final String memberId;
    private final Optional<String> rackId; // NEWnew FIELD field
    private private final String clientId;
    //omit other codes        
    public Optional<String> rackId() {  // new method
       return rackId;
    }
    //omit other codes
}

Proposed Changes

 You can refer to https://github.com/apache/kafka/pull/20691:

...

  • Mark old constructor as @Deprecated immediately
  • Keep it available for at least 2 major releases Remove in Kafka 4.2.0 or laterand then remove them.

Test Plan

We can use follow test to cover the change:

...

  • Behavior with mixed rack configurations
  • Behavior with classic and new protocol groups

If there are alternative ways of accomplishing the same thing, what were they? The purpose of this section is to motivate why the design is the way it is and not some other way.



Rejected Alternatives

Alternative 1: Create a New API
Proposal: Create describeConsumerGroupsWithRack() method
Rejection Reason:

  • Unnecessary API proliferation
  • The information already exists in the protocol
  • Extending existing API is more intuitive
  • Similar precedent: KIP-345 added groupInstanceId to existing MemberDescriptionAnother discussed approach is not to call RLMM#configure() method while instantiating the RemoteLogManager#L422 and define a new method in RemoteLogManager#configureRLMM and this can be called from the BrokerServer. You can refer to the code.
    But the change breaks that contract:
    Accroding to KIP-877: "If a plugin implements this interface, the withPluginMetrics() method will be called when the plugin is instantiated (after configure() if the plugin also implements Configurable). "