Skip to content

Commit 458e6d2

Browse files
author
Venkatesh Duggirala
committed
Merge branch 'mysql-8.0' into mysql-trunk
2 parents 30dc2b5 + 6c35210 commit 458e6d2

9 files changed

+464
-33
lines changed

mysql-test/include/uninstall_semisync_master.inc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77

88
--disable_query_log
99
--disable_warnings
10+
11+
# wait till semisync clients are '0' before uninstalling
12+
# semisync master plugin.
13+
--let $status_var= Rpl_semi_sync_master_clients
14+
--let $status_var_value= 0
15+
--source include/wait_for_status_var.inc
16+
1017
UNINSTALL PLUGIN rpl_semi_sync_master;
1118

1219
--source include/end_include_file.inc
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
include/rpl_init.inc [topology=1->2, 1->3, 1->4, 1->5, 1->6, 1->7, 1->8, 1->9]
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 master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
5+
Warnings:
6+
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
7+
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
8+
Warnings:
9+
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
10+
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
11+
Warnings:
12+
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
13+
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
14+
Warnings:
15+
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
16+
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
17+
Warnings:
18+
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
19+
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
20+
Warnings:
21+
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
22+
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
23+
Warnings:
24+
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
25+
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
26+
#
27+
# 1. Initial data.
28+
#
29+
call mtr.add_suppression("Timeout waiting for reply of binlog");
30+
CREATE TABLE t1(c1 INT);
31+
include/rpl_sync.inc
32+
#
33+
# 2. Install semisync on all the 9 servers.
34+
#
35+
[connection server_1]
36+
CALL mtr.add_suppression("Semi-sync master failed on net_flush.*");
37+
include/install_semisync_master.inc
38+
[connection server_2]
39+
CALL mtr.add_suppression("Semi-sync slave net_flush.*");
40+
include/install_semisync_slave.inc
41+
[connection server_3]
42+
CALL mtr.add_suppression("Semi-sync slave net_flush.*");
43+
include/install_semisync_slave.inc
44+
[connection server_4]
45+
CALL mtr.add_suppression("Semi-sync slave net_flush.*");
46+
include/install_semisync_slave.inc
47+
[connection server_5]
48+
CALL mtr.add_suppression("Semi-sync slave net_flush.*");
49+
include/install_semisync_slave.inc
50+
[connection server_6]
51+
CALL mtr.add_suppression("Semi-sync slave net_flush.*");
52+
include/install_semisync_slave.inc
53+
[connection server_7]
54+
CALL mtr.add_suppression("Semi-sync slave net_flush.*");
55+
include/install_semisync_slave.inc
56+
[connection server_8]
57+
CALL mtr.add_suppression("Semi-sync slave net_flush.*");
58+
include/install_semisync_slave.inc
59+
[connection server_9]
60+
CALL mtr.add_suppression("Semi-sync slave net_flush.*");
61+
include/install_semisync_slave.inc
62+
#
63+
# 3. Make Master aware of 8 semisync slaves.
64+
#
65+
[connection server1_1]
66+
SET GLOBAL rpl_semi_sync_master_wait_for_slave_count = 8;
67+
#
68+
# 4. Insert 1000 tuples in background using 10 parallel connections.
69+
#
70+
#
71+
# 5. While the insert operations are going in the background, keep
72+
# adding/removing semisync slaves randomly.
73+
#
74+
#
75+
# 6. Add all 8 semisync slaves back to Master
76+
# (if they were disconnected, in above step).
77+
#
78+
#
79+
# 7. Make sure the data is synced on Master without any issues.
80+
#
81+
[connection server_1]
82+
include/rpl_sync.inc
83+
#
84+
# 8. Check on all servers semisync is enabled after the
85+
# the experiment and then uninstall semisync pluging
86+
# from it.
87+
#
88+
[connection server_9]
89+
include/assert.inc [ should be 1]
90+
include/uninstall_semisync_slave.inc
91+
[connection server_8]
92+
include/assert.inc [ should be 1]
93+
include/uninstall_semisync_slave.inc
94+
[connection server_7]
95+
include/assert.inc [ should be 1]
96+
include/uninstall_semisync_slave.inc
97+
[connection server_6]
98+
include/assert.inc [ should be 1]
99+
include/uninstall_semisync_slave.inc
100+
[connection server_5]
101+
include/assert.inc [ should be 1]
102+
include/uninstall_semisync_slave.inc
103+
[connection server_4]
104+
include/assert.inc [ should be 1]
105+
include/uninstall_semisync_slave.inc
106+
[connection server_3]
107+
include/assert.inc [ should be 1]
108+
include/uninstall_semisync_slave.inc
109+
[connection server_2]
110+
include/assert.inc [ should be 1]
111+
include/uninstall_semisync_slave.inc
112+
[connection server_1]
113+
include/assert.inc [ should be 1]
114+
include/uninstall_semisync_master.inc
115+
#
116+
# 9. Cleanup time.
117+
#
118+
[connection server_1]
119+
DROP TABLE t1;
120+
include/rpl_end.inc
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$SEMISYNC_PLUGIN_OPT
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$SEMISYNC_PLUGIN_OPT
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
!include ../my.cnf
2+
3+
[mysqld.1]
4+
log-slave-updates
5+
server_id=1
6+
7+
[mysqld.2]
8+
log-slave-updates
9+
server_id=2
10+
11+
[mysqld.3]
12+
log-slave-updates
13+
server_id=3
14+
15+
[mysqld.4]
16+
log-slave-updates
17+
server_id=4
18+
19+
[mysqld.5]
20+
log-slave-updates
21+
server_id=5
22+
23+
[mysqld.6]
24+
log-slave-updates
25+
server_id=6
26+
27+
[mysqld.7]
28+
log-slave-updates
29+
server_id=7
30+
31+
[mysqld.8]
32+
log-slave-updates
33+
server_id=8
34+
35+
[mysqld.9]
36+
log-slave-updates
37+
server_id=9
38+
39+
[ENV]
40+
SERVER_MYPORT_3= @mysqld.3.port
41+
SERVER_MYSOCK_3= @mysqld.3.socket
42+
43+
SERVER_MYPORT_4= @mysqld.4.port
44+
SERVER_MYSOCK_4= @mysqld.4.socket
45+
46+
SERVER_MYPORT_5= @mysqld.5.port
47+
SERVER_MYSOCK_5= @mysqld.5.socket
48+
49+
SERVER_MYPORT_6= @mysqld.6.port
50+
SERVER_MYSOCK_6= @mysqld.6.socket
51+
52+
SERVER_MYPORT_7= @mysqld.7.port
53+
SERVER_MYSOCK_7= @mysqld.7.socket
54+
55+
SERVER_MYPORT_8= @mysqld.8.port
56+
SERVER_MYSOCK_8= @mysqld.8.socket
57+
58+
SERVER_MYPORT_9= @mysqld.9.port
59+
SERVER_MYSOCK_9= @mysqld.9.socket
Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
#==== Purpose ====
2+
#
3+
# This test script purpose is to check semisync replication
4+
# behaviour when there are semisync slaves getting added and
5+
# removed while dml changes are happening.
6+
#
7+
#==== Implementation ====
8+
#
9+
# 1) Install semisync on one Master and 8 Slaves.
10+
# 2) Using mysqlslap, keep inserting data in background on Master.
11+
# 3) While the DMLs are going on, keep adding/removing semisync slaves.
12+
# 4) At the end of the step-3, check that the data is synced without any
13+
# issues.
14+
# 5) Check semisync is still enabled on Master and all slaves.
15+
#
16+
#==== References ====
17+
#
18+
# Bug#27610678 SEMI-SYNC REPLICATION DOESN'T WORK FOR MINUTES AFTER RESTART
19+
# REPLICATION
20+
#
21+
#========
22+
#
23+
# 9 servers + 1000 inserts involved in test. Hence marking it as big-test.
24+
#
25+
--source include/big_test.inc
26+
--source include/not_group_replication_plugin.inc
27+
--source include/have_binlog_format_statement.inc
28+
--source include/have_debug.inc
29+
30+
#
31+
# One Master and 8 Slaves in the semi sync topology.
32+
#
33+
--let rpl_topology=1->2, 1->3, 1->4, 1->5, 1->6, 1->7, 1->8, 1->9
34+
--source include/rpl_init.inc
35+
36+
--echo #
37+
--echo # 1. Initial data.
38+
--echo #
39+
call mtr.add_suppression("Timeout waiting for reply of binlog");
40+
CREATE TABLE t1(c1 INT);
41+
--source include/rpl_sync.inc
42+
43+
--echo #
44+
--echo # 2. Install semisync on all the 9 servers.
45+
--echo #
46+
--let $i= 1
47+
while ($i < 10)
48+
{
49+
--let $rpl_connection_name= server_$i
50+
--source include/rpl_connection.inc
51+
if ( $i == 1)
52+
{
53+
--connect(server1_1, localhost,root,,,$MASTER_MYPORT)
54+
CALL mtr.add_suppression("Semi-sync master failed on net_flush.*");
55+
--source include/install_semisync_master.inc
56+
}
57+
if ( $i != 1 )
58+
{
59+
CALL mtr.add_suppression("Semi-sync slave net_flush.*");
60+
--source include/install_semisync_slave.inc
61+
}
62+
--inc $i
63+
}
64+
65+
--echo #
66+
--echo # 3. Make Master aware of 8 semisync slaves.
67+
--echo #
68+
--let $rpl_connection_name= server1_1
69+
--source include/rpl_connection.inc
70+
--let $slaves = 8
71+
--eval SET GLOBAL rpl_semi_sync_master_wait_for_slave_count = $slaves
72+
73+
--echo #
74+
--echo # 4. Insert 1000 tuples in background using 10 parallel connections.
75+
--echo #
76+
--exec_in_background $MYSQL_SLAP --create-schema=test --delimiter=";" --iterations=100 --query="INSERT INTO t1 values (1)" --concurrency=10 --silent 2>&1
77+
78+
--echo #
79+
--echo # 5. While the insert operations are going in the background, keep
80+
--echo # adding/removing semisync slaves randomly.
81+
--echo #
82+
--let $rpl_connection_silent = 1
83+
--let $include_silent= 1
84+
--disable_result_log
85+
--disable_query_log
86+
--let $rpl_debug= 0
87+
--let $iter= 1
88+
while ( $iter < 50 )
89+
{
90+
# Random server_id generator ( server_id will between [2-9]
91+
--let $server_id=`SELECT FLOOR(2 + ((RAND() * 100) % 8))`
92+
--let $rpl_connection_name= server_$server_id
93+
--source include/rpl_connection.inc
94+
--let $service_state= `SELECT service_state FROM performance_schema.replication_connection_status`
95+
if ($service_state == 'ON')
96+
{
97+
# If the replication state is ON, bring it down.
98+
--source include/stop_slave.inc
99+
--let $rpl_connection_name= server1_1
100+
--source include/rpl_connection.inc
101+
# Adjust rpl_semi_sync_master_wait_for_slave_count variable.
102+
--dec $slaves
103+
--eval SET GLOBAL rpl_semi_sync_master_wait_for_slave_count = $slaves
104+
}
105+
if ($service_state == 'OFF')
106+
{
107+
# If the replication state is OFF, bring it up.
108+
--source include/start_slave.inc
109+
--let $rpl_connection_name= server1_1
110+
--source include/rpl_connection.inc
111+
# Adjust rpl_semi_sync_master_wait_for_slave_count variable.
112+
--inc $slaves
113+
--eval SET GLOBAL rpl_semi_sync_master_wait_for_slave_count = $slaves
114+
}
115+
--inc $iter
116+
# Do it slowly while insertions on the master are happening in the background.
117+
sleep 1;
118+
}
119+
120+
--echo #
121+
--echo # 6. Add all 8 semisync slaves back to Master
122+
--echo # (if they were disconnected, in above step).
123+
--echo #
124+
--let $iter = 2
125+
while ($iter <= 9)
126+
{
127+
--let $rpl_connection_name= server_$iter
128+
--source include/rpl_connection.inc
129+
--let $service_state= `SELECT service_state FROM performance_schema.replication_connection_status`
130+
if ($service_state == 'OFF')
131+
{
132+
--source include/start_slave.inc
133+
--let $rpl_connection_name= server1_1
134+
--source include/rpl_connection.inc
135+
# Adjust rpl_semi_sync_master_wait_for_slave_count variable.
136+
--inc $slaves
137+
--eval SET GLOBAL rpl_semi_sync_master_wait_for_slave_count = $slaves
138+
}
139+
--inc $iter
140+
}
141+
--enable_result_log
142+
--enable_query_log
143+
--let $rpl_connection_silent = 0
144+
--let $include_silent= 0
145+
146+
147+
--echo #
148+
--echo # 7. Make sure the data is synced on Master without any issues.
149+
--echo #
150+
--let $rpl_connection_name= server_1
151+
--source include/rpl_connection.inc
152+
--let $wait_timeout= 60
153+
--let $wait_condition= SELECT count(*) = 1000 FROM t1
154+
--source include/wait_condition.inc
155+
--let $slave_timeout=600
156+
--source include/rpl_sync.inc
157+
158+
--echo #
159+
--echo # 8. Check on all servers semisync is enabled after the
160+
--echo # the experiment and then uninstall semisync pluging
161+
--echo # from it.
162+
--echo #
163+
--let $i= 9
164+
while ($i >= 1)
165+
{
166+
--let $rpl_connection_name= server_$i
167+
--source include/rpl_connection.inc
168+
if ( $i == 1)
169+
{
170+
--let $assert_variable_name= rpl_semi_sync_master_enabled
171+
--let $assert_variable_value= 1
172+
--source include/assert_variable.inc
173+
--source include/uninstall_semisync_master.inc
174+
}
175+
if ( $i != 1 )
176+
{
177+
--let $assert_variable_name= rpl_semi_sync_slave_enabled
178+
--let $assert_variable_value= 1
179+
--source include/assert_variable.inc
180+
--source include/uninstall_semisync_slave.inc
181+
}
182+
--dec $i
183+
}
184+
185+
--echo #
186+
--echo # 9. Cleanup time.
187+
--echo #
188+
--let $rpl_connection_name= server_1
189+
--source include/rpl_connection.inc
190+
DROP TABLE t1;
191+
--source include/rpl_end.inc

0 commit comments

Comments
 (0)