Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

the leader of tp-0, tp-1, tp-2 are node 1, and now, the batch of tp-0 is full, ready to send to node 1, the producer will also send batches in tp-1, tp-2 (even though the batch size is small) to node 1. Because of this characteristic, in the log segment, there should be many “small batches”. So, if changing the length field from int32 to varint should also be good.

Note: 

The biggest value of varint 2 bytes is 16383

The biggest value of varint 3 bytes is 2097151


With the above 4 record batch field changes, in a normal batch, with close timestamp between each record and offsets, the save can be:

...