You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
761 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

![[Pasted image 20231126192023.png]]
不考虑多副本情况一个分区对应1个日志为了防止日志过大kafka引入了日志分段的概念每个LogSegment对应磁盘上的一个日志文件和两个索引文件偏移量和时间戳
Log 中追加消息时是顺序写入的,只有最后一个 LogSegment 才能执行写入操作,在此之前所有的 LogSegment 都不能写入数据。为了方便描述,我们将最后 LogSegment 称为activeSegment ”,即表示当前活跃的日志分段。随着消息的不断写入,当 activeSegment 满
足一定的条件时,就需要创建新的 activeSegment 之后追加的消息将写入新的activeSegment
# 一、消息格式
![[Pasted image 20231126192854.png]]