allow-expression-index 已经开启了。下游数据库表达式索引,都已经可以创建了。但是这个报错还是提示我开启allow-expression-index。 ALTER TABLE db1 .table1 ADD INDEX IDX_byd_f_customer_phone_last4 ((RIGHT(phone , 4)))
添加index
add index idx_byd_f_customer_phone_last4
LTER TABLE db1 .table1 ADD INDEX IDX_byd_f_customer_phone_last4
有重复内容没有清理干净
过滤掉吧
可以尝试下重启使其生效
数据库集群,DM集群都重启过。DM任务以及数据都删了重新同步了。
没解决,重启了好多次都没用
没用,过滤掉一个后面还是会持续报错
如果业务场景里会用到 expression index,建议 不要依赖 DM 自动同步 expression-index 相关 DDL —— 最稳妥的方式是 手动在源端 + 目标端分别执行 DDL ,并验证结构一致、索引生效。
生产环境修改binlog_format /binlog_row_image 后,需确认主从同步无异常
TiDB 的allow-expression-index 仅控制表达式索引的创建,不影响同步,需确保 DM 能正确解析该类 DDL
若上游频繁执行表达式索引 DDL,建议将 DM 和 TiDB 均升级到最新稳定版,避免兼容问题
已经是最新的8.5.4版本
开启allow-expression-index后表结构已经没有差异。就是同步的时候还是会报错
可以发下tidb的启动日志看看,allow-expression-index参数是否已经生效,修改tidb参数需要reload一下
将表达式索引改为普通索引后 又报这个错误,但是上游数据源binlog_format=ROW,binlog_row_image=full,任务也删了重启过了。
“Message”: “startLocation: [position: (mysql-bin.002317, 177037823)…e:1-732570584:732674665-732674666]: upstream didn’t log enough columns in binlog”,
“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.”
参数已经生效了,不然表达式索引也不会创建成功
这两个配置没问题,dm获取数据的上游库就是从库。
mysql> show variables like ‘binlog_row_image’;
±-----------------±------+
| Variable_name | Value |
±-----------------±------+
| binlog_row_image | FULL |
±-----------------±------+
mysql> show variables like ‘binlog_format’;
±--------------±------+
| Variable_name | Value |
±--------------±------+
| binlog_format | ROW |
±--------------±------+