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?
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.