{
  "id": "kafka/record-batch-too-large",
  "signature": "org.apache.kafka.common.errors.RecordBatchTooLargeException: The request included a batch of records larger than the maximum allowed size",
  "signature_zh": "记录批次过大异常：请求包含的记录批次大小超过允许的最大值",
  "regex": "RecordBatchTooLargeException.*batch of records larger than the maximum allowed size",
  "domain": "kafka",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "A single batch of records exceeds the broker's max.message.bytes or message.max.bytes configuration.",
  "root_cause_type": "generic",
  "root_cause_zh": "单个记录批次大小超过代理的 max.message.bytes 或 message.max.bytes 配置。",
  "versions": [],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Increasing max.request.size on the producer without also increasing broker limits will still cause rejection.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Compressing the batch may not reduce size enough if individual records are too large.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Increase max.message.bytes on the broker: kafka-configs.sh --bootstrap-server localhost:9092 --entity-type brokers --entity-default --alter --add-config 'message.max.bytes=20971520'",
      "success_rate": 0.9,
      "how": "Increase max.message.bytes on the broker: kafka-configs.sh --bootstrap-server localhost:9092 --entity-type brokers --entity-default --alter --add-config 'message.max.bytes=20971520'",
      "condition": "",
      "sources": []
    },
    {
      "action": "Reduce batch.size on the producer to limit batch size: props.put(\"batch.size\", \"16384\");",
      "success_rate": 0.8,
      "how": "Reduce batch.size on the producer to limit batch size: props.put(\"batch.size\", \"16384\");",
      "condition": "",
      "sources": []
    },
    {
      "action": "Split large records into smaller ones before sending to Kafka.",
      "success_rate": 0.85,
      "how": "Split large records into smaller ones before sending to Kafka.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "在代理上增加 max.message.bytes：kafka-configs.sh --bootstrap-server localhost:9092 --entity-type brokers --entity-default --alter --add-config 'message.max.bytes=20971520'",
    "在生产者上减少 batch.size 以限制批次大小：props.put(\"batch.size\", \"16384\");",
    "在发送到Kafka之前将大记录拆分为较小的记录。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://kafka.apache.org/documentation/#brokerconfigs_message.max.bytes",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.86,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2024-06-18",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}