从MySQL 5.7.6开始,mysql.gtid_executed应该跟踪所有执行的gtids。
然而,在MySQL 5.7.14中,我看到了如下场景
mysql> select @@global.gtid_executed;
+-----------------------------------------------------------------------+ | @@global.gtid_executed | +-----------------------------------------------------------------------+ | cd5cd102-6586-0742-6f26-5b4c4c17d44d:4294967296:8589934592-8589939092 | +-----------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> select * from mysql.gtid_executed;
Empty set (0.00 sec)
这种差异可以解释吗?
发布于 2021-11-01 19:19:54
根据mysql documentation
If binary logging is enabled (log_bin is ON), whenever the binary log is rotated or the server is shut down, the server writes GTIDs for all transactions that were written into the previous binary log into the mysql.gtid_executed table. This situation applies on a replication source server, or a replica where binary logging is enabled.
我在mysql启动时看到了同样的行为,但是在刷新日志之后,FLUSH LOGS;
可以在mysql.gtid_executed
表中看到GTID范围。
https://stackoverflow.com/questions/43433291
复制相似问题