Skip to content

ticdc: clarify scheduler.write-key-threshold across architectures - #23949

Open
doc-claw-bot wants to merge 3 commits into
pingcap:release-8.5from
doc-claw-bot:docs/write-key-threshold-r85-20260924
Open

doc-claw-bot wants to merge 3 commits into
pingcap:release-8.5from
doc-claw-bot:docs/write-key-threshold-r85-20260924

Conversation

@doc-claw-bot

@doc-claw-bot doc-claw-bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

First-time contributors' checklist

What is changed, added or deleted? (Required)

  • Clarify that scheduler.write-key-threshold uses different metrics in the TiCDC classic and new architectures.
  • Document that the new architecture treats 0 as disabling traffic-based splitting and auto-adjusts positive values below 10485760 (10 MiB) when scheduler.enable-table-across-nodes = true.
  • Update the affected TiCDC pages to remove the stale "modified rows per minute" wording and align the Kafka example comments with the actual implementation.

Which TiDB version(s) do your changes apply to? (Required)

  • master (the latest development version)
  • v8.5 (TiDB 8.5 versions)
  • v8.4 (TiDB 8.4 versions)
  • v8.3 (TiDB 8.3 versions)
  • v8.2 (TiDB 8.2 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)?

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
    • Clarified how traffic-based table splitting measures write load in classic and new TiCDC architectures.
    • Documented the 10 MiB/s minimum effective threshold in the new architecture and the evaluation order when traffic and Region thresholds are both configured.
    • Clarified table allocation behavior and when dispatchers apply.
    • Updated guidance to identify Syncpoint, Redo Log, Pulsar Sink, and Storage Sink as not recommended for core production environments.

@ti-chi-bot

ti-chi-bot Bot commented Sep 24, 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 breezewish 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 contribution This PR is from a community contributor. missing-translation-status This PR does not have translation status info. labels Sep 24, 2026
@ti-chi-bot ti-chi-bot Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 24, 2026
@doc-claw-bot doc-claw-bot added type/bugfix This PR fixes a bug. area/ticdc Indicates that the Issue or PR belongs to the area of TiCDC. translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. needs-cherry-pick-master Should cherry pick this PR to master branch. and removed missing-translation-status This PR does not have translation status info. labels Sep 24, 2026
@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
Walkthrough

The TiCDC documentation now defines architecture-specific write-threshold metrics, minimum values, evaluation order, MQ dispatcher applicability, and architecture limitations.

Changes: TiCDC documentation

Layer / File(s) Summary
Table-splitting threshold documentation
ticdc/ticdc-architecture.md, ticdc/ticdc-changefeed-config.md, ticdc/ticdc-sink-to-kafka.md
The documents define classic and new architecture threshold metrics. Positive new-architecture values below 10 MiB/s are adjusted to 10 MiB/s. The sink-to-Kafka documentation states that write traffic is checked before Region count.
MQ dispatcher configuration
ticdc/ticdc-changefeed-config.md
The documentation states that dispatcher settings apply only when the downstream is MQ and removes a new-architecture routing note.
Architecture limitations
ticdc/ticdc-architecture.md
The limitations section marks Syncpoint, Redo Log, Pulsar Sink, and Storage Sink as not recommended for core production environments. It retains the large-transaction OOM warning.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Merge Risk: Low · previous review 7ff8f

The documentation may cause incorrect threshold configuration, but the impact is limited to configuration guidance.

Architecture risk: Low · up to 7ff8f

The change affects 1 system.

Changed systems: ticdc

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — ticdc (service) was modified; 3 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in ticdc/ticdc-changefeed-config.md: The second allocation mode of enable-table-across-nodes is rewritten: nodes now handle a "similar amount of write load" instead of "roughly the same number of modified rows", and the metric is specified per architecture (PD Region written_keys statistics in classic, sink DML event size per second in new), with allocation still gated by write-key-threshold.
  • observed — Modified behavior in ticdc/ticdc-changefeed-config.md: write-key-threshold documentation is updated: the default 0 is now described as disabling traffic-based allocation; in the new architecture the value is measured in sink DML event bytes per second, with any positive value below 10485760 (10 MiB) auto-adjusted to 10485760 when scheduler.enable-table-across-nodes = true; in the classic architecture the value is the threshold for the upstream PD Region written_keys statistics used by classic table splitting.
  • observed — Modified behavior in ticdc/ticdc-changefeed-config.md: In the dispatchers section, the v8.5.7 note about using dispatchers for table routing in the new architecture is removed, the opening sentence is reworded from "when the changefeed downstream is an MQ sink" to "for the sink of MQ type", and a new line states the configuration only takes effect if the downstream is MQ.
  • observed — Modified behavior in ticdc/ticdc-architecture.md: The table-splitting condition now refers to sink DML event throughput exceeding the configured threshold instead of table write traffic.
Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title clearly identifies the main change: clarifying scheduler.write-key-threshold behavior across TiCDC architectures.
Description check Passed The description covers the required change summary, affected versions, reference links, AI involvement, and applicable checklist items. It is sufficiently complete for review.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)

