gtids executed are missing from mysql.gtid_executed table
Posted by:
lin yuan
Date: October 20, 2017 12:18AM
Hello experts
I am running a master - slave replication based on GTID in my production environment.
- mysql-community-server-5.7.17
- centos 7.4 x86_64
Today, I notice the Executed_Gtid_Set from "show slave status\G" is not consistent with info from mysql.gtid_executed
the output excerpt from "show slave status\G":
Retrieved_Gtid_Set: baddb4d3-6c52-11e7-bb60-00505690d333:11-6540560
Executed_Gtid_Set: baddb4d3-6c52-11e7-bb60-00505690d333:1-6540560
the output from "select * from mysql.gtid_executed;":
+--------------------------------------+----------------+--------------+
| source_uuid | interval_start | interval_end |
+--------------------------------------+----------------+--------------+
baddb4d3-6c52-11e7-bb60-00505690d333 | 11 | 5885134
I know the values from gtid_executed table can be different from "show slave status\G", but it does not look good the interval_start is "11" (1-10 are missing).
When I tried to restart mysqld, the replication failed to start with error 1236 in log:
2017-10-20T03:36:48.559146Z 1 [ERROR] Slave I/O for channel '': Got fatal error 1236 from master when reading data from binary log: 'The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requires.', Error_code: 1236
And then I checked slave status. The "show slave status\G" shows
Retrieved_Gtid_Set: baddb4d3-6c52-11e7-bb60-00505690d333:11-6540733
Executed_Gtid_Set: baddb4d3-6c52-11e7-bb60-00505690d333:11-6540733
It looks the gtid_executed global variable is initialized from mysql.gtid_executed table after a restart? and then the slave requests gtids baddb4d3-6c52-11e7-bb60-00505690d333:1-10 from master, which were purged long time ago.
So do you have any idea why gtids baddb4d3-6c52-11e7-bb60-00505690d333:1-10 are missing from mysql.gtid_executed table? I remembered the record with interval_start of 1 existed some days ago.
Subject
Views
Written By
Posted
gtids executed are missing from mysql.gtid_executed table
1626
October 20, 2017 12:18AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.