Replication with Global Transaction Identifiers •The  mysql.gtid_executed  table does not hold a complete record of the GTIDs for all executed transactions. That information is provided by the global value of the  gtid_executed  system variable. In releases before MySQL 8.0.17 and with storage engines other than  InnoDB , always use @@GLOBAL.gtid_executed , which is updated after every commit, to represent the GTID state for the MySQL server, instead of querying the  mysql.gtid_executed  table. The MySQL server can write to the  mysql.gtid_executed  table even when the server is in read only or super read only mode. In releases before MySQL 8.0.17, this ensures that the binary log file can still be rotated in these modes. If the  mysql.gtid_executed  table cannot be accessed for writes, and the binary log file is rotated for any reason other than reaching the maximum file size ( max_binlog_size ), the current binary log file continues to be used. An error message is returned to the client that requested the rotation, and a warning is logged on the server. If the  mysql.gtid_executed table cannot be accessed for writes and  max_binlog_size  is reached, the server responds according to its  binlog_error_action  setting. If  IGNORE_ERROR  is set, an error is logged on the server and binary logging is halted, or if  ABORT_SERVER  is set, the server shuts down. mysql.gtid_executed Table Compression Over the course of time, the  mysql.gtid_executed  table can become filled with many rows referring to individual GTIDs that originate on the same server, and whose transaction IDs make up a range, similar to what is shown here: +--------------------------------------+----------------+--------------+ | source_uuid | interval_start | interval_end | |--------------------------------------+----------------+--------------| | 3E11FA47-71CA-11E1-9E33-C80AA9429562 | 37 | 37 | | 3E11FA47-71CA-11E1-9E33-C80AA9429562 | 38 | 38 | | 3E11FA47-71CA-11E1-9E33-C80AA9429562 | 39 | 39 | | 3E11FA47-71CA-11E1-9E33-C80AA9429562 | 40 | 40 | | 3E11FA47-71CA-11E1-9E33-C80AA9429562 | 41 | 41 | | 3E11FA47-71CA-11E1-9E33-C80AA9429562 | 42 | 42 | | 3E11FA47-71CA-11E1-9E33-C80AA9429562 | 43 | 43 | ... +--------------------------------------+----------------+--------------+ | source_uuid | interval_start | interval_end | |--------------------------------------+----------------+--------------| | 3E11FA47-71CA-11E1-9E33-C80AA9429562 | 37 | 43 | ... To save space, the MySQL server can compress the  mysql.gtid_executed  table periodically by replacing each such set of rows with a single row that spans the entire interval of transaction identifiers, like this: The server can carry out compression using a dedicated foreground thread named  thread/sql/ compress_gtid_table . This thread is not listed in the output of  SHOW PROCESSLIST , but it can be viewed as a row in the  threads  table, as shown here: mysql>  SELECT * FROM performance_schema.threads WHERE NAME LIKE ’%gtid%’\G *************************** 1. row *************************** THREAD_ID: 26 NAME: thread/sql/compress_gtid_table TYPE: FOREGROUND PROCESSLIST_ID: 1 PROCESSLIST_USER: NULL PROCESSLIST_HOST: NULL PROCESSLIST_DB: NULL PROCESSLIST_COMMAND: Daemon PROCESSLIST_TIME: 1509 PROCESSLIST_STATE: Suspending 3454