{
  "id": "communication/kafka-leader-not-available",
  "signature": "LEADER_NOT_AVAILABLE: No leader for partition N in topic X",
  "signature_zh": "LEADER_NOT_AVAILABLE: 主题 X 的分区 N 无领导者",
  "regex": "LEADER_NOT_AVAILABLE: No leader for partition \\d+ in topic \\w+",
  "domain": "communication",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "The Kafka broker that was the leader for a partition has crashed or is unreachable, and the controller has not yet elected a new leader via ISR (In-Sync Replicas).",
  "root_cause_type": "generic",
  "root_cause_zh": "Kafka 分区领导者代理已崩溃或不可达，控制器尚未通过 ISR 选举出新领导者。",
  "versions": [
    {
      "version": "Kafka 3.4",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Kafka 3.5",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Kafka 3.6",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Restarting the failed broker may cause split-brain if not cleanly shut down; leader election still fails.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Increasing replication factor doesn't fix immediate leader unavailability; requires reconfiguration.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Manually setting preferred leader via kafka-leader-election.sh can cause data inconsistency if ISR is out of sync.",
      "fail_rate": 0.4,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Run `kafka-leader-election.sh --bootstrap-server localhost:9092 --election-type preferred --topic X --partition N` to trigger a clean leader election from ISR.",
      "success_rate": 0.85,
      "how": "Run `kafka-leader-election.sh --bootstrap-server localhost:9092 --election-type preferred --topic X --partition N` to trigger a clean leader election from ISR.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Increase `unclean.leader.election.enable=true` in broker config to allow out-of-sync replicas to become leader as a last resort, then revert.",
      "success_rate": 0.7,
      "how": "Increase `unclean.leader.election.enable=true` in broker config to allow out-of-sync replicas to become leader as a last resort, then revert.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Run `kafka-leader-election.sh --bootstrap-server localhost:9092 --election-type preferred --topic X --partition N` to trigger a clean leader election from ISR.",
    "Increase `unclean.leader.election.enable=true` in broker config to allow out-of-sync replicas to become leader as a last resort, then revert."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://kafka.apache.org/documentation/#broker_failures",
  "official_doc_section": null,
  "error_code": "LEADER_NOT_AVAILABLE",
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-08-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [
    "Kafka",
    "leader-election",
    "partition"
  ],
  "locale": "en",
  "aliases": []
}