-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cdc: add description about the tidb extension field #19369
Open
3AceShowHand
wants to merge
2
commits into
pingcap:master
Choose a base branch
from
3AceShowHand:canal-json-table-id
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+15
−1
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -82,7 +82,21 @@ TiCDC 会把一个 DDL Event 编码成如下 Canal-JSON 格式: | |||||||||||||||||||||
| mysqlType | object | 当 isDdl 为 false 时,记录每一列数据类型在 MySQL 中的类型表示 | | ||||||||||||||||||||||
| data | Object | 当 isDdl 为 false 时,记录每一列的名字及其数据值 | | ||||||||||||||||||||||
| old | Object | 仅当该条消息由 Update 类型事件产生时,记录每一列的名字,和 Update 之前的数据值 | | ||||||||||||||||||||||
| _tidb | Object | TiDB 扩展字段,仅当 `enable-tidb-extension` 为 true 时才会存在。其中的 `commitTs` 值为造成 Row 变更的事务的 TSO | | ||||||||||||||||||||||
| _tidb | Object | TiDB 扩展字段,仅当 `enable-tidb-extension` 为 true 时才会存在。 | | ||||||||||||||||||||||
|
||||||||||||||||||||||
|
||||||||||||||||||||||
_tidb 即 TiDB 扩展字段,其子字段说明如下: | ||||||||||||||||||||||
|
||||||||||||||||||||||
| 字段 | 类型 | 说明 | | ||||||||||||||||||||||
|:-------------------|:-------|:-------------------------------------------------------------------------| | ||||||||||||||||||||||
| commitTs | Number | 产生事件变更的事务提交使用的 TSO。设置于 DDL 和 DML 事件 | | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||
| watermarkTs | Number | TiCDC 周期性发送的 Watermark Ts,其类型也是 TSO。设置于 Watermark 事件| | ||||||||||||||||||||||
| tableId | Number | 事件所属表的 ID。设置于 DML 事件 | | ||||||||||||||||||||||
| partitionId | Number | 事件如果来自于分区表,消息会携带该字段,表示所属分区的 ID。设置于 DML 事件 | | ||||||||||||||||||||||
| onlyHandleKey | Bool | 当前事件仅包含 handle key 部分内容。设置于 DML 事件 | | ||||||||||||||||||||||
| claimCheckLocation | String | 当前事件含有 claim check location。设置于 DML 事件 | | ||||||||||||||||||||||
Comment on lines
+93
to
+97
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||
|
||||||||||||||||||||||
`tableId` 和 `partitionId` 字段从 xxx 版本开始引入,主要目的是为了应对分区表场景下,消费者可以通过 `partitionId` 得知当前事件所属的表分区,以及关联的分区表。 | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 记得加上版本号 |
||||||||||||||||||||||
|
||||||||||||||||||||||
### DML Event | ||||||||||||||||||||||
|
||||||||||||||||||||||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.