{
  "id": "kafka/transactional-id-expired",
  "signature": "org.apache.kafka.common.errors.TransactionalIdExpiredException: The transactional id has expired and is now fenced",
  "signature_zh": "org.apache.kafka.common.errors.TransactionalIdExpiredException：事务 ID 已过期并被隔离",
  "regex": "TransactionalIdExpiredException.*expired",
  "domain": "kafka",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "The transactional.id has not been used within the transaction.max.timeout.ms window, causing the coordinator to fence it.",
  "root_cause_type": "generic",
  "root_cause_zh": "事务 ID 在 transaction.max.timeout.ms 窗口内未被使用，导致协调器将其隔离。",
  "versions": [
    {
      "version": "3.6.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.7.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.8.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Restarting the producer does not recover the expired transactional.id; it remains fenced.",
      "fail_rate": 0.98,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Increasing transaction.timeout.ms on the producer alone does not retroactively prevent expiration.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use a new transactional.id for the producer, e.g., in Java:\nprops.put(ProducerConfig.TRANSACTIONAL_ID_CONFIG, \"new-app-id-\" + System.currentTimeMillis());\nThen initTransactions() and begin transaction.",
      "success_rate": 0.95,
      "how": "Use a new transactional.id for the producer, e.g., in Java:\nprops.put(ProducerConfig.TRANSACTIONAL_ID_CONFIG, \"new-app-id-\" + System.currentTimeMillis());\nThen initTransactions() and begin transaction.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Increase transaction.max.timeout.ms on the broker:\nkafka-configs.sh --bootstrap-server localhost:9092 --entity-type brokers --entity-default --alter --add-config transaction.max.timeout.ms=900000\nAnd ensure the producer uses a lower transaction.timeout.ms.",
      "success_rate": 0.9,
      "how": "Increase transaction.max.timeout.ms on the broker:\nkafka-configs.sh --bootstrap-server localhost:9092 --entity-type brokers --entity-default --alter --add-config transaction.max.timeout.ms=900000\nAnd ensure the producer uses a lower transaction.timeout.ms.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Use a new transactional.id for the producer, e.g., in Java:\nprops.put(ProducerConfig.TRANSACTIONAL_ID_CONFIG, \"new-app-id-\" + System.currentTimeMillis());\nThen initTransactions() and begin transaction.",
    "Increase transaction.max.timeout.ms on the broker:\nkafka-configs.sh --bootstrap-server localhost:9092 --entity-type brokers --entity-default --alter --add-config transaction.max.timeout.ms=900000\nAnd ensure the producer uses a lower transaction.timeout.ms."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://kafka.apache.org/documentation/#brokerconfigs_transaction.max.timeout.ms",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.92,
  "resolvable": "partial",
  "first_seen": "2024-06-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}