{
  "id": "kafka/replica-not-available",
  "signature": "org.apache.kafka.common.errors.ReplicaNotAvailableException: Replica for partition is not available",
  "signature_zh": "org.apache.kafka.common.errors.ReplicaNotAvailableException：分区的副本不可用",
  "regex": "ReplicaNotAvailableException.*not available",
  "domain": "kafka",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "A follower replica for the requested partition is offline, not fully caught up, or the fetch request targets an unavailable replica.",
  "root_cause_type": "generic",
  "root_cause_zh": "请求的分区的跟随者副本离线、未完全同步，或拉取请求指向了不可用的副本。",
  "versions": [
    {
      "version": "2.8.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.2.3",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.5.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Restarting the consumer only retries the fetch, but the replica remains unavailable.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Increasing fetch.max.wait.ms only delays the timeout, not the root cause.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Check the broker logs for the specific partition and bring the offline replica online:\n# Identify the partition leader\nkafka-topics.sh --bootstrap-server localhost:9092 --describe --topic my_topic\n# Restart the broker hosting the unavailable replica or reassign replicas:\nkafka-reassign-partitions.sh --bootstrap-server localhost:9092 --reassignment-json-file reassign.json --execute",
      "success_rate": 0.9,
      "how": "Check the broker logs for the specific partition and bring the offline replica online:\n# Identify the partition leader\nkafka-topics.sh --bootstrap-server localhost:9092 --describe --topic my_topic\n# Restart the broker hosting the unavailable replica or reassign replicas:\nkafka-reassign-partitions.sh --bootstrap-server localhost:9092 --reassignment-json-file reassign.json --execute",
      "condition": "",
      "sources": []
    },
    {
      "action": "Set the consumer to read from the leader only by setting client-side rack awareness or using a fetch from the leader (default behavior if replica selector is not configured).",
      "success_rate": 0.8,
      "how": "Set the consumer to read from the leader only by setting client-side rack awareness or using a fetch from the leader (default behavior if replica selector is not configured).",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Check the broker logs for the specific partition and bring the offline replica online:\n# Identify the partition leader\nkafka-topics.sh --bootstrap-server localhost:9092 --describe --topic my_topic\n# Restart the broker hosting the unavailable replica or reassign replicas:\nkafka-reassign-partitions.sh --bootstrap-server localhost:9092 --reassignment-json-file reassign.json --execute",
    "Set the consumer to read from the leader only by setting client-side rack awareness or using a fetch from the leader (default behavior if replica selector is not configured)."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://kafka.apache.org/documentation/#replication",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.84,
  "fix_success_rate": 0.85,
  "resolvable": "partial",
  "first_seen": "2023-09-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}