A Confluent broker disk fills and its leaders stop accepting writes
The scenario
A Confluent Platform broker on a virtual machine hits 100 percent on its log disk. Leaders on that host stop taking writes. The broker drops out of the ISR for partitions it cannot serve. CPU is moderate. An operator wants to reboot the host or delete segment files by hand to free space.
Model answer
What I'd say first:
I would free the right bytes and leave the host up. The log disk is full, so leaders on this broker cannot append. Rebooting does not delete segments. Removing files by hand can corrupt the replica.
How I'd work it:
- 1Do not reboot and do not rm the log directory.
- 2Find the topic and partition, one ordered slice, that owns the space. Confirm this broker is the one rejecting writes.
- 3Lower retention on that topic so Kafka can delete old segments, or add disk. Then let the broker rejoin the ISR, the in-sync replicas that have caught up.
- 4Tell the room a full log dir stopped the leaders. The host owner and the topic owner stay until writes succeed and the broker is back in the ISR.
How I'd explain it:
Kafka stores the log on disk and will stop a broker that cannot append. The large topic is the usual cause, not a mystery CPU spike. A wrong answer is a reboot or a hand delete. After a reboot the disk is still full. A hand delete can remove a segment the replica still needs, and if this was the only remaining copy the record is gone.
How I'd prevent it:
A disk page that names the topic before the volume hits full. Retention set with the real backlog, and an owner per topic. A runbook that allows retention changes and disk growth, and forbids rm and reboot as the first actions.
The follow-up they'll ask
“Reboot the Confluent broker and delete old segment files so the disk has room?”
No. I would not reboot, and I would not delete segment files by hand. A reboot leaves the disk full, so the leaders fail the same way when the process returns. A hand delete can corrupt the replica or remove the last copy of a record. I lower retention so Kafka deletes old segments itself, or I add disk, and I let this broker catch up into the ISR. CPU is not the page. The full log directory is. Writes resume when there is space Kafka agrees with.
Common mistakes
- Reboot a full broker
- Delete segment files by hand
- Ignore which topic filled the disk
- Lower the write minimum instead of freeing space