Description
When we remove a topic, it goes through the following function in KRaft Controller replay method for RemoveTopicRecord:
void removeTopicEntryForBroker(Uuid topicId, int brokerId) { Map<Uuid, int[]> topicMap = isrMembers.get(brokerId); if (topicMap != null) { if (brokerId == NO_LEADER) { offlinePartitionCount.set(offlinePartitionCount.get() - topicMap.get(topicId).length); } topicMap.remove(topicId); } }
If the broker has any offline partitions but doesn't have offline partitions for the topic we're deleting, the above code will run into NPE because we directly access the `topicMap.get(topicId).length`
Attachments
Issue Links
- links to