根据slave status状态信息可以看出
- 报错的GTID为:
'9e668a93-2618-11ee-93ee-bc16954181bb:47508257'
- 应用的主集群的binlog为:
greatsql-bin.000988
- 【GreatSQL一个关于主从复制的限制描述与规避】灾备集群的relay log为:
greatsql-relay.002963
performance_schema.replication_applier_status_by_worker
表2、查看错误的详细信息
greatsql> select * from performance_schema.replication_applier_status_by_workerG*************************** 1. row *************************** CHANNEL_NAME: WORKER_ID: 1 THREAD_ID: NULL SERVICE_STATE: OFFLAST_SEEN_TRANSACTION: 9e668a93-2618-11ee-93ee-bc16954181bb:47508257 LAST_ERROR_NUMBER: 1146 LAST_ERROR_MESSAGE: Worker 1 failed executing transaction'9e668a93-2618-11ee-93ee-bc16954181bb:47508257' at master log greatdb-bin.000988,end_log_pos 701570116; Error executing row event: 'Table 'abs_xxx.tmp_xxx_info' doesn't exist'LAST_ERROR_TIMESTAMP: 2023-08-22 14:14:18
上述信息说明根据performance_schema.replication_applier_status_by_worker
表中的详细错误信息可以发现为灾备集群abs_xxx.tmp_xxx_info
表不存在,导致同步报错3、问题分析3.1、确认灾备集群中目标表是否存在
greatsql> show create table abs_xxx.tmp_xxx_info;ERROR 1146 (42S02): Table 'abs_xxx.tmp_xxx_info' doesn't exist
greatsql> desc abs_xxx.tmp_xxx_info;ERROR 1146 (42S02): Table 'abs_xxx.tmp_xxx_info' doesn't exist
结论:灾备集群中目标表的确不存在3.2、根据主从报错信息解析主集群binlog,报错的SQL
解析主集群binlog
SET @@SESSION.GTID_NEXT= '9e668a93-2618-11ee-93ee-bc16954181bb:47508257'/*!*/;……#230822 14:14:18 server id 1943306 end_log_pos 701570000 Table_map: `abs_xxx`.`tmp_xxx_info` mapped to number 1595# at 701570000#230822 14:14:18 server id 1943306 end_log_pos 701570116 Write_rows: table id 1595 flags: STMT_END_F### INSERT INTO `abs_xxx`.`tmp_xxx_info`### SET### @1=2### @2='自动化'### @3='2300121212120000'### @4='90000000'### @5='1'### @6='202001290231001'### @7='2021-01-31 00:00:00'# at 701570116#230822 14:14:18 server id 1943306 end_log_pos 701570143 Xid = 800998400COMMIT/*!*/;# at 701570143#230822 14:14:18 server id 1943306 end_log_pos 701570204 GTID last_committed=26491 sequence_number=26521 rbr_only=yes/*!50718 SET TRANSACTION ISOLATION LEVEL READ COMMITTED*//*!*/;
结论:根据复制的报错信息得知具体的GTID号以及主集群的binlog文件,解析binlog得知此事务为一条INSERT语句 , 语句中的目标表与performance_schema.replication_applier_status_by_worker
表中信息一致3.3、寻找主集群目标表binlog中是否有建表语句
在同一binlog日志中寻找建表语句
SET TIMESTAMP=1692684495/*!*/;CREATE DATABASE IF NOT EXISTS `abs_xxx` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin *//*!*/;……use `information_schema`/*!*/;SET TIMESTAMP=1692684495/*!*/;CREATE TABLE `abs_xxx`.`tmp_xxx_info` ( `ID` int(64) NOT NULL AUTO_INCREMENT, `CUSTOMER_NAME` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL, `CUSTOMER_NUM` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL, `PRODIST_SKU_NUM` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL, `STATUS` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL, `AGREEMENT_NUM` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL, `END_DATE` datetime DEFAULT NULL, PRIMARY KEY (`ID`), KEY `PK_PRODIST_SKU_NUM_AGREEMENT` (`PRODIST_SKU_NUM`) USING BTREE, KEY `IDX_AGREEMENT_NUM` (`AGREEMENT_NUM`) USING BTREE) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC/*!*/;# at 475864451
推荐阅读
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 如何使用Noir从源代码检测攻击面
- 57岁的大郑爽,依然待字闺中未婚单身,最美扈三娘惊艳了一个时代
- 大炮打一个基数是啥意思?一个基数到底有多少颗炮弹
- 有关谷雨的儿歌 关于谷雨的儿歌
- 没结婚但有固定伴侣,这5位“中年尤物”,一个比一个过得滋润
- 大门指什么动物或者生肖 大门是代表哪一个生肖
- 关于白杨树的介绍作文 关于白杨树的介绍
- 关于元旦节的风俗 关于元旦节的风俗作文
- 床头放什么旺财旺身体 一个家旺不旺看厨房
- 同样是消防员,黄景瑜和杨洋对比,一个自然真实、一个呆若木鸡