Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-16892

TopicsDelta#localChanges get empty deletes when load from snapshot

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.4.0, 3.5.0, 3.6.0, 3.7.0
    • None
    • kraft
    • None

    Description

      MetadataLoader#loadSnapshot get empty TopicsDelta.localChanges(brokerId).deletes

      Bug:
      1. When generating MetadataDelta from Snapshot, TopicsDelta will first #replay(TopicRecord);
      2. However, TopicsDelta directly creates a TopicDelta without any Partitions, instead of using the previous TopicImage;
      3. Because TopicDelta.image has no Partitions, when TopicDelta#localChanges generates the deletes list, it returns empty deletes.

      https://github.com/apache/kafka/blob/02c794dfd3bda12066031155bd62234ad863860b/metadata/src/main/java/org/apache/kafka/image/TopicsDelta.java#L71C1-L76C6

      https://github.com/apache/kafka/blob/02c794dfd3bda12066031155bd62234ad863860b/metadata/src/main/java/org/apache/kafka/image/TopicDelta.java#L142-L148

      Attachments

        Issue Links

          Activity

            People

              robinhan HanXu
              robinhan HanXu
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: