Skip to content

KAFKA-19566: Deprecate ClientQuotaCallback#updateClusterMetadata#21958

Merged
chia7712 merged 6 commits intoapache:trunkfrom
brandboat:KAFKA-19566
Apr 6, 2026
Merged

KAFKA-19566: Deprecate ClientQuotaCallback#updateClusterMetadata#21958
chia7712 merged 6 commits intoapache:trunkfrom
brandboat:KAFKA-19566

Conversation

@brandboat
Copy link
Copy Markdown
Member

@brandboat brandboat commented Apr 4, 2026

This method was unsupported in KRaft mode until Kafka 4.0, but the
implementation has known issues: memory pressure from immutable Cluster
objects on every update, confusing/irrelevant fields in KRaft context,
and inconsistent partition info due to listener parsing differences.
KIP-1162 proposed a redesign, but given the method went years without
user complaints, we're deprecating it now and removing it in Kafka 5.0.

Reviewers: Chia-Ping Tsai chia7712@gmail.com, Ken Huang
s7133700@gmail.com

@github-actions github-actions Bot added core Kafka Broker kraft clients small Small PRs labels Apr 4, 2026
* @param cluster Cluster metadata including partitions and their leaders if known
* @return true if quotas have changed and metric configs may need to be updated
*/
@Deprecated(since = "4.4", forRemoval = true)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to provide a default implementation to ensure a smooth migration? This would relieve users from having to implement a deprecated method

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds great! Updated in ed2b180, thanks!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

KIP-1200 also updated


@SuppressWarnings("removal")
@Override
public boolean updateClusterMetadata(Cluster cluster) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could remove it totally


override def quotaLimit(quotaType: ClientQuotaType, metricTags: Map[String, String]): java.lang.Double = 1
@SuppressWarnings(Array("removal"))
override def updateClusterMetadata(cluster: Cluster): Boolean = false
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

}

@SuppressWarnings("removal")
@Override
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Copy Markdown
Member

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brandboat would you mind adding this change to upgrade.md?

@chia7712 chia7712 merged commit 86328c2 into apache:trunk Apr 6, 2026
23 checks passed
@brandboat brandboat deleted the KAFKA-19566 branch April 6, 2026 03:19
nileshkumar3 pushed a commit to nileshkumar3/kafka that referenced this pull request Apr 15, 2026
…he#21958)

This method was unsupported in KRaft mode until Kafka 4.0, but the
implementation has known issues: memory pressure from immutable Cluster
objects on every update, confusing/irrelevant fields in KRaft context,
and inconsistent partition info due to listener parsing differences.
KIP-1162 proposed a redesign, but given the method went years without
user complaints, we're deprecating it now and removing it in Kafka 5.0.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Ken Huang
 <s7133700@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clients core Kafka Broker kraft small Small PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants