[ 
https://issues.apache.org/jira/browse/KAFKA-20746?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18092253#comment-18092253
 ] 

Luke Chen commented on KAFKA-20746:
-----------------------------------

> 
{{{{{}Perhaps we should consider this KIP: 
[https://cwiki.apache.org/confluence/spaces/KAFKA/pages/350783948/KIP-1162+Redesign+ClientQuotaCallback+updateClusterMetadata]
 again{}}}}}
[Edit|https://issues.apache.org/jira/secure/EditComment!default.jspa?id=13656000&commentId=18092250]
 
[|https://issues.apache.org/jira/secure/DeleteComment!default.jspa?id=13656000&commentId=18092250]
I'll bring this to our team and discuss about it. Thanks [~brandboat] !

> NPE in MetadataCache#toCluster
> ------------------------------
>
>                 Key: KAFKA-20746
>                 URL: https://issues.apache.org/jira/browse/KAFKA-20746
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 4.2.0, 4.3.1
>            Reporter: Luke Chen
>            Assignee: Kuan Po Tseng
>            Priority: Major
>
> In KAFKA-18225, we fix a bug to allow 
> `ClientQuotaCallback#updateClusterMetadata` to be supported in KRaft mode. 
> But the cluster object generated in MetadataCache could cause NPE. See 
> [https://github.com/strimzi/kafka-quotas-plugin/issues/71] for more info.
>  
> I think the root cause is that in toCluster method, we filter out the fenced 
> brokers to build brokerToNodes map 
> [here|https://github.com/apache/kafka/blob/4.3.1/metadata/src/main/java/org/apache/kafka/metadata/MetadataCache.java#L151-L154].
>  But later, we want to get all the replicas info, which include the fenced 
> replicas, via the filtered brokerToNodes map. So it causes the NPE. That's my 
> assumption because from the original reported bug, we don't have other info. 
> But it's a possible way to cause NPE. We should also think if there is other 
> possibility to cause NPE here. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to