Skip to content

ticdc: document transaction start TSO in Debezium and Simple - #21896

Open
ekexium wants to merge 2 commits into
pingcap:masterfrom
ekexium:translate/doc/ticdc-debezium-start-ts
Open

ekexium wants to merge 2 commits into
pingcap:masterfrom
ekexium:translate/doc/ticdc-debezium-start-ts

Conversation

@ekexium

@ekexium ekexium commented Aug 26, 2026

Copy link
Copy Markdown
Member

What is changed, added or deleted? (Required)

Document the optional source transaction TSO in Debezium JSON (source.start_ts) and Simple JSON (startTs) for the new TiCDC architecture. Both options are disabled by default and let consumers correlate row changes with their source transaction.

  • Cover URI and TOML configuration, explicit URI precedence (including false overriding true), DML-only scope, format restrictions, and integer precision.
  • Add Simple to the protocol, Kafka sink, changefeed configuration, and OpenAPI v2 references; preserve the default message examples.
  • Clarify the Debezium JSON integer versus int64 schema representation and complete its OpenAPI configuration contract.
  • Target master only. Remove the unconfirmed v8.5.9 availability claim; the release-8.5 implementation cherry-pick is still open.

Validation: Markdown lint and internal link checks for all five changed pages; new JSON/TOML examples parse successfully; behavior checked against the implementation and tests in the linked code PRs.

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).

  • 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)?

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

  • 新功能

    • Debezium JSON DML 消息支持可选输出源事务开始 TSO:source.start_ts
    • Simple JSON DML 消息支持可选输出顶层 startTs 字段。
    • 可通过配置或 URI 参数启用,URI 参数优先于配置文件;默认关闭。
    • 仅适用于对应的 JSON 消息,Avro 或不兼容协议下启用将被拒绝。
  • 文档

    • 补充配置方式、消息示例、字段说明、兼容性限制及 TSO 精度注意事项。

Copilot AI lite review requested due to automatic review settings August 26, 2026 08:36
@ekexium ekexium added area/ticdc Indicates that the Issue or PR belongs to the area of TiCDC. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. translation/from-docs This PR is translated from a PR in pingcap/docs. type/enhancement The issue or PR belongs to an enhancement. labels Aug 26, 2026
@ti-chi-bot

ti-chi-bot Bot commented Aug 26, 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 kissmydb 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 the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 26, 2026
@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 9a488050-e257-4c23-97a6-8d8e30289da3

📥 Commits

Reviewing files that changed from the base of the PR and between 92bb802 and 3492686.

📒 Files selected for processing (5)
  • ticdc/ticdc-changefeed-config.md
  • ticdc/ticdc-debezium.md
  • ticdc/ticdc-open-api-v2.md
  • ticdc/ticdc-simple-protocol.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.


📝 Walkthrough

Walkthrough

文档新增 Debezium 和 Simple JSON DML 消息中事务开始 TSO 的配置、参数优先级、协议限制、兼容性说明和字段定义。默认不输出该字段,URI 参数可覆盖配置文件设置。

Changes

事务开始 TSO 配置与消息字段

Layer / File(s) Summary
配置项与 URI 参数
ticdc/ticdc-changefeed-config.md, ticdc/ticdc-open-api-v2.md, ticdc/ticdc-sink-to-kafka.md
新增 Debezium 和 Simple 的配置项、OpenAPI 参数及 Kafka URI 参数说明。文档说明默认值、URI 参数优先级、适用协议、编码条件和拒绝规则。
Debezium 输出字段说明
ticdc/ticdc-debezium.md
补充 source.start_ts 的启用条件、事件范围、Avro 限制、兼容性说明、uint64 PD TSO 精度要求、JSON 示例和字段定义。
Simple 输出字段说明
ticdc/ticdc-simple-protocol.md
补充 startTs 的启用方式、DML 事件范围、Avro 限制、JSON 示例、精度要求和 INSERT、UPDATE、DELETE 字段定义。

Priority: ⬇️ Low

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

Change: Other

Suggested reviewers: qiancai, 3aceshowhand

Merge Risk: ⚪ Minimal · up to 34926

The new transaction-start TSO documentation is internally consistent and preserves default message behavior, with no actionable merge risk identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 标题准确概括了主要变更:为 TiCDC Debezium 和 Simple 文档增加事务开始 TSO 说明。标题简洁且与变更内容一致。
Description check ✅ Passed 描述完整覆盖变更内容、适用版本、相关 PR、验证方式和 AI 参与情况。已选择 master,且未发现影响评审的必需信息缺失。
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.
✨ 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.

Copilot AI 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.

Pull request overview

该 PR 为 TiCDC 的 Debezium JSON 输出补充文档:新增/补全 source.start_ts(源事务开始时的原始 PD TSO)相关配置、OpenAPI 字段说明,以及消息字段表格条目,帮助下游消费者实现更精确的事务分组或 exactly-once 处理。

