Versions Compared

Key

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

...

Discussion thread: here

Vote thread: here  "Will update after discussion"

JIRA: KAFKA-19784

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

...

This change is fully backward compatible:

  1. 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()
  2. Source Compatibility:

    • Existing code using the old constructor continues to work
    • No changes required to existing applications
  3. 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 @Deprecated immediately
  • Keep it available for at least 2 major releases
  • Remove in Kafka 4.2.0 or later

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

...

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

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.

...