cdc: add kafka max-message-bytes related explain#21832
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthrough更新 TiCDC Kafka 文档,明确 ChangesKafka 消息大小语义与处理
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: c7f382b1-4b18-4ca0-89d0-42629e7ba666
📒 Files selected for processing (3)
ticdc/ticdc-faq.mdticdc/ticdc-sink-to-kafka.mdticdc/troubleshoot-ticdc.md
| ## TiCDC 把数据同步到 Kafka 时,能在 TiDB 中控制单条消息大小的上限吗? | ||
|
|
||
| 对于 Avro 和 Canal-JSON 格式,消息是以行变更为单位发送的,一条 Kafka Message 仅包含一条行变更。一般情况下,消息的大小不会超过 Kafka 单条消息上限,因此,一般不需要限制单条消息大小。如果单条 Kafka 消息大小确实超过 Kafka 上限,请参考[为什么 TiCDC 到 Kafka 的同步任务延时越来越大](/ticdc/ticdc-faq.md#为什么-ticdc-到-kafka-的同步任务延时越来越大)。 | ||
| `max-message-bytes` 控制 TiCDC 将多条行变更合并为一条 Kafka message 时的大小,默认值为 `10 MB`。该参数不限制单条行变更编码后的消息大小。Kafka 能接收的消息大小由 Topic 的 `max.message.bytes` 或 broker 的 `message.max.bytes` 决定。 |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
补充 max-message-bytes 默认值的版本范围。
Line 243 将 10 MB 写成无条件默认值,但参数表说明该默认值仅从 v5.0.6 和 v4.0.6 开始生效;FAQ 对旧版本用户会产生误导。
建议替换
| `max-message-bytes` 控制 TiCDC 将多条行变更合并为一条 Kafka message 时的大小,默认值为 `10 MB`。该参数不限制单条行变更编码后的消息大小。Kafka 能接收的消息大小由 Topic 的 `max.message.bytes` 或 broker 的 `message.max.bytes` 决定。 | |
| `max-message-bytes` 控制 TiCDC 将多条行变更合并为一条 Kafka message 时的大小,默认值为 `10 MB`。从 v5.0.6 和 v4.0.6 开始,该参数的默认值分别从 `64 MB` 和 `256 MB` 调整至 `10 MB`。该参数不限制单条行变更编码后的消息大小。Kafka 能接收的消息大小由 Topic 的 `max.message.bytes` 或 broker 的 `message.max.bytes` 决定。 |
根据路径说明:可安全连续替换的修复必须提供 GitHub committable suggestion。
Source: Path instructions
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 1a5037df-581d-4431-a64d-c0d5aacb9a66
📒 Files selected for processing (4)
ticdc/ticdc-faq.mdticdc/ticdc-open-protocol.mdticdc/ticdc-sink-to-kafka.mdticdc/troubleshoot-ticdc.md
💤 Files with no reviewable changes (1)
- ticdc/ticdc-faq.md
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 1c98e889-9bb5-47fb-9067-abae08ecd22a
📒 Files selected for processing (3)
ticdc/ticdc-open-protocol.mdticdc/ticdc-sink-to-kafka.mdticdc/troubleshoot-ticdc.md
| | `kafka-client-id` | 指定同步任务的 Kafka 客户端的 ID(可选,默认值为 `TiCDC_sarama_producer_同步任务的 ID`)。 | | ||
| | `partition-num` | 下游 Kafka partition 数量(可选,不能大于实际 partition 数量,否则创建同步任务会失败,默认值 `3`)。| | ||
| | `max-message-bytes` | 每次向 Kafka broker 发送消息的最大数据量(可选,默认值 `10MB`,最大值为 `100MB`)。从 v5.0.6 和 v4.0.6 开始,默认值分别从 `64MB` 和 `256MB` 调整至 `10MB`。| | ||
| | `max-message-bytes` | Open Protocol Message 的大小阈值(可选,默认值 `10 MB`,最大值为 `100 MB`)。实际生效规则参见[控制 Message 中的 Event 数量和大小](/ticdc/ticdc-open-protocol.md#控制-message-中的-event-数量和大小)。| |
There was a problem hiding this comment.
为什么还要保留 max-message-bytes 这个参数?
First-time contributors' checklist
What is changed, added or deleted? (Required)
Which TiDB version(s) do your changes apply to? (Required)
Tips for choosing the affected version(s):
By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.
For details, see tips for choosing the affected versions (in Chinese).
What is the related PR or file link(s)?
AI agent involvement
Do your changes match any of the following descriptions?
Summary by CodeRabbit
max-message-bytes仅用于多条行变更合并为同一 Kafka message 的大小阈值(默认 10MB,最大 100MB),不限制单条行变更编码后的大小;补充默认值调整与 Open Protocol 相关规则。max-batch-size/max-message-bytes,超阈按新 message 切分。ErrMessageTooLarge/Message was too large故障处理:按版本优先调 Topic/Broker 限制,并补充large-message-handle-option等可选方案。