Changes:

  • 在 Debezium 协议文档中新增“包含事务开始 TSO(v8.5.9 引入)”小节,说明开启方式、影响范围与精度注意事项。
  • 在 Kafka sink URI 参数、changefeed 配置项、OpenAPI v2 参数说明中补充 include_start_ts/include-start-ts 及对应 URI 参数。
  • 在 Debezium DML payload 字段表中补充 payload.source.start_ts 行说明。

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
ticdc/ticdc-sink-to-kafka.md 为 Kafka sink URI 参数表新增 debezium-include-start-ts 说明与链接。
ticdc/ticdc-open-api-v2.md 为 OpenAPI v2 的 sink.debezium 参数表新增 include_start_ts 字段说明。
ticdc/ticdc-debezium.md 新增“包含事务开始 TSO”小节,并在 DML 字段表中新增 payload.source.start_ts 说明。
ticdc/ticdc-changefeed-config.md 为 changefeed 配置 sink.debezium 增加 include-start-ts 配置项说明与引用链接。
Suppressed comments (2)

ticdc/ticdc-debezium.md:59

  • 为避免读者将 uint64 误认为普通文本,建议将类型名用反引号标注,并将 “IEEE-754” 按常见写法写为 “IEEE 754”。
> `start_ts` 是原始的 uint64 PD TSO,不是毫秒时间戳。消费者必须将其作为 64 位整数或十进制字符串处理。不要将其解析为 JavaScript `Number` 或 IEEE-754 `float64`,后者无法精确表示 18 位 TSO。

ticdc/ticdc-debezium.md:614

  • 表格行里同样建议将类型名 uint64 用反引号标注,便于读者识别为数据类型,并与上文注意事项的写法保持一致。
| `payload.source.start_ts`      | 数值  | 源事务的开始 TSO。仅在启用 `debezium-include-start-ts` 或 `[sink.debezium] include-start-ts` 时出现。原始 uint64 PD TSO,不是毫秒时间戳。 |

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread ticdc/ticdc-debezium.md Outdated
Comment on lines +38 to +40
```
kafka://127.0.0.1:9092/topic-name?protocol=debezium&debezium-include-start-ts=true
```
Comment thread ticdc/ticdc-debezium.md Outdated
Comment on lines +53 to +55
- DML 消息的 value 会在 `commit_ts` 旁增加整型字段 `source.start_ts`,JSON schema 将该字段声明为 `int64`。
- DDL 事件、WATERMARK 事件、key 消息和 Debezium Avro 不受影响。将该选项与 Debezium Avro 协议一起使用会被拒绝。
- 如需回滚,关闭该选项即可。关闭期间产出的消息与此前格式保持兼容。
Comment thread ticdc/ticdc-sink-to-kafka.md Outdated
| `compression` | 设置发送消息时使用的压缩算法(可选值为 `none`、`lz4`、`gzip`、`snappy` 和 `zstd`,默认值为 `none`)。注意 Snappy 压缩文件必须遵循[官方 Snappy 格式](https://github.com/google/snappy)。不支持其他非官方压缩格式。|
| `auto-create-topic` | 当传入的 `topic-name` 在 Kafka 集群不存在时,TiCDC 是否要自动创建该 topic(可选,默认值 `true`)。 |
| `enable-tidb-extension` | 可选,默认值是 `false`。当输出协议为 `canal-json` 时,如果该值为 `true`,TiCDC 会发送 [WATERMARK 事件](/ticdc/ticdc-canal-json.md#watermark-event),并在 Kafka 消息中添加 TiDB 扩展字段。从 6.1.0 开始,该参数也可以和输出协议 `avro` 一起使用。如果该值为 `true`,TiCDC 会在 Kafka 消息中添加[三个 TiDB 扩展字段](/ticdc/ticdc-avro-protocol.md#tidb-扩展字段)。|
| `debezium-include-start-ts` | 可选,从 v8.5.9 开始引入,默认值是 `false`。仅当 `protocol` 为 `debezium` 时生效。如果该值为 `true`,TiCDC 会在 Debezium JSON DML 消息中添加 `source.start_ts`(源事务的原始 PD TSO)。显式指定的 URI 参数优先于配置文件中的 `[sink.debezium] include-start-ts`。该选项与 Debezium Avro 一起使用会被拒绝。详情请参考 [TiCDC Debezium Protocol](/ticdc/ticdc-debezium.md#包含事务开始-tso)。 |
Comment thread ticdc/ticdc-changefeed-config.md Outdated
- 控制 Debezium JSON DML 消息是否包含 `source.start_ts`(源事务的原始 PD TSO)。
- 默认值:`false`
- 该参数只有当 sink 类型为 MQ 且输出协议为 Debezium JSON 时才生效。与 Debezium Avro 一起设置会被拒绝。
- 你也可以设置等价的 URI 参数 `debezium-include-start-ts`。显式指定的 URI 参数优先于该配置项,包括使用 `false` 覆盖 `true`。

@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: 799e85ae-e1f8-4ad7-b327-ef5b30376447

📥 Commits

Reviewing files that changed from the base of the PR and between d189954 and 92bb802.

📒 Files selected for processing (4)
  • ticdc/ticdc-changefeed-config.md
  • ticdc/ticdc-debezium.md
  • ticdc/ticdc-open-api-v2.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.

Comment thread ticdc/ticdc-open-api-v2.md Outdated
@ekexium ekexium changed the title ticdc: document Debezium source.start_ts option ticdc: document transaction start TSO in Debezium and Simple Sep 11, 2026
@ti-chi-bot ti-chi-bot Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 11, 2026
@ekexium ekexium removed the needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. label Sep 11, 2026
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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. translation/from-docs This PR is translated from a PR in pingcap/docs. type/enhancement The issue or PR belongs to an enhancement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants