{
  "id": "kafka/invalid-commit-offset-size",
  "signature": "org.apache.kafka.common.errors.InvalidCommitOffsetSizeException: The commit offset size 1048577 exceeds the maximum allowed size 1048576",
  "signature_zh": "org.apache.kafka.common.errors.InvalidCommitOffsetSizeException: 提交偏移量大小 1048577 超过了最大允许大小 1048576",
  "regex": "InvalidCommitOffsetSizeException.*exceeds the maximum allowed size",
  "domain": "kafka",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "Consumer group offset commit metadata exceeds the configured maximum size (default 1 MB), often due to storing large custom metadata in the commit request.",
  "root_cause_type": "generic",
  "root_cause_zh": "消费者组偏移量提交元数据超过了配置的最大大小（默认 1 MB），通常是由于在提交请求中存储了大型自定义元数据。",
  "versions": [
    {
      "version": "kafka_2.13-3.5.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "kafka_2.13-3.6.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "kafka_2.13-3.7.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "This affects replication, not the metadata size limit; the commit size limit is independent.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This controls how many records are polled, not the offset metadata size; the error occurs during commit, not poll.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This removes all committed offsets for all groups, causing data loss and does not fix the size limit; the topic is recreated with default config.",
      "fail_rate": 0.99,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Reduce the size of custom metadata passed to `commitSync(Map<TopicPartition, OffsetAndMetadata>)` by removing large objects or storing references externally. Example: `consumer.commitSync(Collections.singletonMap(partition, new OffsetAndMetadata(offset, \"small_metadata\")));`",
      "success_rate": 0.9,
      "how": "Reduce the size of custom metadata passed to `commitSync(Map<TopicPartition, OffsetAndMetadata>)` by removing large objects or storing references externally. Example: `consumer.commitSync(Collections.singletonMap(partition, new OffsetAndMetadata(offset, \"small_metadata\")));`",
      "condition": "",
      "sources": []
    },
    {
      "action": "Increase `offset.commit.metadata.max.size` in the broker configuration (e.g., to 2097152 bytes) and restart the broker. This setting is dynamic but requires broker restart to take effect.",
      "success_rate": 0.8,
      "how": "Increase `offset.commit.metadata.max.size` in the broker configuration (e.g., to 2097152 bytes) and restart the broker. This setting is dynamic but requires broker restart to take effect.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If metadata is not needed, set it to empty string: `consumer.commitSync(Collections.singletonMap(partition, new OffsetAndMetadata(offset, \"\")));`",
      "success_rate": 0.95,
      "how": "If metadata is not needed, set it to empty string: `consumer.commitSync(Collections.singletonMap(partition, new OffsetAndMetadata(offset, \"\")));`",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Reduce the size of custom metadata passed to `commitSync(Map<TopicPartition, OffsetAndMetadata>)` by removing large objects or storing references externally. Example: `consumer.commitSync(Collections.singletonMap(partition, new OffsetAndMetadata(offset, \"small_metadata\")));`",
    "Increase `offset.commit.metadata.max.size` in the broker configuration (e.g., to 2097152 bytes) and restart the broker. This setting is dynamic but requires broker restart to take effect.",
    "If metadata is not needed, set it to empty string: `consumer.commitSync(Collections.singletonMap(partition, new OffsetAndMetadata(offset, \"\")));`"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://kafka.apache.org/documentation/#consumerconfigs_offset.commit.metadata.max.size",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.83,
  "fix_success_rate": 0.75,
  "resolvable": "true",
  "first_seen": "2024-02-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}