You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/07/26 03:06:26 UTC

[GitHub] [kafka] chia7712 commented on a change in pull request #11128: MINOR: remove partition-level error from MetadataResponse#errorCounts

chia7712 commented on a change in pull request #11128:
URL: https://github.com/apache/kafka/pull/11128#discussion_r676262149



##########
File path: clients/src/main/java/org/apache/kafka/common/requests/MetadataResponse.java
##########
@@ -100,10 +100,7 @@ public int throttleTimeMs() {
     @Override
     public Map<Errors, Integer> errorCounts() {
         Map<Errors, Integer> errorCounts = new HashMap<>();
-        data.topics().forEach(metadata -> {
-            metadata.partitions().forEach(p -> updateErrorCounts(errorCounts, Errors.forCode(p.errorCode())));

Review comment:
       According to https://github.com/apache/kafka/blob/trunk/core/src/main/scala/kafka/server/metadata/ZkMetadataCache.scala#L103, it is possible that partition-level has error but topic-level gets none. Hence, it produces inaccurate count of "error" if we remove this line.
   
   If we want to make correct count of `error` and `none`, we have to add following check.
   
   1. if topic has error, we don't need to loop partitions.
   2. if topic has no error, we have to loop partitions.
   
   @ijuma WDYT? 




-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org