Skip to content

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

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

ekexium wants to merge 2 commits into
pingcap:masterfrom
ekexium: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.

  • 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

  • Documentation
    • Documented the optional include-start-ts setting for Debezium JSON changefeed messages.
    • Clarified that it adds the source transaction’s original PD TSO as source.start_ts to DML events.
    • Added documentation for Simple JSON messages, where the setting adds a top-level startTs field to DML events.
    • Added configuration guidance for sink settings, URI parameters, defaults, precedence, and availability.
    • Documented compatibility limitations, including rejection for Avro and unsupported protocols, while preserving existing output when disabled.

Document the optional Debezium JSON source.start_ts field (v8.5.9): URI
debezium-include-start-ts, TOML include-start-ts, URI precedence, DML-only
scope, and uint64 PD TSO precision.
Copilot AI lite review requested due to automatic review settings August 26, 2026 08:30
@ekexium ekexium added type/enhancement The issue or PR belongs to an enhancement. 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. 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 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 missing-translation-status This PR does not have translation status info. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels 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: 3ea4558b-c269-419e-9f7b-2047c3d8b4e5

📥 Commits

Reviewing files that changed from the base of the PR and between 8069706 and 0bc8eff.

📒 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

The documentation adds optional transaction start TSO fields for Debezium and Simple JSON DML messages. It documents configuration methods, precedence, defaults, supported formats, protocol restrictions, and OpenAPI parameters.

Changes

Transaction start TSO documentation

Layer / File(s) Summary
Output field documentation
ticdc/ticdc-debezium.md, ticdc/ticdc-simple-protocol.md
Documents source.start_ts for Debezium JSON DML messages and startTs for Simple JSON DML messages, including defaults, message scope, TSO semantics, and precision requirements.
Configuration surfaces
ticdc/ticdc-changefeed-config.md, ticdc/ticdc-sink-to-kafka.md, ticdc/ticdc-open-api-v2.md
Documents changefeed settings, URI parameters, precedence rules, protocol and encoding restrictions, and OpenAPI parameters for both protocols.

Priority: ⬇️ Low

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

Change: Other

Suggested reviewers: qiancai

Merge Risk: ⚪ Minimal · up to 0bc8e

The documented Debezium Avro restriction matches the supported TiCDC protocol configuration. No actionable merge risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Description check ✅ Passed The description is complete and follows the repository template. It explains the documentation changes, selects master, provides related links, records AI involvement, and addresses the remaining chec…
Title check ✅ Passed The title clearly identifies the main change: documenting transaction start TSO support for TiCDC Debezium and Simple protocols.
✨ 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

This PR updates TiCDC Kafka/Debezium documentation to describe the new optional source.start_ts field (introduced in v8.5.9) and how to enable it via sink URI, changefeed config, and the OpenAPI v2 config model.

Changes:

  • Adds the debezium-include-start-ts sink URI parameter to the Kafka sink reference.
  • Documents [sink.debezium] include-start-ts in the changefeed configuration reference and include_start_ts in the OpenAPI v2 sink.debezium config.
  • Expands the Debezium protocol doc with a new “Include the transaction start TSO” section and adds payload.source.start_ts to the field table.

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 Adds a new sink URI parameter to enable emitting source.start_ts in Debezium JSON DML messages.
ticdc/ticdc-open-api-v2.md Documents the new sink.debezium.include_start_ts OpenAPI v2 config field.
ticdc/ticdc-debezium.md Adds a new section describing behavior/limitations and documents payload.source.start_ts in the message field table.
ticdc/ticdc-changefeed-config.md Documents the new [sink.debezium] include-start-ts changefeed configuration item and its precedence rules.

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

