【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。