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

Log metrics are removed if a log is deleted and re-created quickly enough

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.6.0
    • 2.7.0, 2.6.1
    • log
    • None

    Description

      When we delete a local log, we mark it for asynchronous deletion by renaming it with a `.delete` extension, and then wait `LogConfig.FileDeleteDelayMs` milliseconds before actually deleting the files on disk. We don't remove the Log metrics from the metrics registry until the actual deletion takes place. If we recreate a log of the same topic partition (for example, if we reassign the partition away from the broker and quickly reassign it back), the metrics are registered when the new log is created, but then unregistered when the async deletion of the original log takes place. This leaves us with a partition that is not reporting any Log metrics (size, offsets, number of segments, etc).

      To fix this, the LogManager should check when creating new logs to see if a log for the same topic partition is marked for deletion, and if so, signal to that log not to unregister its metrics when it is deleted.

      Attachments

        Issue Links

          Activity

            People

              bob-barrett Bob Barrett
              bob-barrett Bob Barrett
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: