cmccabe commented on code in PR #12533: URL: https://github.com/apache/kafka/pull/12533#discussion_r949351073
########## metadata/src/main/java/org/apache/kafka/controller/BrokersToIsrs.java: ########## @@ -191,7 +191,7 @@ void update(Uuid topicId, int partitionId, int[] prevIsr, int[] nextIsr, void removeTopicEntryForBroker(Uuid topicId, int brokerId) { Map<Uuid, int[]> topicMap = isrMembers.get(brokerId); if (topicMap != null) { - if (brokerId == NO_LEADER) { + if (brokerId == NO_LEADER && topicMap.containsKey(topicId)) { offlinePartitionCount.set(offlinePartitionCount.get() - topicMap.get(topicId).length); Review Comment: We do update `offlinePartitionCount` when we delete a topic, right? Check `ReplicationControlManager#replay(RemoveTopicRecord record)` The change here is to avoid a null pointer exception if `topicMap.get(topicId) == null` Seems like a good fix -- 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-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org