【 TiDB 使用环境】线上、测试、调研
【 TiDB 版本】
【遇到的问题】
通过配置文件,使用ignore-txn-start-ts参数,跳过指定的操作,没有生效。
1、停掉cdc复制
2、上游插入ID=333的记录(此时下游的表没有ID=333的记录)
insert into cdcdb.test5 values(333)"
3、查看当前数据库的TSO
cdc cli --pd=http://xxx.xxx.xxx.xxx tso query
434708167235993601
4、编辑同步配置文件,添加ignore-txn-start-ts
vi cdc.toml
ignore-txn-start-ts = [434708167235993601]
5、启动CDC复制
$ tiup ctl:v4.0.16 cdc changefeed update --pd=http://xxx.xxx.xxx.xxx:2379 --changefeed-id=“cdc2” --config cdc.toml
Starting component ctl
: /home/tidb/.tiup/components/ctl/v4.0.16/ctl cdc changefeed update --pd=http://xxx.xxx.xxx.xxx:2379 --changefeed-id=cdc2 --config cdc.toml
Diff of changefeed config:
{Type:create Path:[Config Filter IgnoreTxnStartTs 0] From: To:434708167235993601}
Could you agree to apply changes above to changefeed [Y/N]
y
Update changefeed config successfully! Will take effect only if the changefeed has been paused before this command
ID: cdc2
Info: {“sink-uri”:“tidb://root:admin@10.19.248.128:4000/”,“opts”:{“_changefeed_id”:“cli-verify”},“create-time”:“2022-07-19T11:00:21.200455131+08:00”,“start-ts”:434686528597262343,“target-ts”:0,“admin-job-type”:1,“sort-engine”:“unified”,“sort-dir”:“”,“config”:{“case-sensitive”:true,“enable-old-value”:true,“force-replicate”:true,“check-gc-safe-point”:true,“filter”:{“rules”:[“.”],“ignore-txn-start-ts”:[434708167235993601]},“mounter”:{“worker-num”:16},“sink”:{“dispatchers”:null,“protocol”:“default”},“cyclic-replication”:{“enable”:false,“replica-id”:0,“filter-replica-ids”:null,“id-buckets”:0,“sync-ddl”:false},“scheduler”:{“type”:“table-number”,“polling-time”:-1}},“state”:“stopped”,“history”:null,“error”:null,“sync-point-enabled”:false,“sync-point-interval”:600000000000,“creator-version”:“v4.0.16”}
6、查看changefeed信息,有ignore-txn-start-ts相关信息
tiup ctl:v4.0.16 cdc changefeed query --pd=http://xxx.xxx.xxx.xxx:2379 --changefeed-id=cdc2
Starting component ctl
: /home/tidb/.tiup/components/ctl/v4.0.16/ctl cdc changefeed query --pd=http://xxx.xxx.xxx.xxx:2379 --changefeed-id=cdc2
{
“info”: {
“sink-uri”: “tidb://root:admin@10.19.248.128:4000/”,
“opts”: {
“_changefeed_id”: “cli-verify”
},
“create-time”: “2022-07-19T11:00:21.200455131+08:00”,
“start-ts”: 434686528597262343,
“target-ts”: 0,
“admin-job-type”: 0,
“sort-engine”: “unified”,
“sort-dir”: “”,
“config”: {
“case-sensitive”: true,
“enable-old-value”: true,
“force-replicate”: true,
“check-gc-safe-point”: true,
“filter”: {
“rules”: [
“.”
],
“ignore-txn-start-ts”: [
434708167235993601
]
},
7、查看下游ID=333,发现记录同步过来了。
问题:这是为啥呢?好像ignore-txn-start-ts没有起效果。
【复现路径】做过哪些操作出现的问题
【问题现象及影响】
【附件】
请提供各个组件的 version 信息,如 cdc/tikv,可通过执行 cdc version/tikv-server --version 获取。