{
  "id": "kafka/partition-not-assigned",
  "signature": "org.apache.kafka.common.errors.PartitionNotAssignedException: Partition my-topic-0 is not assigned to this consumer instance",
  "signature_zh": "org.apache.kafka.common.errors.PartitionNotAssignedException：分区my-topic-0未分配给此消费者实例",
  "regex": "PartitionNotAssignedException.*not assigned",
  "domain": "kafka",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "The consumer attempted to commit offsets or fetch data for a partition that was not assigned to it, often due to a stale partition assignment after a rebalance.",
  "root_cause_type": "generic",
  "root_cause_zh": "消费者尝试提交偏移或获取未分配给它的分区的数据，通常是由于再平衡后分区分配过期。",
  "versions": [
    {
      "version": "kafka 2.8.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "kafka 3.0.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "kafka 3.3.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "poll() may not trigger a rebalance if the group is stable; it can also cause a busy loop that degrades performance.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This bypasses the group coordinator and can lead to offset conflicts or duplicate consumption if other consumers exist.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use a ConsumerRebalanceListener to update partition assignments after a rebalance, and ensure commitSync() is only called for assigned partitions.",
      "success_rate": 0.9,
      "how": "Use a ConsumerRebalanceListener to update partition assignments after a rebalance, and ensure commitSync() is only called for assigned partitions.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Increase 'session.timeout.ms' and 'heartbeat.interval.ms' to reduce the likelihood of spurious rebalances that cause stale assignments.",
      "success_rate": 0.8,
      "how": "Increase 'session.timeout.ms' and 'heartbeat.interval.ms' to reduce the likelihood of spurious rebalances that cause stale assignments.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Use a ConsumerRebalanceListener to update partition assignments after a rebalance, and ensure commitSync() is only called for assigned partitions.",
    "Increase 'session.timeout.ms' and 'heartbeat.interval.ms' to reduce the likelihood of spurious rebalances that cause stale assignments."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://kafka.apache.org/documentation/#consumerconfigs_session.timeout.ms",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.86,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-09-12",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}