1

Let us say, I have a partion-0 with 2 log segments. The first segment contains keys v1, v2 and v3 at offsets 0, 1 and 2. The second segment has keys v3, v4, v1 at offsets 3, 4 and 5.

When the log compaction happens, the keys at offset 0 and 2 in first segment will be deleted.

What happens to the offsets 0 and 2? Do they become empty? If so what happens to this empty offsets?

Michael Heil
  • 16,250
  • 3
  • 42
  • 77
swetha
  • 91
  • 2
  • 11

1 Answers1

0

The offsets disappear together with the keys (and values).

An offset is like a unique identifier that never changes in the lifetime of the topic and always belongs to the same message.

Michael Heil
  • 16,250
  • 3
  • 42
  • 77
  • So when the consumer starts reading messages from partition , it will not encounter these offsets. does it see something like this ?-- offsets - 1,3,4,5. – swetha Oct 07 '20 at 08:53