With RocketMQ -- deletion of expired files , kafka will also periodically clean up files.
When the Broker starts, it starts a scheduled task, delays it for 30s, and then starts to determine the release to delete expired files every 5 minutes.
When the task starts, it will traverse all Segment files.
By default, only 7 days old files are kept. The judgment time is judged by the maximum timestamp largestTimestamp in the Segment file, not the modification time of the file.
If all segment files have been deleted, a new segment file needs to be created.
If there are currently multiple segment files, if the total size of these segment files exceeds the set threshold, assuming it exceeds 2.5G, and each segment file is 1G, then 3 segment files need to be deleted to ensure the segment. The total size of the files is less than the set threshold.
As above, if all segment files are deleted, a new segment file needs to be created.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。