...
- The controller watches the path /log_dir_event_notification
for new znode.
- User fixes the bad disk. The disk can either be empty or contain the old data.
- User runs kafka-log-dirs.sh like this: ./bin/kafka-log-dirs.sh --delete --zookeeper zookeeerUrl --broker brokerId
- The script creates a sequential znode under path /log_dir_event_notification
with data of the format {"version" : 1, "broker" : brokerId, "event" : LogDirReset}
- The controller reads the znode to get the brokerId and finds that the event type is LogDirReset.
- The controller deletes this broker from list “created” of znodes /broker/topics/[topic]/partitions/[partitionId]/controller_managed_state
for all partitions that should exist on this broker.
- The controller deletes the notification znode from zookeeper.
- The controller sends LeaderAndIsrRequest with create=True to this broker. If LeaderAndIsrResponse shows success, the controller adds broker to the list "created" of the respective partitions. Otherwise, those replicas are considered offline.
...