All Questions
Kafka hard

Why would a Kafka broker roll a new log segment (file) even if the current segment is only 10% full (based on `segment.bytes`)?

  1. A Because the broker detected a 'fragmentation' level higher than 50% in the underlying XFS filesystem.
  2. B Retention Granularity: The `segment.ms` (time limit) was reached. Rolling ensures that the timestamp of the segment is kept fresh, allowing the background retention thread to accurately delete or compact old data based on its age.
  3. C To reset the sequence numbers for the internal Idempotent Producer protocol.
  4. D Because a Consumer successfully completed a `commitSync()` for every message in the current segment.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions