DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
| Table of Contents |
|---|
Status
Current state: "Under Discussion" Accepted
Discussion thread: here
Vote thread: 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));
Public Interfaces
We need to do tiny change for the existed public class:
1. Add rack ID support to org.apache.kafka.clients.admin.MemberDescription:
| Code Block | ||||
|---|---|---|---|---|
| ||||
public class MemberDescription {
private final String memberId;
private final Optional<String> groupInstanceId;
private final Optional<String> rackId; // NEWnew FIELDfield
private final String clientId;
private final String host;
//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 | ||||
|---|---|---|---|---|
| ||||
public class MemberDescription ShareMemberDescription{ private final String memberId; private final Optional<String> rackId; // NEWnew FIELD field private private final String clientId; //omit other codes private final String host; public Optional<String> rackId() { // new method return rackId; } //omit other codes } |
...
| Code Block |
|---|
public interface RemoteLogMetadataManager extends BrokerReadyCallback, Configurable, Closeable |
Proposed Changes
You can refer to https://github.com/apache/kafka/pull/20203/files
We postpone the TopicBasedRemoteLogMetadataManager's initialization part (quering metedata from remote topic) after the server is ready for the request.
...
- add rackId into MemberDescription and ShareMemberDescription
- pass through rack ID from protocol response
Compatibility, Deprecation, and Migration Plan
...
Backward Compatibility
This change is fully backward compatible:
Binary Compatibility:
- The old constructor remains available (marked as
@Deprecated) - Existing code will continue to compile and run
- The new field is an Optional, defaulting to
empty()
- The old constructor remains available (marked as
Source Compatibility:
- Existing code using the old constructor continues to work
- No changes required to existing applications
Behavioral Compatibility:
- Existing behavior is unchanged
- Only adds new information when available
Migration Path
For users upgrading:
- No action required
- Rack information automatically available when using Admin API
- Access via
memberDescription.rackId()when needed
For developers using MemberDescription:
- Old constructor still works
- Recommended to migrate to new constructor over time
- Old constructor may be removed in a future major version (e.g., Kafka 5.0)
Deprecation Plan
- Mark old constructor as
@Deprecatedimmediately - Keep it available for at least 2 major releases and then remove them.
Test Plan
We can use follow test to cover the change:
Unit Tests
- Test equality with and without rack ID
- Test rack ID is correctly extracted from DescribeResponse
Integration/System Tests
- Behavior with mixed rack configurations
- Behavior with classic and new protocol groups
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 MemberDescription
Test Plan
Describe in few sentences how the KIP will be tested. We are mostly interested in system tests (since unit-tests are specific to implementation details). How will we know that the implementation works as expected? How will we know nothing broke?
- Will cover the patch with deploy test and check if the startup can success without any connection retry error for remote storage. You can refer to test case
Rejected Alternatives
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.
- Another 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). "

