langfeijiu2 发表于 2024-4-11 14:58:17

gt-checksum执行失败,报no checklist

场景: 一个库从5.7迁移到了8.0,想针对这个库做一个校验
使用gt-checksum发现执行失败,报错no checklist

-- gt-checksum init configuration files --
-- gt-checksum init log files --
-- gt-checksum init check parameter --
-- gt-checksum init check table name --
gt-checksum report: No checklist, please check the log for details.

detail 摘要
schema_tab_struct.go:152 (9)The USER table structure of the current source and destination is inconsistent, please check whether the current table structure is consistent. add:{} del:{[]}

user 创表语句:mysql8
CREATE TABLE `user` (
`id` varchar(32) NOT NULL COMMENT '用户ID',
`name` varchar(45) DEFAULT NULL COMMENT '用户中文名',
`password` varchar(256) DEFAULT NULL COMMENT '用户密码',
`telephone` varchar(32) DEFAULT NULL COMMENT '手机号码',
`email` varchar(128) DEFAULT NULL COMMENT '邮箱',
`last_login` datetime DEFAULT NULL COMMENT '最近登陆时间',
`status` int DEFAULT '0' COMMENT '状态(0=可用,不可用)',
`create_user` varchar(32) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`role_id` varchar(32) DEFAULT NULL COMMENT '角色ID',
`is_delete` int DEFAULT '0' COMMENT '是否删除(0=未删除,1=删除)',
`area` varchar(32) DEFAULT NULL COMMENT '地区',
`automate_update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='用户信息'user创表语句: mysql5.7
CREATE TABLE `user` (
`id` varchar(32) NOT NULL COMMENT '用户ID',
`name` varchar(45) DEFAULT NULL COMMENT '用户中文名',
`password` varchar(256) DEFAULT NULL COMMENT '用户密码',
`telephone` varchar(32) DEFAULT NULL COMMENT '手机号码',
`email` varchar(128) DEFAULT NULL COMMENT '邮箱',
`last_login` datetime DEFAULT NULL COMMENT '最近登陆时间',
`status` int(11) DEFAULT '0' COMMENT '状态(0=可用,不可用)',
`create_user` varchar(32) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`role_id` varchar(32) DEFAULT NULL COMMENT '角色ID',
`is_delete` int(11) DEFAULT '0' COMMENT '是否删除(0=未删除,1=删除)',
`area` varchar(32) DEFAULT NULL COMMENT '地区',
`automate_update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户信息'



yejr 发表于 2024-4-11 15:51:26

可以把log-level改成debug级别,再观察报错具体是什么原因引起的

langfeijiu2 发表于 2024-4-15 11:19:48

yejr 发表于 2024-4-11 15:51
可以把log-level改成debug级别,再观察报错具体是什么原因引起的

schema_tab_struct.go:90 (9Start to check the table structure consistency of table HOMEWARD.USER.
my_scheme_table_column.go:126 (10) Start querying the metadata information of table HOMEWARD.USER in the MySQL database and get all the column names
my_scheme_table_column.go:140 (10) Complete the acquisition of all column names in the following table HOMEWARD.USER of the MySQL database.
schema_tab_struct.go:59 (9) start dispos DB query columns data. to dispos it...
schema_tab_struct.go:70 (9) complete dispos DB query columns data.
schema_tab_struct.go:103 (9)source DB mysql table name column name message is {] map] map] map] map] map] map] map] map] map] map] map] map]]} num
my_scheme_table_column.go:126 (10) Start querying the metadata information of table HOMEWARD.USER in the MySQL database and get all the column names
my_scheme_table_column.go:140 (10) Complete the acquisition of all column names in the following table HOMEWARD.USER of the MySQL database.
schema_tab_struct.go:59 (9) start dispos DB query columns data. to dispos it...
schema_tab_struct.go:70 (9) complete dispos DB query columns data.
schema_tab_struct.go:112 (9)dest DB mysql table name column name message is {[]} num
schema_tab_struct.go:152 (9)The HOMEWARD.USER table structure of the current source and destination is inconsistent, please check whether the current table structure is consistent. add:{} del:{[]}

yejr 发表于 2024-4-15 12:13:23

langfeijiu2 发表于 2024-4-15 11:19
schema_tab_struct.go:90 (9Start to check the table structure consi ...


schema_tab_struct.go:152 (9)The HOMEWARD.USER table structure of the current source and destination is inconsistent, please check whether the current table structure is consistent. add:{} del:{[]}


这里提醒了,源 和 目标 表结构不一致

langfeijiu2 发表于 2024-4-15 14:27:18

yejr 发表于 2024-4-15 12:13
这里提醒了,源 和 目标 表结构不一致

这个问题就是说,
1. 库是使用mysqldump导入导出的。只是源库目标库版本有区别。可以看上面的建表语句应该差异也不大。
2. --checkObject默认值是只校验data: Specify data check object. For example: --co struct (default: "data"),比如说只想对比数据的差异,这个参数能控制么,或者说我对这个参数理解有误?

yejr 发表于 2024-4-15 15:07:10

langfeijiu2 发表于 2024-4-15 14:27
这个问题就是说,
1. 库是使用mysqldump导入导出的。只是源库目标库版本有区别。可以看上面的建表语句应 ...

完整的参数列表是怎样的?

还存在另一种可能性,就是即便表结构(在DBA肉眼里看起来)一样,但show create table x的结果却(因为5.7和8.0的不同造成)不一样,最终造成这个问题。

langfeijiu2 发表于 2024-4-16 14:53:20

yejr 发表于 2024-4-15 15:07
完整的参数列表是怎样的?

还存在另一种可能性,就是即便表结构(在DBA肉眼里看起来)一样,但show crea ...

完整的就是
mysqldump -u root -p --master-data=2 --single-transaction --set-gtid-purged=off --databases xxx
show create table对比,会有细微差别:比如
mysql5.7是int(11),mysql8直接就是int
mysql5.7的charset是utf8,mysql8的charset是utf8mb3

yejr 发表于 2024-4-16 16:13:41

langfeijiu2 发表于 2024-4-16 14:53
完整的就是
mysqldump -u root -p --master-data=2 --single-transaction --set-gtid-purged=off --data ...

明白了,gt-checksum暂时还不支持跨大版本的校验哈
页: [1]
查看完整版本: gt-checksum执行失败,报no checklist