[
https://issues.apache.org/jira/browse/KAFKA-10282?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Bob Barrett resolved KAFKA-10282.
---------------------------------
Resolution: Fixed
> Log metrics are removed if a log is deleted and re-created quickly enough
> -------------------------------------------------------------------------
>
> Key: KAFKA-10282
> URL: https://issues.apache.org/jira/browse/KAFKA-10282
> Project: Kafka
> Issue Type: Bug
> Components: log
> Affects Versions: 2.6.0
> Reporter: Bob Barrett
> Assignee: Bob Barrett
> Priority: Major
> Fix For: 2.7.0, 2.6.1
>
>
> 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.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)