Skip to content

cdc: add kafka max-message-bytes related explain#23352

Open
3AceShowHand wants to merge 1 commit into
pingcap:masterfrom
3AceShowHand:ticdc-kafka-max-message-bytes
Open

cdc: add kafka max-message-bytes related explain#23352
3AceShowHand wants to merge 1 commit into
pingcap:masterfrom
3AceShowHand:ticdc-kafka-max-message-bytes

Conversation

@3AceShowHand

@3AceShowHand 3AceShowHand commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

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.

  • master (the latest development version)
  • v9.0 (TiDB 9.0 versions)
  • v8.5 (TiDB 8.5 versions)
  • v8.1 (TiDB 8.1 versions)
  • v7.5 (TiDB 7.5 versions)
  • v7.1 (TiDB 7.1 versions)
  • v6.5 (TiDB 6.5 versions)

What is the related PR or file link(s)?

  • This PR is translated from:
  • Other reference link(s):

AI agent involvement

  • The changes in this PR were primarily made by an AI agent on behalf of the PR author.

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

Summary by CodeRabbit

  • Documentation
    • Added guidance on controlling Open Protocol event batching and message sizes, including max-batch-size and max-message-bytes.
    • Clarified Kafka sink message-size limits, topic and broker settings, fallback behavior, and handling oversized messages.
    • Updated troubleshooting steps for ErrMessageTooLarge, including version-specific recovery instructions and alternative handling options.
    • Removed outdated FAQ guidance and refined Kafka configuration recommendations.

@ti-chi-bot

ti-chi-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign icemap for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot Bot added missing-translation-status This PR does not have translation status info. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 23, 2026
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The documentation updates describe Open Protocol event batching, Kafka message-size thresholds, oversized-message handling, and version-specific troubleshooting. They also remove superseded FAQ guidance and make minor formatting corrections.

Changes

Kafka message sizing

Layer / File(s) Summary
Open Protocol batching and sink configuration
ticdc/ticdc-open-protocol.md, ticdc/ticdc-sink-to-kafka.md
Documents max-batch-size, max-message-bytes, effective batching thresholds, and updated Kafka sink configuration guidance.
Message-size limits and error handling
ticdc/ticdc-sink-to-kafka.md, ticdc/troubleshoot-ticdc.md
Explains Kafka limit resolution, large-message-handle-option, and version-specific handling of ErrMessageTooLarge.
Related FAQ cleanup
ticdc/ticdc-faq.md
Removes superseded message-size FAQ content and adjusts the broken-pipe FAQ step formatting.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: contribution

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The template is present, but the required change summary is empty and no related links or version details are provided beyond master. Add a short summary of what changed and why, confirm affected versions, include any related links, and complete the remaining checkboxes if applicable.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is clearly related to the Kafka message-size documentation changes, though the wording is slightly awkward.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@3AceShowHand 3AceShowHand changed the title cdc cdc: add kafka max-message-bytes related explain Jul 23, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 91844770-f488-4ff5-b9a0-9a994f1c6a90

📥 Commits

Reviewing files that changed from the base of the PR and between caed46d and a9fdc29.

📒 Files selected for processing (4)
  • ticdc/ticdc-faq.md
  • ticdc/ticdc-open-protocol.md
  • ticdc/ticdc-sink-to-kafka.md
  • ticdc/troubleshoot-ticdc.md

