{
  "id": "kafka/zookeeper-connection-loss-during-kraft-election",
  "signature": "org.apache.kafka.common.errors.ZooKeeperConnectionLossException: Connection loss during KRaft controller election",
  "signature_zh": "org.apache.kafka.common.errors.ZooKeeperConnectionLossException：KRaft控制器选举期间连接丢失",
  "regex": "ZooKeeperConnectionLossException.*KRaft.*election",
  "domain": "kafka",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "During KRaft migration or mixed-mode operation, a ZooKeeper connection loss disrupts the controller election process, leaving the cluster without a leader.",
  "root_cause_type": "generic",
  "root_cause_zh": "在KRaft迁移或混合模式操作期间，ZooKeeper连接丢失中断了控制器选举过程，导致集群没有领导者。",
  "versions": [
    {
      "version": "Kafka 3.5.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Kafka 3.6.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Kafka 3.7.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Restarting only ZooKeeper servers",
      "why_fails": "Restarting ZooKeeper alone does not re-trigger the KRaft election; the controller process must be restarted.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "Raising zookeeper.session.timeout.ms",
      "why_fails": "Increasing ZooKeeper session timeout delays the failure but does not prevent connection loss due to network issues.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Restart the KRaft controller process with 'bin/kafka-server-stop.sh && bin/kafka-server-start.sh config/kraft/server.properties' to force a new election.",
      "success_rate": 0.85,
      "how": "Restart the KRaft controller process with 'bin/kafka-server-stop.sh && bin/kafka-server-start.sh config/kraft/server.properties' to force a new election.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Ensure ZooKeeper quorum is stable and network latency between ZooKeeper and Kafka brokers is below 10ms. Use 'echo stat | nc zookeeper-host 2181' to check ZooKeeper state.",
      "success_rate": 0.9,
      "how": "Ensure ZooKeeper quorum is stable and network latency between ZooKeeper and Kafka brokers is below 10ms. Use 'echo stat | nc zookeeper-host 2181' to check ZooKeeper state.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Restart the KRaft controller process with 'bin/kafka-server-stop.sh && bin/kafka-server-start.sh config/kraft/server.properties' to force a new election.",
    "Ensure ZooKeeper quorum is stable and network latency between ZooKeeper and Kafka brokers is below 10ms. Use 'echo stat | nc zookeeper-host 2181' to check ZooKeeper state."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://kafka.apache.org/documentation/#kraft_controller",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.8,
  "resolvable": "partial",
  "first_seen": "2024-08-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}