| 1 |
RESET MASTER; |
| 2 |
SET @@GLOBAL.DEBUG= "+d,simulate_err_on_write_gtid_into_table"; |
| 3 |
call mtr.add_suppression("Failed to save the set of Global Transaction " |
| 4 |
"Identifiers of the last binary log into the " |
| 5 |
"mysql.gtid_executed table while the server was " |
| 6 |
"shutting down. The next server restart will make " |
| 7 |
"another attempt to save Global Transaction " |
| 8 |
"Identifiers into the table."); |
| 9 |
SET @debug_save= @@GLOBAL.DEBUG; |
| 10 |
CREATE TABLE t1 (a INT) ENGINE=InnoDB; |
| 11 |
# restart |
| 12 |
# |
| 13 |
# Verify that we can get correct gtid sets after server restarts |
| 14 |
# even if we encounter an error on writing gtids into table on |
| 15 |
# server shutdown. |
| 16 |
# |
| 17 |
include/assert.inc [committed gtid set is MASTER_UUID:1-2] |
| 18 |
SELECT * FROM mysql.gtid_executed; |
| 19 |
source_uuid interval_start interval_end |
| 20 |
MASTER_UUID 1 2 |
| 21 |
SET GLOBAL DEBUG= @debug_save; |
| 22 |
SET GLOBAL binlog_error_action= IGNORE_ERROR; |
| 23 |
SET GLOBAL debug="+d,simulate_err_on_write_gtid_into_table"; |
| 24 |
call mtr.add_suppression(".* Turning logging off for the whole duration of the " |
| 25 |
"MySQL server process. To turn it on again: fix the " |
| 26 |
"cause, shutdown the MySQL server and restart it."); |
| 27 |
call mtr.add_suppression("ERROR.*Unable to create a new binlog file: Table " |
| 28 |
"`mysql.gtid_executed` couldn't be opened. Current" |
| 29 |
" binlog file was flushed to disk and will be kept" |
| 30 |
" in use."); |
| 31 |
INSERT INTO t1 VALUES(1); |
| 32 |
SET GLOBAL debug="+d,wait_for_flush_gtid_persister"; |
| 33 |
FLUSH LOGS; |
| 34 |
ERROR HY000: Got error -1 - 'Unknown error' from storage engine |
| 35 |
SET GLOBAL debug="-d,wait_for_flush_gtid_persister"; |
| 36 |
SET GLOBAL debug="-d,simulate_err_on_write_gtid_into_table"; |
| 37 |
# |
| 38 |
# Verify that GTIDs are not saved into gtid_executed table if we |
| 39 |
# encounter an error on writing gtids into table on binlog rotation. |
| 40 |
# |
| 41 |
SELECT * FROM mysql.gtid_executed; |
| 42 |
source_uuid interval_start interval_end |
| 43 |
MASTER_UUID 1 2 |
| 44 |
include/assert.inc [committed gtid set is MASTER_UUID:1-5] |
| 45 |
SET GLOBAL binlog_error_action= ABORT_SERVER; |
| 46 |
DROP TABLE t1; |