Skip to content

AxonOps — AI-Native Control Plane for Open Source Data Platforms

Kafka Offline Partitions

An offline partition has no leader and cannot serve normal reads or writes. Prioritize recovery of the last in-sync replicas.

Terminal window
kafka-topics.sh --bootstrap-server kafka:9092 \
--describe --unavailable-partitions
kafka-topics.sh --bootstrap-server kafka:9092 \
--describe --topic orders
kafka-log-dirs.sh --bootstrap-server kafka:9092 \
--describe --topic-list orders

Record the assigned replicas, ISR, last leader, broker/rack availability, directory errors, and incident timeline. Preserve logs from every assigned broker.

  1. Determine whether all assigned replicas are down or only unable to register.
  2. Check broker processes, controller quorum, broker registration, listeners, and inter-broker security.
  3. Check the specific log directories, mounts, capacity, permissions, and kernel I/O errors.
  4. Identify correlated rack, zone, network, or deployment failures.
  5. Establish which replica has the newest trustworthy log before considering data-loss recovery.
  • Restore an existing ISR broker or its storage.
  • Restore controller-to-broker and broker-to-broker communication.
  • Bring failed log directories back only after fixing the underlying mount or device problem.
  • Wait for the controller to elect an eligible leader and verify leader epoch movement.
Terminal window
kafka-leader-election.sh --bootstrap-server kafka:9092 \
--election-type UNCLEAN \
--topic orders --partition 7

Danger

An unclean election can discard records that were acknowledged by the previous leader but absent from the elected replica. Require explicit data-loss approval, record replica offsets, and retain the failed replicas for investigation.

  • The unavailable-partition query returns no affected partition.
  • Produce and fetch succeed for the recovered partition.
  • ISR expands to the intended replication factor.
  • No failed log directory remains hidden behind the recovered leader.
  • The application reconciles any accepted data-loss boundary.

Spread replicas across independent failure domains, keep replication factor and min.insync.replicas aligned, monitor offline/under-min-ISR partitions, test broker recovery, and avoid simultaneous maintenance on all replicas.