Debian Codegraph @

mysql-test/suite/rpl_nogtid/r/rpl_semi_sync_after_sync.result

raw
1 include/master-slave.inc
2 Warnings:
3 Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
4 Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
5 [connection master]
6 include/install_semisync.inc
7 SET GLOBAL binlog_error_action = IGNORE_ERROR;
8 CREATE TABLE t1(c1 INT) ENGINE=InnoDB;
9 include/sync_slave_sql_with_master.inc
10 #
11 # Test on AFTER_SYNC wait point
12 # #######################################################################
13 # Case 1: Single statement transaction
14 #
15 [connection server_1]
16 show status like "rpl_semi_sync_source_yes_tx";
17 Variable_name Value
18 Rpl_semi_sync_source_yes_tx 1
19 SET DEBUG_SYNC= "after_call_after_sync_observer SIGNAL after_sync_done WAIT_FOR end";
20 INSERT INTO t1 VALUES(1);;
21 [connection master]
22 SET DEBUG_SYNC= "now WAIT_FOR after_sync_done";
23 show status like "rpl_semi_sync_source_yes_tx";
24 Variable_name Value
25 Rpl_semi_sync_source_yes_tx 2
26 include/assert.inc [rpl_semi_sync_source_yes_tx increased 1]
27 include/assert.inc [Table is empty right now.]
28 include/sync_slave_sql_with_master.inc
29 include/assert.inc [Table has 1 record]
30 [connection master]
31 SET DEBUG_SYNC= "now SIGNAL end";
32 [connection server_1]
33 include/assert.inc [rpl_semi_sync_source_yes_tx increased only 1]
34 TRUNCATE t1;
35 #
36 # Test on AFTER_SYNC wait point
37 # #######################################################################
38 # Case 2: Real transaction
39 #
40 [connection server_1]
41 SET DEBUG_SYNC= "after_call_after_sync_observer SIGNAL after_sync_done WAIT_FOR end";
42 BEGIN;
43 INSERT INTO t1 VALUES(1);
44 INSERT INTO t1 VALUES(2);
45 COMMIT;
46 [connection master]
47 SET DEBUG_SYNC= "now WAIT_FOR after_sync_done";
48 include/assert.inc [rpl_semi_sync_source_yes_tx increased 1]
49 include/assert.inc [Table is empty right now.]
50 include/sync_slave_sql_with_master.inc
51 include/assert.inc [Table has two records]
52 [connection master]
53 SET DEBUG_SYNC= "now SIGNAL end";
54 [connection server_1]
55 include/assert.inc [rpl_semi_sync_source_yes_tx increased only 1]
56 TRUNCATE t1;
57 #
58 # Test on AFTER_COMMIT wait point
59 # #######################################################################
60 # Verify after_sync hook will not be executed
61 #
62 SET GLOBAL rpl_semi_sync_source_wait_point= AFTER_COMMIT;
63 SET DEBUG_SYNC= "before_call_after_commit_observer SIGNAL engine_commit_done
64 WAIT_FOR end";
65 INSERT INTO t1 VALUES(1);;
66 [connection master]
67 SET DEBUG_SYNC= "now WAIT_FOR engine_commit_done";
68 include/assert.inc [Table is empty right now.]
69 include/assert.inc [rpl_semi_sync_source_yes_tx was not increased]
70 include/assert.inc [rpl_semi_sync_source_no_tx was not increased]
71 SET DEBUG_SYNC= "now SIGNAL end";
72 [connection server_1]
73 SET DEBUG_SYNC= "RESET";
74 [connection master]
75 SET DEBUG_SYNC= "RESET";
76 SET GLOBAL rpl_semi_sync_source_wait_point= AFTER_SYNC;
77 TRUNCATE t1;
78 include/sync_slave_sql_with_master.inc
79 [connection master]
80 SET GLOBAL binlog_order_commits = OFF;
81 #
82 # Test on AFTER_SYNC wait point
83 # #######################################################################
84 # Case 1: Single statement transaction
85 #
86 [connection server_1]
87 show status like "rpl_semi_sync_source_yes_tx";
88 Variable_name Value
89 Rpl_semi_sync_source_yes_tx 7
90 SET DEBUG_SYNC= "after_call_after_sync_observer SIGNAL after_sync_done WAIT_FOR end";
91 INSERT INTO t1 VALUES(1);;
92 [connection master]
93 SET DEBUG_SYNC= "now WAIT_FOR after_sync_done";
94 show status like "rpl_semi_sync_source_yes_tx";
95 Variable_name Value
96 Rpl_semi_sync_source_yes_tx 8
97 include/assert.inc [rpl_semi_sync_source_yes_tx increased 1]
98 include/assert.inc [Table is empty right now.]
99 include/sync_slave_sql_with_master.inc
100 include/assert.inc [Table has 1 record]
101 [connection master]
102 SET DEBUG_SYNC= "now SIGNAL end";
103 [connection server_1]
104 include/assert.inc [rpl_semi_sync_source_yes_tx increased only 1]
105 TRUNCATE t1;
106 #
107 # Test on AFTER_SYNC wait point
108 # #######################################################################
109 # Case 2: Real transaction
110 #
111 [connection server_1]
112 SET DEBUG_SYNC= "after_call_after_sync_observer SIGNAL after_sync_done WAIT_FOR end";
113 BEGIN;
114 INSERT INTO t1 VALUES(1);
115 INSERT INTO t1 VALUES(2);
116 COMMIT;
117 [connection master]
118 SET DEBUG_SYNC= "now WAIT_FOR after_sync_done";
119 include/assert.inc [rpl_semi_sync_source_yes_tx increased 1]
120 include/assert.inc [Table is empty right now.]
121 include/sync_slave_sql_with_master.inc
122 include/assert.inc [Table has two records]
123 [connection master]
124 SET DEBUG_SYNC= "now SIGNAL end";
125 [connection server_1]
126 include/assert.inc [rpl_semi_sync_source_yes_tx increased only 1]
127 TRUNCATE t1;
128 #
129 # Test on AFTER_COMMIT wait point
130 # #######################################################################
131 # Verify after_sync hook will not be executed
132 #
133 SET GLOBAL rpl_semi_sync_source_wait_point= AFTER_COMMIT;
134 SET DEBUG_SYNC= "before_call_after_commit_observer SIGNAL engine_commit_done
135 WAIT_FOR end";
136 INSERT INTO t1 VALUES(1);;
137 [connection master]
138 SET DEBUG_SYNC= "now WAIT_FOR engine_commit_done";
139 include/assert.inc [Table is empty right now.]
140 include/assert.inc [rpl_semi_sync_source_yes_tx was not increased]
141 include/assert.inc [rpl_semi_sync_source_no_tx was not increased]
142 SET DEBUG_SYNC= "now SIGNAL end";
143 [connection server_1]
144 SET DEBUG_SYNC= "RESET";
145 [connection master]
146 SET DEBUG_SYNC= "RESET";
147 SET GLOBAL rpl_semi_sync_source_wait_point= AFTER_SYNC;
148 TRUNCATE t1;
149 include/sync_slave_sql_with_master.inc
150 [connection master]
151 SET GLOBAL binlog_order_commits= 1;
152 #
153 # For coverage test, simulate after_sync hook error
154 #
155 SET @saved_debug= @@GLOBAL.debug;
156 SET GLOBAL debug='+d,simulate_after_sync_hook_error';
157 INSERT INTO t1 VALUES(1);
158 SELECT * FROM t1;
159 c1
160 1
161 SET GLOBAL debug= @saved_debug;
162 CALL mtr.add_suppression("Failed to run 'after_sync' hook");
163 include/rpl_restart_server.inc [server_number=1]
164 [connection slave]
165 include/start_slave_io.inc
166 [connection master]
167 CALL mtr.add_suppression("An error occurred during sync stage of the commit.");
168 DROP TABLE t1;
169 include/uninstall_semisync.inc
170 include/rpl_end.inc