Comment on lines +125 to +133
```ini
# The maximum message size accepted by the topic
max.message.bytes=<a value no smaller than the message to be sent>
# The maximum message size accepted by the broker; configure this when using the broker default limit
message.max.bytes=<a value no smaller than the message to be sent>
# The maximum message size that the broker can replicate
replica.fetch.max.bytes=<a value no smaller than message.max.bytes>
# The maximum message size that the consumer can read
fetch.message.max.bytes=<a value no smaller than the effective Kafka message size limit>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Candidate files =="
git ls-files | rg '(^|/)ticdc/troubleshoot-ticdc\.md$|resources/doc-templates|scripts/(markdownlint|verify-links)' || true

echo
echo "== Target snippet =="
if [ -f ticdc/troubleshoot-ticdc.md ]; then
  nl -ba ticdc/troubleshoot-ticdc.md | sed -n '100,150p'
fi

echo
echo "== Kafka config name occurrences =="
rg -n "fetch\.message\.max\.bytes|fetch\.max\.bytes|max\.partition\.fetch\.bytes|replica\.fetch\.max\.bytes|message\.max\.bytes|max\.message\.bytes" -S . || true

echo
echo "== Surrounding context in target =="
nl -ba ticdc/troubleshoot-ticdc.md | sed -n '110,135p'

Repository: pingcap/docs

Length of output: 597


🌐 Web query:

Apache Kafka 4.3 configuration consumer fetch.max.bytes max.partition.fetch.bytes fetch.message.max.bytes replica.fetch.max.bytes

💡 Result:

In Apache Kafka 4.3, these configurations manage the amount of data transferred during fetch operations. Note that fetch.message.max.bytes is not a standard configuration key in modern Kafka versions; it is often confused with broker-level or topic-level message size limits [1][2]. 1. fetch.max.bytes This is a consumer-side configuration [1]. It defines the maximum amount of data the server should return for a fetch request [1]. While it serves as a soft limit, if the first record batch in the first non-empty partition is larger than this value, the batch is still returned to ensure consumer progress [1]. The default value is 52,428,800 bytes (50 MiB) [1]. 2. max.partition.fetch.bytes This is a consumer-side configuration [1]. It sets the maximum amount of data the server will return for each partition in a fetch request [1]. Like fetch.max.bytes, if the first record batch is larger than this limit, it will still be returned to ensure progress [1]. The default value is 1,048,576 bytes (1 MiB) [1]. 3. replica.fetch.max.bytes This is a broker-side configuration that governs the maximum number of bytes the broker will attempt to fetch from another broker during replication for a single partition [3]. Note that historical documentation shows this setting exists to manage inter-broker traffic, separate from consumer-facing fetch settings [3]. 4. Regarding fetch.message.max.bytes There is no standard configuration named fetch.message.max.bytes in Apache Kafka 4.3 [1][2][4]. You are likely referring to the broker-level message size limit, message.max.bytes, or the topic-level equivalent, max.message.bytes [1][2][4]. These settings define the maximum allowed size of a record batch and are crucial because if they are set larger than the consumer's fetch settings, the consumer may be unable to fetch batches, potentially causing processing issues [1][4]. Summary Table Configuration | Type | Purpose | Default (4.3) fetch.max.bytes | Consumer | Max data for a full fetch request [1] | 52,428,800 [1] max.partition.fetch.bytes | Consumer | Max data per partition in a fetch [1] | 1,048,576 [1] replica.fetch.max.bytes | Broker | Max data per partition during replication [3] | 1,048,576 (varies) message.max.bytes | Broker | Max batch size allowed by broker [1][4] | 1,048,588 [4]

Citations:


Use the current Kafka consumer fetch settings.

fetch.message.max.bytes is not a Kafka config key for Kafka 4.3; replace it with the consumer configs fetch.max.bytes and max.partition.fetch.bytes. Keep replica.fetch.max.bytes sized for the effective Kafka message size limit, including topic settings that override broker defaults.

Committable replacement
Suggested change
```ini
# The maximum message size accepted by the topic
max.message.bytes=<a value no smaller than the message to be sent>
# The maximum message size accepted by the broker; configure this when using the broker default limit
message.max.bytes=<a value no smaller than the message to be sent>
# The maximum message size that the broker can replicate
replica.fetch.max.bytes=<a value no smaller than message.max.bytes>
# The maximum message size that the consumer can read
fetch.message.max.bytes=<a value no smaller than the effective Kafka message size limit>
# The maximum message size accepted by the topic
max.message.bytes=<a value no smaller than the message to be sent>
# The maximum message size accepted by the broker; configure this when using the broker default limit
message.max.bytes=<a value no smaller than the message to be sent>
# The maximum message size that a broker replica fetches per partition
replica.fetch.max.bytes=<a value no smaller than the effective Kafka message size limit>
# The maximum amount of data returned in a consumer.fetch request
fetch.max.bytes=<a value no smaller than the effective Kafka message size limit>
# The maximum amount of data returned per partition to the consumer
max.partition.fetch.bytes=<a value no smaller than the effective Kafka message size limit>

Source: Path instructions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

missing-translation-status This PR does not have translation status info. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant