环境介绍
1、源端、发布端都为mysql MGR单主环境,大体如下:
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
root@mysqldb 09:19: [(none)]> select * from performance_schema.replication_group_members;
+—————————+————————————–+————-+————-+————–+————-+—————-+
| CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE | MEMBER_ROLE | MEMBER_VERSION |
+—————————+————————————–+————-+————-+————–+————-+—————-+
| group_replication_applier | 73273cf2-675a-11ea-a144-525403161526 | mgrtest107 | 3306 | ONLINE | PRIMARY | 8.0.23 |
| group_replication_applier | 77bc9b23-675a-11ea-a044-52540308020e | mgrtest108 | 3306 | ONLINE | SECONDARY | 8.0.23 |
+—————————+————————————–+————-+————-+————–+————-+—————-+
2 rows in set (0.00 sec)
2、log.client全量报错日志:
[LV0] LOAD THD[1]: 2021-10-28 18:23:17: table[picc_db_97.t_user_info_for_epass] bsd data time[2021-10-28 17:01:14], delay 4923 s.
error at file[mysql.c] line[1185], ZCBUS-20001: mysql_stmt_execute failed: The table does not comply with the requirements by an external plugin.
[INF] LOAD THD[1] error data output to file /picclife/zcapp/zcbus/log/dmp20211028/22_1_20211028182317.log, please check!
error at file[msg_load_db.c] line[1091], ZCBUS-20001: mysql_stmt_execute failed: The table does not comply with the requirements by an external plugin.
error at file[msg_load_db.c] line[1331], ZCBUS-20001: mysql_stmt_execute failed: The table does not comply with the requirements by an external plugin.
error at file[msg_load_db.c] line[1681], ZCBUS-20001: mysql_stmt_execute failed: The table does not comply with the requirements by an external plugin.
[ERR] LOAD THD[1], ZCBUS-20001: mysql_stmt_execute failed: The table does not comply with the requirements by an external plugin.
3、查看MYSQL数据的error.log,发现如下报错:
2021-10-28T19:02:45.540537+08:00 5964527 [ERROR] [MY-011542] [Repl] Plugin group_replication reported: ‘Table t_user_info_for_epass does not have any PRIMARY KEY. This is not compatible with Group Replication.’
4、问题解决
1、将订阅管理-传输控制里的主控参数ifFilterDDL 设置为1,全量、增量过滤所有DDL。
2、同步的表必须有主键(强调),源库的表如没有主键,就手动加上主键。目标库的表可以复制源库的建表语句。
5、总结
1、ZCBUS软件在发起全量订阅时,可能表的清理方式设为truncate也会清理掉表的主键,而MYSQL MGR的所有表在做DML时,必须要求有主键存在,所以才导致目标库全量加载报ERROR