artemlivshits commented on code in PR #19916:
URL: https://github.com/apache/kafka/pull/19916#discussion_r2132813677
##########
metadata/src/main/java/org/apache/kafka/image/TopicsDelta.java:
##########
@@ -95,26 +95,37 @@ public void replay(PartitionChangeRecord record) {
topicDelta.replay(record);
}
+ private void maybeReplayClearElrRecord(Uuid topicId, ClearElrRecord
record) {
+ // Only apply the record if the topic is not deleted.
+ if (!deletedTopicIds.contains(topicId)) {
+ TopicDelta topicDelta = getOrCreateTopicDelta(topicId);
+ topicDelta.replay(record);
+ }
+ }
+
public void replay(ClearElrRecord record) {
if (!record.topicName().isEmpty()) {
Uuid topicId;
- if (image.getTopic(record.topicName()) != null) {
- topicId = image.getTopic(record.topicName()).id();
- } else {
+ if (createdTopics.containsKey(record.topicName())) {
topicId = createdTopics.get(record.topicName());
+ } else {
+ topicId = image.getTopic(record.topicName()).id();
Review Comment:
Are we guaranteed that `image.getTopic(record.topicName())` is not null?
The previous code checked that.
--
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]