Cuero
Cuero

Reputation: 1209

Injecting empty transactions to repair MySQL 5.6 GTID replication doesn't work

I follows the steps on this page

STOP SLAVE;
SET GTID_NEXT="[THE GTID SET]";
BEGIN; COMMIT;
SET GTID_NEXT="AUTOMATIC";
START SLAVE;

to restore the slave. But in my case, the gtid_set are as

Retrieved_Gtid_Set: 8b6d4795-5ad3-11e6-a31f-00259077c77a:2369-2377
Executed_Gtid_Set: 8b6d4795-5ad3-11e6-a31f-00259077c77a:1-2372:2374,8be5b0ba-5ad3-11e6-a31f-0cc47a50d072:1-12

When I tried to inject empty transactions to the slave and restart the slave, the 'slave_SQL_Running' is still 'No'.

STOP SLAVE;
SET GTID_NEXT="8b6d4795-5ad3-11e6-a31f-00259077c77a:2377";
BEGIN; COMMIT;
SET GTID_NEXT=AUTOMATIC;
START SLAVE;

And it becomes

Retrieved_Gtid_Set: 8b6d4795-5ad3-11e6-a31f-00259077c77a:2369-2377
Executed_Gtid_Set: 8b6d4795-5ad3-11e6-a31f-00259077c77a:1-2372:2374:2377,8be5b0ba-5ad3-11e6-a31f-0cc47a50d072:1-12

and when new data is inserted to master, the slave still can't sync to the master. The status becomes:

Retrieved_Gtid_Set: 8b6d4795-5ad3-11e6-a31f-00259077c77a:2369-2378
Executed_Gtid_Set: 8b6d4795-5ad3-11e6-a31f-00259077c77a:1-2372:2374:2377,8be5b0ba-5ad3-11e6-a31f-0cc47a50d072:1-12

How can I make this work?

I don't want to do a full dump since there's lots of data, while fulldump takes a lot of time.

Upvotes: 0

Views: 2164

Answers (1)

Abhinav Gupta
Abhinav Gupta

Reputation: 16

Please check below blog post.

https://www.abhinavbit.com/2019/05/gtid-replication-skip-transaction-using.html

In your case you should have run below command to skip the sql threads error.

STOP SLAVE;
SET GTID_NEXT="8b6d4795-5ad3-11e6-a31f-00259077c77a:2375";
BEGIN; COMMIT;
SET GTID_NEXT=AUTOMATIC;
START SLAVE;

Upvotes: 0

Related Questions