cdc有时候会出现一些非数据的消息。

为提高效率,请提供以下信息,问题描述清晰能够更快得到解决:

【TiDB 版本】4.0.10

【问题描述】

changefeed配置中,协议选择的是canal-json,输出到kafka。
kafka里面有期望的正常消息,同时还有如下的消息,请问这种消息的用途是什么:

ConsumerRecord(topic = ticdc-sold_product, partition = 11, leaderEpoch = 0, offset = 532, CreateTime = 1611902917364, serialized key size = 1296, serialized value size = 4564, headers = RecordHeaders(headers = [], isReadOnly = false), key = T{“ts”:422550677955018811,“scm”:“sold_product”,“tbl”:“itemMoved”,“rid”:1655322,“t”:1}T{“ts”:422550677955018811,“scm”:“sold_product”,“tbl”:“itemMoved”,“rid”:1655323,“t”:1}T{“ts”:422550677994340413,“scm”:“sold_product”,“tbl”:“itemMoved”,“rid”:1655323,“t”:1}T{“ts”:422550677994340413,“scm”:“sold_product”,“tbl”:“itemMoved”,“rid”:1655324,“t”:1}T{“ts”:422550678033662027,“scm”:“sold_product”,“tbl”:“itemMoved”,“rid”:1655324,“t”:1}T{“ts”:422550678033662027,“scm”:“sold_product”,“tbl”:“itemMoved”,“rid”:1655325,“t”:1}T{“ts”:422550678086090784,“scm”:“sold_product”,“tbl”:“itemMoved”,“rid”:1655325,“t”:1}T{“ts”:422550678086090784,“scm”:“sold_product”,“tbl”:“itemMoved”,“rid”:1655326,“t”:1}T{“ts”:422550678125412378,“scm”:“sold_product”,“tbl”:“itemMoved”,“rid”:1655326,“t”:1}T{“ts”:422550678125412378,“scm”:“sold_product”,“tbl”:“itemMoved”,“rid”:1655327,“t”:1}T{“ts”:422550678151626819,“scm”:“sold_product”,“tbl”:“itemMoved”,“rid”:1655327,“t”:1}T{“ts”:422550678151626819,“scm”:“sold_product”,“tbl”:“itemMoved”,“rid”:1655328,“t”:1}T{“ts”:422550678190948414,“scm”:“sold_product”,“tbl”:“itemMoved”,“rid”:1655328,“t”:1}T{“ts”:422550678190948414,“scm”:“sold_product”,“tbl”:“itemMoved”,“rid”:1655329,“t”:1}, value = >{“d”:{“dbName”:{“t”:15,“f”:0,“v”:“sold_product”},“lastFlag”:{“t”:8,“f”:129,“v”:1042381931},“lastTime”:{“t”:3,“f”:129,“v”:0},“modifyTime”:{“t”:7,“f”:1,“v”:“2021-01-28 15:11:38”},“movedNum”:{“t”:8,“f”:129,“v”:13706588},“movedTime”:{“t”:8,“f”:129,“v”:33930002},“tableName”:{“t”:15,“h”:true,“f”:26,“v”:“boughtItem_isbn”}}}>{“u”:{“dbName”:{“t”:15,“f”:0,“v”:“sold_product”},“lastFlag”:{“t”:8,“f”:129,“v”:1042394313},“lastTime”:{“t”:3,“f”:129,“v”:0},“modifyTime”:{“t”:7,“f”:1,“v”:“2021-01-28 15:11:38”},“movedNum”:{“t”:8,“f”:129,“v”:13706973},“movedTime”:{“t”:8,“f”:129,“v”:33930117},“tableName”:{“t”:15,“h”:true,“f”:26,“v”:“boughtItem_isbn”}}}>{“d”:{“dbName”:{“t”:15,“f”:0,“v”:“sold_product”},“lastFlag”:{“t”:8,“f”:129,“v”:1042394313},“lastTime”:{“t”:3,“f”:129,“v”:0},“modifyTime”:{“t”:7,“f”:1,“v”:“2021-01-28 15:11:38”},“movedNum”:{“t”:8,“f”:129,“v”:13706973},“movedTime”:{“t”:8,“f”:129,“v”:33930117},“tableName”:{“t”:15,“h”:true,“f”:26,“v”:“boughtItem_isbn”}}}>{“u”:{“dbName”:{“t”:15,“f”:0,“v”:“sold_product”},“lastFlag”:{“t”:8,“f”:129,“v”:1042402790},“lastTime”:{“t”:3,“f”:129,“v”:0},“modifyTime”:{“t”:7,“f”:1,“v”:“2021-01-28 15:11:38”},“movedNum”:{“t”:8,“f”:129,“v”:13707413},“movedTime”:{“t”:8,“f”:129,“v”:33930266},“tableName”:{“t”:15,“h”:true,“f”:26,“v”:“boughtItem_isbn”}}}>{“d”:{“dbName”:{“t”:15,“f”:0,“v”:“sold_product”},“lastFlag”:{“t”:8,“f”:129,“v”:1042402790},“lastTime”:{“t”:3,“f”:129,“v”:0},“modifyTime”:{“t”:7,“f”:1,“v”:“2021-01-28 15:11:38”},“movedNum”:{“t”:8,“f”:129,“v”:13707413},“movedTime”:{“t”:8,“f”:129,“v”:33930266},“tableName”:{“t”:15,“h”:true,“f”:26,“v”:“boughtItem_isbn”}}}>{“u”:{“dbName”:{“t”:15,“f”:0,“v”:“sold_product”},“lastFlag”:{“t”:8,“f”:129,“v”:1042414620},“lastTime”:{“t”:3,“f”:129,“v”:0},“modifyTime”:{“t”:7,“f”:1,“v”:“2021-01-28 15:11:38”},“movedNum”:{“t”:8,“f”:129,“v”:13707881},“movedTime”:{“t”:8,“f”:129,“v”:33930416},“tableName”:{“t”:15,“h”:true,“f”:26,“v”:“boughtItem_isbn”}}}>{“d”:{“dbName”:{“t”:15,“f”:0,“v”:“sold_product”},“lastFlag”:{“t”:8,“f”:129,“v”:1042414620},“lastTime”:{“t”:3,“f”:129,“v”:0},“modifyTime”:{“t”:7,“f”:1,“v”:“2021-01-28 15:11:38”},“movedNum”:{“t”:8,“f”:129,“v”:13707881},“movedTime”:{“t”:8,“f”:129,“v”:33930416},“tableName”:{“t”:15,“h”:true,“f”:26,“v”:“boughtItem_isbn”}}}>{“u”:{“dbName”:{“t”:15,“f”:0,“v”:“sold_product”},“lastFlag”:{“t”:8,“f”:129,“v”:1042426758},“lastTime”:{“t”:3,“f”:129,“v”:0},“modifyTime”:{“t”:7,“f”:1,“v”:“2021-01-28 15:11:38”},“movedNum”:{“t”:8,“f”:129,“v”:13708418},“movedTime”:{“t”:8,“f”:129,“v”:33930579},“tableName”:{“t”:15,“h”:true,“f”:26,“v”:“boughtItem_isbn”}}}>{“d”:{“dbName”:{“t”:15,“f”:0,“v”:“sold_product”},“lastFlag”:{“t”:8,“f”:129,“v”:1042426758},“lastTime”:{“t”:3,“f”:129,“v”:0},“modifyTime”:{“t”:7,“f”:1,“v”:“2021-01-28 15:11:38”},“movedNum”:{“t”:8,“f”:129,“v”:13708418},“movedTime”:{“t”:8,“f”:129,“v”:33930579},“tableName”:{“t”:15,“h”:true,“f”:26,“v”:“boughtItem_isbn”}}}>{“u”:{“dbName”:{“t”:15,“f”:0,“v”:“sold_product”},“lastFlag”:{“t”:8,“f”:129,“v”:1042431344},“lastTime”:{“t”:3,“f”:129,“v”:0},“modifyTime”:{“t”:7,“f”:1,“v”:“2021-01-28 15:11:38”},“movedNum”:{“t”:8,“f”:129,“v”:13708813},“movedTime”:{“t”:8,“f”:129,“v”:33930721},“tableName”:{“t”:15,“h”:true,“f”:26,“v”:“boughtItem_isbn”}}}>{“d”:{“dbName”:{“t”:15,“f”:0,“v”:“sold_product”},“lastFlag”:{“t”:8,“f”:129,“v”:1042431344},“lastTime”:{“t”:3,“f”:129,“v”:0},“modifyTime”:{“t”:7,“f”:1,“v”:“2021-01-28 15:11:38”},“movedNum”:{“t”:8,“f”:129,“v”:13708813},“movedTime”:{“t”:8,“f”:129,“v”:33930721},“tableName”:{“t”:15,“h”:true,“f”:26,“v”:“boughtItem_isbn”}}}>{“u”:{“dbName”:{“t”:15,“f”:0,“v”:“sold_product”},“lastFlag”:{“t”:8,“f”:129,“v”:1042435893},“lastTime”:{“t”:3,“f”:129,“v”:0},“modifyTime”:{“t”:7,“f”:1,“v”:“2021-01-28 15:11:38”},“movedNum”:{“t”:8,“f”:129,“v”:13709233},“movedTime”:{“t”:8,“f”:129,“v”:33930842},“tableName”:{“t”:15,“h”:true,“f”:26,“v”:“boughtItem_isbn”}}}>{“d”:{“dbName”:{“t”:15,“f”:0,“v”:“sold_product”},“lastFlag”:{“t”:8,“f”:129,“v”:1042435893},“lastTime”:{“t”:3,“f”:129,“v”:0},“modifyTime”:{“t”:7,“f”:1,“v”:“2021-01-28 15:11:38”},“movedNum”:{“t”:8,“f”:129,“v”:13709233},“movedTime”:{“t”:8,“f”:129,“v”:33930842},“tableName”:{“t”:15,“h”:true,“f”:26,“v”:“boughtItem_isbn”}}}>{“u”:{“dbName”:{“t”:15,“f”:0,“v”:“sold_product”},“lastFlag”:{“t”:8,“f”:129,“v”:1042441395},“lastTime”:{“t”:3,“f”:129,“v”:0},“modifyTime”:{“t”:7,“f”:1,“v”:“2021-01-28 15:11:38”},“movedNum”:{“t”:8,“f”:129,“v”:13709701},“movedTime”:{“t”:8,“f”:129,“v”:33930980},“tableName”:{“t”:15,“h”:true,“f”:26,“v”:“boughtItem_isbn”}}})


若提问为性能优化、故障排查类问题,请下载脚本运行。终端输出的打印结果,请务必全选并复制粘贴上传。

打印的这些信息理论上是正常的数据信息,请看下下面的文档是否有帮助:

https://docs.pingcap.com/zh/tidb/stable/troubleshoot-ticdc#如何区分-ticdc-open-protocol-中的-row-changed-event-是-insert-事件还是-update-事件

不是正常的数据信息。和正常的格式明显不一样,这个都提示了是ConsumerRecord。

方便上传下包括期望信息以及非期望信息的 log 文件吗?

您好,问题定位到原因了吗?如果方便,请收集下相关的信息,我们一起来定位下问题:

1、changefeed query 信息,命令参考:

https://docs.pingcap.com/zh/tidb/stable/manage-ticdc#查询特定同步任务

2、如果创建 changefeed 执行的命令行历史记录有的话,也辛苦提供下 ~~

我们直接忽略了这些消息。

这个不是问题,是协议消息的含义的解释。

:+1: 感谢分享

TiCDC 输出 canal-json 协议时候的 key 应该是空的,可以检查一下这个异常 key-value 是不是其他组件的写入。

cdc canal-json message ref: