表达式索引引起的DM同步任务报错;是产品BUG还是使用问题?

【TiDB 使用环境】生产环境 /测试/ Poc
上游binlog_row_image参数

mysql> select @@global.binlog_row_image;
+---------------------------+
| @@global.binlog_row_image |
+---------------------------+
| FULL                      |
+---------------------------+
1 row in set (0.02 sec)

mysql> select @@session.binlog_row_image;
+----------------------------+
| @@session.binlog_row_image |
+----------------------------+
| FULL                       |
+----------------------------+
1 row in set (0.02 sec)

数据同步任务报错如下。经排查上游数据库增加了一个表达式索引,下游tidb没开启allow-expression-index,导致任务异常。
ALTER TABLE db1.table1 ADD INDEX IDX_byd_f_customer_phone_last4((RIGHT(phone, 4)))

"ErrCode": 11126,
"ErrClass": "binlog-op",
"ErrScope": "upstream",
"ErrLevel": "high",
"Message": "startLocation: [position: (mysql-bin.001753, 68288196), gtid-set: 99bd4f13-a8bb-11ef-98bd-1070fd95060e:1-558036695:558076082], endLocation: [position: (mysql-bin.001753, 68288850)...........541309320]: upstream didn't log enough columns in binlog",
"RawCause": "",
"Workaround": "Please check if session `binlog_row_image` variable is not FULL, restart task to the location from where FULL binlog_row_image is used."

删除任务重新同步后,报如下错误。

"Message": "startLocation: [position: (mysql-bin.001754, 470779603), gtid-set: 99bd4f13-a8bb-11ef-98bd-1070fd95060e:1-558336915:558597367], endLocation: [position: (mysql-bin.001754, 470780305), gtid-set: 99bd4f13-a8bb-11ef-98bd-1070fd95060e:1-558336915:558597367]: failed to create table for `db1`.`table1` in schema tracker",
"RawCause": "[ddl:8200]Unsupported creating expression index containing unsafe functions without allow-expression-index in config"

tidb节点的allow-expression-index已经设置为true。

1 个赞

这个设置完重启tidb节点并删除任务重新同步了吗?

tidb节点重启后又重新同步了。报第二个错误,提示allow-expression-index没开

第二个报错的时候。allow-expression-index已经设置为true? 还是提示allow-expression-index没开?
是这个意思吗

如果是这样。是不是这个参数没有生效。或者你重启一下dm

重启大法先试试看呗!

将dm集群重启一下?不应该是将任务重启一下就行了么?

解决了吗?

dm集群重启了,同步任务也重启了。还是报错

[ddl:8200]Unsupported creating expression index containing unsafe functions without allow-expression-index in config

没有。

不支持创建expresion index。跳过这个DDL。DM最好过滤掉所有DDL,操作。手动在源端目标端执行,我这里就是经常有问题,我把创建、删除 索引、存储过程都过滤了

开启allow-expression-index后,我看表结构以及索引都同步成功了

处理好了吗

还没有

现在执行任务还是会报下面的错误

RawCause": “[ddl:8200]Unsupported creating expression index containing unsafe functions without allow-expression-index in config”

但我 tidb 集群的 allow-expression-index 已经设置了,dm集群也重启过了。

重新同步

reinstall也可

may be the log is missing key words

如果你是想重新同步,那创建任务的时候加 --remove-meta 选项

已经做过这个操作了。重启tidb节点后,任务和数据都重新删了重新同步过