...
If the Kafka Controller or Metadata Cache generates a snapshot too frequently then it can negatively affect the performance of the disk. If it doesn't generate a snapshot often enough then it can increase the amount of time it takes to load its state into memory and it can increase the amount space taken up by the replicated log. The Kafka Controller and Metadata Cache will have new configuration options metadata.snapshot.min.cleanable.ratio
and metadata.snapshot.min.records
. size. Both of these configuration need to be satisfied before the Controller or Metadata Cache will generate a new snapshot.
metadata.snapshot.min.cleanable.ratio
is the minimum number of snapshot records that have changed (deleted or modified) between the latest snapshot and the current in-memory state. Note that new snapshot records don't count against this ratio. If a new snapshot record was added since that last snapshot then it doesn't affect the dirty ratio. If a snapshot record was added and then modify or deleted then it counts against the cleanable ratio.-
metadata.snapshot.min.records.size
is the minimum size of the records in the replicated log between the latest snapshot and then high-watermark.
...
The
__cluster_metadata
topic will have acleanup.policy
value ofsnapshot
. This configuration can only be read. Updates to this configuration will not be allowed.metadata.snapshot.min.cleanable.ratio
- The minimum ratio of snapshot records that have to change before generating a snapshot. See section "When to Snapshot". The default is .5 (50%).metadata.snapshot.min.records.size
- This is the minimum number of bytes in the replicated log between the latest snapshot and the high-watermark needed before generating a new snapshot. See section "When to Snapshot". The default is 20MB.metadata.start.offset.lag.time.max.ms
- The maximum amount of time that leader will wait for an offset to get replicated to all of the live replicas before advancing theLogStartOffset
. See section “When to Increase the LogStartOffset”. The default is 7 days.
...