GreatSQL社区

搜索

[已解决] gt-checksum执行失败,报no checklist

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

  1. -- gt-checksum init configuration files --
  2. -- gt-checksum init log files --
  3. -- gt-checksum init check parameter --
  4. -- gt-checksum init check table name --
  5. gt-checksum report: No checklist, please check the log for details.
复制代码


detail 摘要
  1. [2024/04/11 14:36:10] [error] 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:{[NAME EMAIL CREATE_USER CREATE_TIME ROLE_ID AREA ID PASSWORD TELEPHONE LAST_LOGIN STATUS IS_DELETE AUTOMATE_UPDATE_TIME]} del:{[]}
复制代码

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




微信图片_20240411145118.png
微信图片_20240411145132.png
全部回复(7)
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级别,再观察报错具体是什么原因引起的

[2024/04/15 11:18:05] [debug] schema_tab_struct.go:90 (9  Start to check the table structure consistency of table HOMEWARD.USER.
[2024/04/15 11:18:05] [debug] my_scheme_table_column.go:126 (10) [Q_table_columns] Start querying the metadata information of table HOMEWARD.USER in the MySQL database and get all the column names
[2024/04/15 11:18:05] [debug] my_scheme_table_column.go:140 (10) [Q_table_columns] Complete the acquisition of all column names in the following table HOMEWARD.USER of the MySQL database.
[2024/04/15 11:18:05] [debug] schema_tab_struct.go:59 (9) [Q_table_columns] start dispos DB query columns data. to dispos it...
[2024/04/15 11:18:05] [debug] schema_tab_struct.go:70 (9) [Q_table_columns] complete dispos DB query columns data.
[2024/04/15 11:18:05] [debug] schema_tab_struct.go:103 (9)  source DB mysql table name [HOMEWARD.USER] column name message is {[map[id:[varchar(32) utf8mb3 utf8mb3_general_ci NO null 用户ID]] map[name:[varchar(45) utf8mb3 utf8mb3_general_ci YES null 用户中文名]] map[password:[varchar(256) utf8mb3 utf8mb3_general_ci YES null 用户密码]] map[telephone:[varchar(32) utf8mb3 utf8mb3_general_ci YES null 手机号码]] map[email:[varchar(128) utf8mb3 utf8mb3_general_ci YES null 邮箱]] map[last_login:[datetime null null YES null 最近登陆时间]] map[status:[int null null YES 0 状态(0=可用,不可用)]] map[create_user:[varchar(32) utf8mb3 utf8mb3_general_ci YES null 创建人]] map[create_time:[datetime null null YES null 创建时>间]] map[role_id:[varchar(32) utf8mb3 utf8mb3_general_ci YES null 角色ID]] map[is_delete:[int null null YES 0 是否删除(0=未删除,1=删除)]] map[area:[varchar(32) utf8mb3 utf8mb3_general_ci YES null 地区]] map[automate_update_time:[datetime null null YES CURRENT_TIMESTAMP 修改时间]]]} num [13]
[2024/04/15 11:18:05] [debug] my_scheme_table_column.go:126 (10) [Q_table_columns] Start querying the metadata information of table HOMEWARD.USER in the MySQL database and get all the column names
[2024/04/15 11:18:05] [debug] my_scheme_table_column.go:140 (10) [Q_table_columns] Complete the acquisition of all column names in the following table HOMEWARD.USER of the MySQL database.
[2024/04/15 11:18:05] [debug] schema_tab_struct.go:59 (9) [Q_table_columns] start dispos DB query columns data. to dispos it...
[2024/04/15 11:18:05] [debug] schema_tab_struct.go:70 (9) [Q_table_columns] complete dispos DB query columns data.
[2024/04/15 11:18:05] [debug] schema_tab_struct.go:112 (9)  dest DB mysql table name [HOMEWARD.USER] column name message is {[]} num [0]
[2024/04/15 11:18:05] [error] 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:{[CREATE_TIME ROLE_ID AUTOMATE_UPDATE_TIME ID NAME TELEPHONE LAST_LOGIN CREATE_USER PASSWORD EMAIL STATUS IS_DELETE AREA]} del:{[]}
yejr 2024-4-15 12:13:23
langfeijiu2 发表于 2024-4-15 11:19
[2024/04/15 11:18:05] [debug] schema_tab_struct.go:90 (9  Start to check the table structure consi ...

  1. [2024/04/15 11:18:05] [error] 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:{[CREATE_TIME ROLE_ID AUTOMATE_UPDATE_TIME ID NAME TELEPHONE LAST_LOGIN CREATE_USER PASSWORD EMAIL STATUS IS_DELETE AREA]} 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暂时还不支持跨大版本的校验哈
langfeijiu2

2

主题

0

博客

13

贡献

新手上路

Rank: 1

积分
20

合作电话:010-64087828

社区邮箱:greatsql@greatdb.com

社区公众号
社区小助手
QQ群
GMT+8, 2024-4-30 08:15 , Processed in 0.019962 second(s), 19 queries , Redis On.
快速回复 返回顶部 返回列表