Comment thread ticdc/ticdc-open-api-v2.md Outdated
| Parameter name | Description |
|:-------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `output_old_value` | `BOOLEAN` type. It controls whether to output the value before the row data changes. The default value is true. When it is disabled, the UPDATE event does not output the "before" field. |
| `include_start_ts` | `BOOLEAN` type. New in v8.5.9. It controls whether Debezium JSON DML messages include `source.start_ts` (the original PD TSO of the source transaction). The default value is `false`. |
Comment thread ticdc/ticdc-debezium.md Outdated

- DML value messages add integer `source.start_ts` next to `commit_ts`, and the JSON schema declares the field as `int64`.
- DDL events, WATERMARK/checkpoint events, key messages, and Debezium Avro are unchanged. Setting this option with the Debezium Avro protocol is rejected.
- To roll back, disable the option. Messages produced while it is off stay byte-compatible with the previous format.
Comment thread ticdc/ticdc-debezium.md Outdated

> **Note:**
>
> `start_ts` is the original uint64 PD TSO, not a millisecond timestamp. Consumers must treat it as a 64-bit integer or a decimal string. Do not parse it as a JavaScript `Number` or IEEE-754 `float64`, which cannot represent an 18-digit TSO exactly.
Comment thread ticdc/ticdc-debezium.md Outdated
| `payload.before` | JSON | The data value before the change event of a statement. For `"c"` events, the value of the `before` field is `null`. |
| `payload.after` | JSON | The data value after the change event of a statement. For `"d"` events, the value of the `after` field is `null`. |
| `payload.source.commit_ts` | Number | The `CommitTs` value of the event. |
| `payload.source.start_ts` | Number | The start TSO of the source transaction. Present only when `debezium-include-start-ts` or `[sink.debezium] include-start-ts` is enabled. Original uint64 PD TSO, not a millisecond timestamp. |
@ekexium ekexium added the translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. label Aug 26, 2026
@ti-chi-bot ti-chi-bot Bot removed the missing-translation-status This PR does not have translation status info. label Aug 26, 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: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 72067aab-fc9f-4682-ae05-31418d6562df

📥 Commits

Reviewing files that changed from the base of the PR and between ff98075 and 8069706.

📒 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-debezium.md Resolved
Comment thread ticdc/ticdc-debezium.md Outdated
When this option is enabled:

- DML value messages add integer `source.start_ts` next to `commit_ts`, and the JSON schema declares the field as `int64`.
- DDL events, WATERMARK/checkpoint events, key messages, and Debezium Avro are unchanged. Setting this option with the Debezium Avro protocol is rejected.

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 | 🟡 Minor | ⚡ Quick win

Use Avro protocol consistently.

The supplied protocol lists define avro and debezium as separate values. “Debezium Avro” is not the established protocol name and can confuse configuration users.

  • ticdc/ticdc-debezium.md#L56-L56: refer to the rejected format as the Avro protocol.
  • ticdc/ticdc-changefeed-config.md#L360-L360: refer to the rejected format as the Avro protocol.
  • ticdc/ticdc-sink-to-kafka.md#L86-L86: refer to the rejected format as the Avro protocol.

As per path instructions: preserve established terminology in Markdown.

📍 Affects 3 files
  • ticdc/ticdc-debezium.md#L56-L56 (this comment)
  • ticdc/ticdc-changefeed-config.md#L360-L360
  • ticdc/ticdc-sink-to-kafka.md#L86-L86

Source: Path instructions

@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 changed the title ticdc: document Debezium source.start_ts option ticdc: document transaction start TSO in Debezium and Simple 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
@qiancai qiancai added the v9.0-beta.3 This PR/issue applies to TiDB v9.0-beta.3. label Oct 29, 2026
@lilin90 lilin90 added v9.0-beta.3 This PR/issue applies to TiDB v9.0-beta.3. and removed v9.0-beta.3 This PR/issue applies to TiDB v9.0-beta.3. labels Nov 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/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. type/enhancement The issue or PR belongs to an enhancement. v9.0-beta.3 This PR/issue applies to TiDB v9.0-beta.3.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants