Repair MySQL 5.6 GTID replication by injecting empty transactions

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Repair MySQL 5.6 GTID replication by injecting empty transactions相关的知识,希望对你有一定的参考价值。

Since SQL_SLAVE_SKIP_COUNTER doesn’t work with GTID we need to find a way to ignore that transaction. The way to do it is creating a new empty transaction with it the GTID we want to skip.

 

STOP SLAVE;
SET GTID_NEXT="7d72f9b4-8577-11e2-a3d7-080027635ef5:5";
BEGIN; COMMIT;
SET GTID_NEXT="AUTOMATIC";
START SLAVE;
[...]
Retrieved_Gtid_Set: 7d72f9b4-8577-11e2-a3d7-080027635ef5:1-5
Executed_Gtid_Set: 7d72f9b4-8577-11e2-a3d7-080027635ef5:1-5
 
 

After the START SLAVE the slave checks that transaction 5 is already in its own binary log and that means that it has been executed.

This is an easy way to skip some transactions but take in account that by doing this you will end up with data inconsistencies between Master and Slave servers. pt-table-checksum can help you here, which is found in Percona Toolkit for MySQL.

Last week I gave a talk at Percona MySQL University @Toronto about GTID. It includes an overview of mysql 5.6 GTID that can help people to start working with this new feature in MySQL 5.6. Here are the slides from that session. I hope you find it useful: MySQL 5.6 GTID in a nutshell

以上是关于Repair MySQL 5.6 GTID replication by injecting empty transactions的主要内容,如果未能解决你的问题,请参考以下文章

MySQL 5.6 GTID+MHA

MySQL 5.6 GTID Replication

MySQL-5.6 基于GTID及多线程的复制

MySQL 5.6数据导入报 GTID 相关错误

mysql 5.6 gtid复制

mysql主从复制--mysql-5.6基于GTID及多线程复制