Debian Codegraph @

mysql-test/suite/rpl_nogtid/t/rpl_semi_sync_after_sync.test

raw
1 ################################################################################
2 # It verifies the feature that semisync waits after binlog sync and before
3 # transaction commit(WL#6355).
4 #
5 # Two wait points are there for semisync. AFTER_SYNC and AFTER_COMMIT
6 # The main differece is that Other sessions could NOT see the data before it
7 # replicated to slave if waiting at AFTER_SYNC wait point. In contrast, when
8 # waiting at AFTER_COMMIT, other sessions could see the data before it is
9 # replicated to slave.
10 #################################################################################
11 --source include/not_group_replication_plugin.inc
12 --source include/have_debug_sync.inc
13 --source include/master-slave.inc
14 --source include/have_semisync_plugin.inc
15 --source include/install_semisync.inc
16
17 SET GLOBAL binlog_error_action = IGNORE_ERROR;
18
19 CREATE TABLE t1(c1 INT) ENGINE=InnoDB;
20 --source include/sync_slave_sql_with_master.inc
21 --source extra/rpl_tests/rpl_semi_sync_after_sync.test
22
23 --source include/rpl_connection_master.inc
24 --let $saved_binlog_order_commits= `SELECT @@GLOBAL.binlog_order_commits`
25 SET GLOBAL binlog_order_commits = OFF;
26
27 --source extra/rpl_tests/rpl_semi_sync_after_sync.test
28
29 --source include/rpl_connection_master.inc
30 eval SET GLOBAL binlog_order_commits= $saved_binlog_order_commits;
31
32 --echo #
33 --echo # For coverage test, simulate after_sync hook error
34 --echo #
35 SET @saved_debug= @@GLOBAL.debug;
36 SET GLOBAL debug='+d,simulate_after_sync_hook_error';
37 INSERT INTO t1 VALUES(1);
38 SELECT * FROM t1;
39 SET GLOBAL debug= @saved_debug;
40 CALL mtr.add_suppression("Failed to run 'after_sync' hook");
41 # Binlog is closed due to above error. Restart the server to
42 # enable the binlog again to continue the test.
43 --let $rpl_server_number= 1
44 --source include/rpl_restart_server.inc
45
46 # on slower machines, when we are restarting Master, on slave
47 # IO thread might have stopped. Restart it.
48 --disable_result_log
49 --source include/rpl_connection_slave.inc
50 --let $slave_io_errno= 2003
51 --source include/start_slave_io.inc
52 --enable_result_log
53
54 --source include/rpl_connection_master.inc
55 CALL mtr.add_suppression("An error occurred during sync stage of the commit.");
56
57 DROP TABLE t1;
58 --source include/uninstall_semisync.inc
59 --source include/rpl_end.inc