Finishing Touches

🧪 Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@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: Repository: pingcap/docs/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: fe6df806-bff0-4ed1-80d4-a9c126709682

📥 Commits

Reviewing files that changed from the base of the PR and between 8503bb1 and 0775fe4.

📒 Files selected for processing (3)
  • ticdc/ticdc-architecture.md
  • ticdc/ticdc-changefeed-config.md
  • ticdc/ticdc-sink-to-kafka.md

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.

# TiCDC will check whether the write traffic is greater than `write-key-threshold` first.
# If not, next check whether the number of Regions is greater than `region-threshold`.
write-key-threshold = 30000
write-key-threshold = 10485760

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🚀 Performance & Scalability | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

git diff --no-ext-diff 1e852511d8a7994ebdeb3641b5462d4844434016 0775fe4fb5e3c135c77ffb7f6077aabbfeedc12c -- ticdc/ticdc-sink-to-kafka.md
printf '\n--- current section ---\n'
sed -n '340,392p' ticdc/ticdc-sink-to-kafka.md

Repository: pingcap/docs

Length of output: 7192


Mark the sample threshold as new-architecture-specific.

The page also covers classic TiCDC, where write-key-threshold uses PD Region written_keys. Direct classic users to choose a threshold based on that statistic.

Suggested fix
-write-key-threshold = 10485760
+write-key-threshold = 10485760 # Example for the new architecture; choose a classic value based on PD Region written_keys.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
write-key-threshold = 10485760
write-key-threshold = 10485760 # Example for the new architecture; choose a classic value based on PD Region written_keys.

@doc-claw-bot
doc-claw-bot force-pushed the docs/write-key-threshold-r85-20260924 branch from 0775fe4 to 8d441a5 Compare September 24, 2026 14:49

@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: Repository: pingcap/docs/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: c6f2e940-4776-46ba-b974-d6b625ad5efc
📥 Commits

Reviewing files that changed from the base of the PR and between 8d441a5 and 7ff8f4e.

📒 Files selected for processing: 2
  • ticdc/ticdc-architecture.md
  • ticdc/ticdc-sink-to-kafka.md

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Comment thread ticdc/ticdc-architecture.md Outdated
- [`scheduler.region-threshold`](/ticdc/ticdc-changefeed-config.md#region-threshold): the default value is `10000`. When the number of Regions in a table exceeds this threshold, TiCDC splits the table. For tables with relatively few Regions but high overall write throughput, you can reduce this value appropriately. This parameter must be greater than or equal to `scheduler.region-count-per-span`. Otherwise, tasks might be rescheduled repeatedly, which increases replication latency.
- [`scheduler.region-count-per-span`](/ticdc/ticdc-changefeed-config.md#region-count-per-span-new-in-v854): the default value is `100`. During changefeed initialization, TiCDC splits tables that meet the split conditions according to this parameter. After splitting, each sub-table contains at most `region-count-per-span` Regions.
- [`scheduler.write-key-threshold`](/ticdc/ticdc-changefeed-config.md#write-key-threshold): the default value is `0` (disabled). When the sink write throughput of a table exceeds this threshold, TiCDC triggers table splitting. In most cases, keep this parameter at `0`.
- [`scheduler.write-key-threshold`](/ticdc/ticdc-changefeed-config.md#write-key-threshold): the default value is `0` (disabled). In the new architecture, this value is measured in sink DML event bytes per second. When `scheduler.enable-table-across-nodes = true`, if you set a positive value smaller than `10485760` (10 MiB), TiCDC automatically adjusts it to `10485760`. In most cases, keep this parameter at `0`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

sed -n '74,80p' ticdc/ticdc-architecture.md
sed -n '174,181p' ticdc/ticdc-changefeed-config.md
sed -n '373,382p' ticdc/ticdc-sink-to-kafka.md

Repository: pingcap/docs

Length of output: 3014


Use 10 MiB/s for the new-architecture minimum in all three pages.

Each occurrence describes scheduler.write-key-threshold as sink DML event bytes per second, but labels the minimum as 10 MiB. Update the parenthetical at ticdc/ticdc-architecture.md:77, ticdc/ticdc-changefeed-config.md:178, and ticdc/ticdc-sink-to-kafka.md:377-378 to 10 MiB/s.

@ti-chi-bot

ti-chi-bot Bot commented Nov 20, 2026

Copy link
Copy Markdown

@wk989898: adding LGTM is restricted to approvers and reviewers in OWNERS files.

Details

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

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

Labels

area/ticdc Indicates that the Issue or PR belongs to the area of TiCDC. contribution This PR is from a community contributor. needs-cherry-pick-master Should cherry pick this PR to master branch. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. type/bugfix This PR fixes a bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants