Current Path : /usr/opt/mysql57/mysql-test/suite/binlog/t/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //usr/opt/mysql57/mysql-test/suite/binlog/t/binlog_gtid_exhausted.test |
############################################################################### # Bug#21276561: FAILURE TO GENERATE GTID LEADS TO INCONSISTENCY # # Problem: # ======= # If generating a GTID for a transaction fails, the transaction is not written # to the binary log but still gets committed, which potentially leads to # master/slave data inconsistency. # # Test: # ===== # Simulate a scenario such that generation of GTID number reaches its maximum # value and the new GTID cannot be generated because of that. Verify that this # fatal error case is appropriately handled as per the binlog_error_action # value specified by user. ############################################################################### --source include/have_innodb.inc --source include/have_gtid.inc # This test case is binlog_format agnostic --source include/have_binlog_format_statement.inc # Don't test this under valgrind, memory leaks will occur --source include/not_valgrind.inc call mtr.add_suppression("An error occurred during flush stage of the commit"); call mtr.add_suppression("Attempting backtrace. You can use the following information to find out"); --let $assert_file = $MYSQLTEST_VARDIR/tmp/binlog_gtid_exhausted.err #Test case 1: SET GLOBAL binlog_error_action=IGNORE_ERROR; CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; # @@GLOBAL.GTID_PURGED can only be set when @@GLOBAL.GTID_EXECUTED is empty. # Hence execute RESET MASTER. RESET MASTER; SET GLOBAL gtid_purged = CONCAT(@@GLOBAL.server_uuid, ':1-9223372036854775805'); INSERT INTO t1 VALUES (1); --error ER_GNO_EXHAUSTED INSERT INTO t1 VALUES (2); # BUG26035544 Assert that an error was logged to the server error log. --let $assert_select = Impossible to generate GTID: the integer component reached the maximum value. Restart the server with a new server_uuid. Hence turning logging off for the whole duration of the MySQL server process. To turn it on again: fix the cause, shutdown the MySQL server and restart it. --let $assert_count = 1 --let $assert_text = ER_GNO_EXHAUSTED found in server error log --source include/assert_grep.inc # Check that transaction is committed --let $assert_cond = COUNT(*) = 2 FROM t1; --let $assert_text = Count of elements in t1 should be 2. --source include/assert.inc --source include/restart_mysqld.inc RESET MASTER; DROP TABLE t1; #Test case 2: CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; # @@GLOBAL.GTID_PURGED can only be set when @@GLOBAL.GTID_EXECUTED is empty. # Hence execute RESET MASTER. RESET MASTER; SET GLOBAL gtid_purged = CONCAT(@@GLOBAL.server_uuid, ':1-9223372036854775805'); INSERT INTO t1 VALUES (1); SET GLOBAL binlog_error_action=ABORT_SERVER; --exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --error ER_BINLOG_LOGGING_IMPOSSIBLE INSERT INTO t1 VALUES (2); --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --enable_reconnect --source include/wait_until_connected_again.inc RESET MASTER; DROP TABLE t1; # BUG26035544 Assert that an error was logged to the server error log. --let $assert_select = Binary logging not possible. Message: Impossible to generate GTID: the integer component reached the maximum value. Restart the server with a new server_uuid. Server is being stopped. --let $assert_count = 1 --let $assert_text = ER_GNO_EXHAUSTED server is being stopped found in server error log --source include/assert_grep.inc