DL1231 commented on code in PR #19577:
URL: https://github.com/apache/kafka/pull/19577#discussion_r2459096947
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java:
##########
@@ -700,15 +701,22 @@ class OffsetCommitRequestState extends
RetriableRequestState {
}
public NetworkClientDelegate.UnsentRequest toUnsentRequest() {
+ Map<String, Uuid> topicIds = metadata.topicIds();
+ boolean canUseTopicIds = true;
Map<String, OffsetCommitRequestData.OffsetCommitRequestTopic>
requestTopicDataMap = new HashMap<>();
for (Map.Entry<TopicPartition, OffsetAndMetadata> entry :
offsets.entrySet()) {
TopicPartition topicPartition = entry.getKey();
OffsetAndMetadata offsetAndMetadata = entry.getValue();
+ Uuid topicId = topicIds.getOrDefault(topicPartition.topic(),
Uuid.ZERO_UUID);
+ if (topicId.equals(Uuid.ZERO_UUID)) {
+ canUseTopicIds = false;
Review Comment:
Thanks for your patient response. My previous description might have been
somewhat ambiguous.
1. When the server version is older and doesn't support topic IDs, updating
metadata is meaningless. This situation differs from ShareConsumer's case, as
servers supporting ShareConsumer must support topic IDs.
2. When there are many clients and the server doesn't support topic IDs, it
could lead to numerous clients continuously updating metadata, causing resource
waste.
3. Regarding your point that "if the consumer subscribed, it will have the
topic IDs already, it's what we get on the assignment from the coordinator," I
have a question: If the server version is older and its metadata doesn't
include topic IDs, would this situation lead to the problem we're discussing
now?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]