Bug #98743 | Invalid entry on mysql.gtid_executed table is unrecoverable | ||
---|---|---|---|
Submitted: | 26 Feb 2020 1:02 | Modified: | 26 Feb 2020 6:45 |
Reporter: | Yoshihiko Matsuzaki | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Replication | Severity: | S1 (Critical) |
Version: | 5.7,8.0, 5.7.29, 8.0.19 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[26 Feb 2020 1:02]
Yoshihiko Matsuzaki
[26 Feb 2020 6:45]
MySQL Verification Team
Hello Yoshihiko-San, Thank you for the report and feedback. I was able to reproduce using your steps on 5.7.29 and 8.0.19(5.6 not applicable) builds. Also, if you see *INSERT* was warning "Please do not modify the gtid_executed table. This is a mysql internal system table to store GTIDs for committed transactions. Modifying it can lead to an inconsistent GTID state.". Development would still require normal way to reproduce this though. If you are able to provide a reliable test case then please let us know. Thank you! regards, Umesh
[26 Feb 2020 6:51]
MySQL Verification Team
- 5.7.29 rm -rf 98743/ bin/mysqld --initialize-insecure --basedir=$PWD --datadir=$PWD/98743 --log-error-verbosity=3 bin/mysqld --no-defaults --basedir=$PWD --datadir=$PWD/98743 --core-file --socket=/tmp/mysql_ushastry.sock --port=3333 --log-error=$PWD/98743/log.err --log-error-verbosity=3 --secure-file-priv="" --skip-name-resolve --gtid_mode=ON --log-bin --log-slave-updates --enforce-gtid-consistency --server-id=1 2>&1 & bin/mysql -uroot -S /tmp/mysql_ushastry.sock Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.7.29-log MySQL Community Server (GPL) Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> select * from mysql.gtid_executed; Empty set (0.00 sec) mysql> INSERT INTO mysql.gtid_executed VALUES ("invalid", 0, 0); Query OK, 1 row affected, 1 warning (0.00 sec) mysql> show warnings; +---------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Level | Code | Message | +---------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Warning | 3129 | Please do not modify the gtid_executed table. This is a mysql internal system table to store GTIDs for committed transactions. Modifying it can lead to an inconsistent GTID state. | +---------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.00 sec) mysql> shutdown; Query OK, 0 rows affected (0.00 sec) mysql> \q Bye [1]+ Done bin/mysqld --no-defaults --basedir=$PWD --datadir=$PWD/98743 --core-file --socket=/tmp/mysql_ushastry.sock --port=3333 --log-error=$PWD/98743/log.err --log-error-verbosity=3 --secure-file-priv="" --skip-name-resolve --gtid_mode=ON --log-bin --log-slave-updates --enforce-gtid-consistency --server-id=1 2>&1 -- restart instance bin/mysqld --no-defaults --basedir=$PWD --datadir=$PWD/98743 --core-file --socket=/tmp/mysql_ushastry.sock --port=3333 --log-error=$PWD/98743/log.err --log-error-verbosity=3 --secure-file-priv="" --skip-name-resolve --gtid_mode=ON --log-bin --log-slave-updates --enforce-gtid-consistency --server-id=1 2>&1 & [1] 6822 . . [1]+ Exit 1 bin/mysqld --no-defaults --basedir=$PWD --datadir=$PWD/98743 --core-file --socket=/tmp/mysql_ushastry.sock --port=3333 --log-error=$PWD/98743/log.err --log-error-verbosity=3 --secure-file-priv="" --skip-name-resolve --gtid_mode=ON --log-bin --log-slave-updates --enforce-gtid-consistency --server-id=1 2>&1 - extract from error log mysqld: Malformed GTID set specification 'invalid:0-0'. 2020-02-26T06:20:50.362878Z 0 [ERROR] Aborting 2020-02-26T06:20:50.362893Z 0 [Note] Binlog end
[26 Feb 2020 6:52]
MySQL Verification Team
- 8.0.19 rm -rf 98743/ bin/mysqld --initialize-insecure --basedir=$PWD --datadir=$PWD/98743 --log-error-verbosity=3 bin/mysqld --no-defaults --basedir=$PWD --datadir=$PWD/98743 --core-file --socket=/tmp/mysql_ushastry.sock --port=3333 --log-error=$PWD/98743/log.err --mysqlx=0 --log-error-verbosity=3 --secure-file-priv="" --gtid_mode=ON --log-bin --log-slave-updates --enforce-gtid-consistency --server-id=1 2>&1 & bin/mysql -uroot -S /tmp/mysql_ushastry.sock Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 6 Server version: 8.0.19 MySQL Community Server - GPL Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> select * from mysql.gtid_executed; Empty set (0.01 sec) mysql> INSERT INTO mysql.gtid_executed VALUES ("invalid", 0, 0); Query OK, 1 row affected, 1 warning (0.00 sec) mysql> show warnings; +---------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Level | Code | Message | +---------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Warning | 3129 | Please do not modify the gtid_executed table. This is a mysql internal system table to store GTIDs for committed transactions. Modifying it can lead to an inconsistent GTID state. | +---------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.01 sec) mysql> shutdown; Query OK, 0 rows affected (0.00 sec) mysql> \q Bye [1]+ Done bin/mysqld --no-defaults --basedir=$PWD --datadir=$PWD/98743 --core-file --socket=/tmp/mysql_ushastry.sock --port=3333 --log-error=$PWD/98743/log.err --mysqlx=0 --log-error-verbosity=3 --secure-file-priv="" --gtid_mode=ON --log-bin --log-slave-updates --enforce-gtid-consistency --server-id=1 2>&1 -- Try to bring up mysql> shutdown; Query OK, 0 rows affected (0.00 sec) mysql> \q Bye bin/mysqld --no-defaults --basedir=$PWD --datadir=$PWD/98743 --core-file --socket=/tmp/mysql_ushastry.sock --port=3333 --log-error=$PWD/98743/log.err --mysqlx=0 --log-error-verbosity=3 --secure-file-priv="" --gtid_mode=ON --log-bin --log-slave-updates --enforce-gtid-consistency --server-id=1 2>&1 . [1]+ Exit 1 bin/mysqld --no-defaults --basedir=$PWD --datadir=$PWD/98743 --core-file --socket=/tmp/mysql_ushastry.sock --port=3333 --log-error=$PWD/98743/log.err --mysqlx=0 --log-error-verbosity=3 --secure-file-priv="" --gtid_mode=ON --log-bin --log-slave-updates --enforce-gtid-consistency --server-id=1 2>&1 - mysqld: Malformed GTID set specification 'invalid:0-0'. 2020-02-26T05:52:15.176997Z 0 [Note] [MY-012922] [InnoDB] Waiting for purge to start mysqld: Malformed GTID set specification 'invalid:0-0'. 2020-02-26T05:52:15.230311Z 0 [ERROR] [MY-010119] [Server] Aborting
[2 Mar 2023 19:31]
Javier Albinarrate
I've run into the same problem with a server that went to recovery after a power cut. As mysqld does not start, it doesn't even allow me to check what's wrong to fix it. The error logs: 2023-03-01 19:25:30 2160 [Note] Plugin 'FEDERATED' is disabled. 2023-03-01 19:25:31 2160 [Note] InnoDB: The InnoDB memory heap is disabled 2023-03-01 19:25:31 2160 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions 2023-03-01 19:25:31 2160 [Note] InnoDB: Compressed tables use zlib 1.2.3 2023-03-01 19:25:31 2160 [Note] InnoDB: Not using CPU crc32 instructions 2023-03-01 19:25:31 2160 [Note] InnoDB: Initializing buffer pool, size = 339.0M 2023-03-01 19:25:31 2160 [Note] InnoDB: Completed initialization of buffer pool 2023-03-01 19:25:31 2160 [Note] InnoDB: Highest supported file format is Barracuda. 2023-03-01 19:25:31 2160 [Note] InnoDB: The log sequence numbers 1863209813 and 1863209813 in ibdata files do not match the log sequence number 1863333935 in the ib_logfiles! 2023-03-01 19:25:31 2160 [Note] InnoDB: Database was not shutdown normally! 2023-03-01 19:25:31 2160 [Note] InnoDB: Starting crash recovery. 2023-03-01 19:25:31 2160 [Note] InnoDB: Reading tablespace information from the .ibd files... 2023-03-01 19:25:38 2160 [Note] InnoDB: Restoring possible half-written data pages 2023-03-01 19:25:38 2160 [Note] InnoDB: from the doublewrite buffer... InnoDB: Last MySQL binlog file position 0 185157, file name SERVER-bin.000012 2023-03-01 19:25:40 2160 [Note] InnoDB: 128 rollback segment(s) are active. 2023-03-01 19:25:41 2160 [Note] InnoDB: Waiting for purge to start 2023-03-01 19:25:41 2160 [Note] InnoDB: 5.6.15 started; log sequence number 1863333935 2023-03-01 19:25:42 2160 [Note] Recovering after a crash using SERVER-bin 2023-03-01 19:25:42 2160 [Note] Starting crash recovery... 2023-03-01 19:25:42 2160 [Note] Crash recovery finished. C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqld: Malformed GTID set encoding. 2023-03-01 19:25:44 2160 [ERROR] Aborting