Skip to content

Commit

Permalink
Bug#32586753 MODIFY GR TESTS TO BE ROBUST UNDER FORCE-CHECK-TESTCASE
Browse files Browse the repository at this point in the history
Change-Id: Iebae6895a54cb56e0609964790d5b8b7773e472d
  • Loading branch information
dahlerlend committed Jun 22, 2021
1 parent 8a2723d commit f5d57e2
Show file tree
Hide file tree
Showing 26 changed files with 161 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mysql-test/mysql-test-run.pl
Original file line number Diff line number Diff line change
Expand Up @@ -4286,7 +4286,7 @@ ($$)
my %started;
foreach my $mysqld (mysqlds()) {
# Skip if server has been restarted with additional options
if (defined $mysqld->{'proc'} && !exists $mysqld->{'restart_opts'}) {
if (defined $mysqld->{'proc'}){
my $proc = start_check_testcase($tinfo, $mode, $mysqld);
$started{ $proc->pid() } = $proc;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,15 @@ SET session sql_log_bin=0;
CALL mtr.add_suppression("Using ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS implies limitations on the replication topology");
SET session sql_log_bin=1;

--let $allow_rpl_inited=1
--let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address`
--let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds`
--let $restart_parameters=restart:--group_replication_group_name=$group_replication_group_name --group_replication_local_address=$_group_replication_local_address --group_replication_group_seeds=$_group_replication_group_seeds --group_replication_bootstrap_group=1 --group_replication_start_on_boot=OFF
--replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME $_group_replication_local_address GROUP_REPLICATION_LOCAL_ADDRESS $_group_replication_group_seeds GROUP_REPLICATION_GROUP_SEEDS
--source include/restart_mysqld.inc
--let $rpl_server_number= 1
--source include/rpl_reconnect.inc

--let $rpl_connection_name= server2
--source include/rpl_connection.inc
--source include/stop_group_replication.inc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,15 @@ CALL mtr.add_suppression("Replication channel '' is configured with ASSIGN_GTIDS
CALL mtr.add_suppression("The group_replication_group_name .*. is the same as");
SET session sql_log_bin=1;

--let $allow_rpl_inited=1
--let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address`
--let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds`
--let $restart_parameters=restart:--group_replication_group_name=$group_replication_group_name --group_replication_local_address=$_group_replication_local_address --group_replication_group_seeds=$_group_replication_group_seeds --group_replication_bootstrap_group=1 --group_replication_start_on_boot=OFF
--replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME $_group_replication_local_address GROUP_REPLICATION_LOCAL_ADDRESS $_group_replication_group_seeds GROUP_REPLICATION_ROUP_SEEDS
--source include/restart_mysqld.inc
--let $rpl_server_number= 1
--source include/rpl_reconnect.inc

--let $rpl_connection_name= server2
--source include/rpl_connection.inc
--source include/stop_group_replication.inc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ ERROR HY000: The server is not configured properly to be an active member of the

############################################################
# Clean up.
# restart:--group_replication_group_name=GROUP_REPLICATION_GROUP_NAME --group_replication_local_address=GROUP_REPLICATION_LOCAL_ADDRESS --group_replication_group_seeds=GROUP_REPLICATION_GROUP_SEEDS
include/rpl_reconnect.inc
[connection server1]
SET GLOBAL group_replication_flow_control_mode= @group_replication_flow_control_mode_save;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@ SET SESSION sql_log_bin = 1;
SET @@GLOBAL.group_replication_ip_whitelist= GROUP_REPLICATION_IP_WHITELIST;
Warnings:
Warning 1287 'group_replication_ip_whitelist' is deprecated and will be removed in a future release. Please use group_replication_ip_allowlist instead
# restart:--group_replication_group_name=GROUP_REPLICATION_GROUP_NAME --group_replication_local_address=GROUP_REPLICATION_LOCAL_ADDRESS --group_replication_group_seeds=GROUP_REPLICATION_GROUP_SEEDS --group_replication_bootstrap_group=1
include/rpl_reconnect.inc
include/group_replication_end.inc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ Note #### Storing MySQL user name or password information in the master info rep
# Delete the user and check the start fails
#
[connection server1]
USE test;
CREATE TABLE test.tmp_user AS SELECT * FROM mysql.user;
INSERT INTO tmp_user SELECT * FROM mysql.user;
CREATE TABLE tmp_global_grants AS SELECT * FROM mysql.global_grants;
INSERT INTO tmp_global_grants SELECT * FROM mysql.global_grants;
DROP USER "mysql.session"@"localhost";
SET GLOBAL group_replication_group_name= "GROUP_REPLICATION_GROUP_NAME";
START GROUP_REPLICATION;
Expand All @@ -33,4 +38,6 @@ call mtr.add_suppression("Failed to establish an internal server connection to e
call mtr.add_suppression("It was not possible to establish a connection to server SQL service");
call mtr.add_suppression("On plugin shutdown it was not possible to reset the server read mode settings.");
SET SESSION sql_log_bin= 1;
# restart:--group_replication_local_address=GROUP_REPLICATION_LOCAL_ADDRESS --group_replication_group_seeds=GROUP_REPLICATION_GROUP_SEEDS --group_replication_start_on_boot=0 --group_replication_group_name=GROUP_REPLICATION_GROUP_NAME
include/rpl_reconnect.inc
include/group_replication_end.inc
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,6 @@ include/gr_assert_primary_member.inc
[connection server1]
COMMIT;
DROP TABLE t1;
[connection server2]
DROP TABLE t1;
include/group_replication_end.inc
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ include/gr_wait_primary_member_uuid.inc

# 13. Clean up
DROP TABLE t1;
[connection server2]
DROP TABLE t1;
[connection server1]
set session sql_log_bin=0;
call mtr.add_suppression("Error while executing a group configuration operation: The appointed primary for election left the group, this operation will be aborted.*");
set session sql_log_bin=1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,6 @@ include/gr_assert_secondary_member.inc
# 9. Cleanup
[connection server2]
DROP TABLE t1;
[connection server3]
DROP TABLE t1;
include/group_replication_end.inc
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,7 @@ include/gr_assert_multi_primary_mode.inc

# 9. Cleanup
DROP TABLE t1;
[connection server_3]
DROP TABLE t1;
[connection server_2]
include/group_replication_end.inc
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ Warning 1287 'RESET SLAVE' is deprecated and will be removed in a future release
# group_replication_applier channel
# restart:--group-replication-start-on-boot=ON --group-replication-group-name=GROUP_REPLICATION_GROUP_NAME --group_replication_local_address=GROUP_REPLICATION_LOCAL_ADDRESS --group_replication_group_seeds=GROUP_REPLICATION_GROUP_SEEDS --group_replication_bootstrap_group=ON --relay-log=new-relay-log-name --relay-log=new-relay-log-name
include/gr_wait_for_member_state.inc
include/stop_group_replication.inc
# restart:--group-replication-start-on-boot=ON --group-replication-group-name=GROUP_REPLICATION_GROUP_NAME --group_replication_local_address=GROUP_REPLICATION_LOCAL_ADDRESS --group_replication_group_seeds=GROUP_REPLICATION_GROUP_SEEDS --group_replication_bootstrap_group=ON --relay-log=new-relay-log-name --relay-log=new-relay-log-name --relay-log=server-relay-log --group_replication_start_on_boot=OFF
include/rpl_connect.inc [creating server_1]
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ include/stop_group_replication.inc
SET session sql_log_bin=0;
CALL mtr.add_suppression("Using ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS implies limitations on the replication topology");
SET session sql_log_bin=1;
# restart:--group_replication_group_name=GROUP_REPLICATION_GROUP_NAME --group_replication_local_address=GROUP_REPLICATION_LOCAL_ADDRESS --group_replication_group_seeds=GROUP_REPLICATION_GROUP_SEEDS --group_replication_bootstrap_group=1 --group_replication_start_on_boot=OFF
include/rpl_reconnect.inc
[connection server2]
include/stop_group_replication.inc
include/group_replication_end.inc
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ CALL mtr.add_suppression("Using ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS implies l
CALL mtr.add_suppression("Replication channel '' is configured with ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS");
CALL mtr.add_suppression("The group_replication_group_name .*. is the same as");
SET session sql_log_bin=1;
# restart:--group_replication_group_name=GROUP_REPLICATION_GROUP_NAME --group_replication_local_address=GROUP_REPLICATION_LOCAL_ADDRESS --group_replication_group_seeds=GROUP_REPLICATION_ROUP_SEEDS --group_replication_bootstrap_group=1 --group_replication_start_on_boot=OFF
include/rpl_reconnect.inc
[connection server2]
include/stop_group_replication.inc
include/group_replication_end.inc
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ CALL mtr.add_suppression("Using ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS implies l
CALL mtr.add_suppression("Replication channel '' is configured with ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS");
CALL mtr.add_suppression("The group_replication_group_name .*. is the same as");
SET session sql_log_bin=1;
# restart:--group_replication_group_name=GROUP_REPLICATION_GROUP_NAME --group_replication_local_address=GROUP_REPLICATION_LOCAL_ADDRESS --group_replication_group_seeds=GROUP_REPLICATION_ROUP_SEEDS --group_replication_bootstrap_group=1 --group_replication_start_on_boot=OFF
include/rpl_reconnect.inc
[connection server2]
include/stop_group_replication.inc
include/group_replication_end.inc
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,9 @@ Warning 1287 'RESET SLAVE' is deprecated and will be removed in a future release
RESET SLAVE ALL FOR CHANNEL '';
Warnings:
Warning 1287 'RESET SLAVE' is deprecated and will be removed in a future release. Please use RESET REPLICA instead
# restart:--group-replication-start-on-boot=OFF --group-replication-group-name=GROUP_REPLICATION_GROUP_NAME --group_replication_local_address=GROUP_REPLICATION_LOCAL_ADDRESS --group_replication_group_seeds=GROUP_REPLICATION_GROUP_SEEDS
include/rpl_reconnect.inc
[connection server1]
# restart:--group-replication-start-on-boot=OFF --group-replication-group-name=GROUP_REPLICATION_GROUP_NAME --group_replication_local_address=GROUP_REPLICATION_LOCAL_ADDRESS --group_replication_group_seeds=GROUP_REPLICATION_GROUP_SEEDS
include/rpl_reconnect.inc
include/group_replication_end.inc
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,6 @@ set session sql_log_bin=0;
DROP USER 'rec_ssl_user';
set session sql_log_bin=1;
DROP TABLE t1;
# restart:--group_replication_local_address=GROUP_REPLICATION_LOCAL_ADDRESS --group_replication_group_seeds=GROUP_REPLICATION_GROUP_SEEDS --report_port=ADMIN_PORT
include/rpl_reconnect.inc
include/group_replication_end.inc
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,11 @@ START GROUP_REPLICATION;
--echo ############################################################
--echo # Clean up.

--let $allow_rpl_inited= 1
--let $restart_parameters=restart:--group_replication_group_name=$group_replication_group_name --group_replication_local_address=$_group_replication_local_address --group_replication_group_seeds=$_group_replication_group_seeds
--replace_result $_group_replication_local_address GROUP_REPLICATION_LOCAL_ADDRESS $_group_replication_group_seeds GROUP_REPLICATION_GROUP_SEEDS $group_replication_group_name GROUP_REPLICATION_GROUP_NAME
--source include/restart_mysqld.inc

--let $rpl_server_number= 2
--source include/rpl_reconnect.inc

Expand All @@ -512,4 +517,6 @@ SET GLOBAL group_replication_flow_control_release_percent=@group_replication_flo

SET @@GLOBAL.DEBUG= @debug_saved;



--source include/group_replication_end.inc
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,13 @@ SET SESSION sql_log_bin = 1;

--replace_result $saved_gr_ip_whitelist GROUP_REPLICATION_IP_WHITELIST
--eval SET @@GLOBAL.group_replication_ip_whitelist= $saved_gr_ip_whitelist

--let $allow_rpl_inited=1
--let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address`
--let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds`
--let $restart_parameters=restart:--group_replication_group_name=$group_replication_group_name --group_replication_local_address=$_group_replication_local_address --group_replication_group_seeds=$_group_replication_group_seeds --group_replication_bootstrap_group=1
--replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME $_group_replication_local_address GROUP_REPLICATION_LOCAL_ADDRESS $_group_replication_group_seeds GROUP_REPLICATION_GROUP_SEEDS
--source include/restart_mysqld.inc
--let $rpl_server_number= 1
--source include/rpl_reconnect.inc
--source include/group_replication_end.inc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
#save user timestamps for later restore
let $date_to_restore=`SELECT password_last_changed from mysql.user where user='mysql.session'`;
let $date_to_restore_priv=`SELECT timestamp from mysql.tables_priv where user='mysql.session'`;
USE test;
CREATE TABLE test.tmp_user AS SELECT * FROM mysql.user;
INSERT INTO tmp_user SELECT * FROM mysql.user;

CREATE TABLE tmp_global_grants AS SELECT * FROM mysql.global_grants;
INSERT INTO tmp_global_grants SELECT * FROM mysql.global_grants;

DROP USER "mysql.session"@"localhost";

Expand Down Expand Up @@ -67,7 +73,15 @@ START GROUP_REPLICATION;
--echo #

--disable_query_log
--eval INSERT IGNORE INTO mysql.user VALUES ('localhost','mysql.session','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','Y','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','',0,0,0,0,'mysql_native_password','*THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE','N',"$date_to_restore",NULL,'Y', 'N', 'N', NULL, NULL, NULL, NULL);
--disable_result_log
TRUNCATE TABLE mysql.user;
INSERT IGNORE INTO mysql.user SELECT * FROM tmp_user;
DROP TABLE tmp_user;

TRUNCATE TABLE mysql.global_grants;
INSERT IGNORE INTO mysql.global_grants SELECT * FROM tmp_global_grants;
DROP TABLE tmp_global_grants;
--enable_result_log

--eval INSERT IGNORE INTO mysql.tables_priv VALUES ('localhost', 'mysql', 'mysql.session', 'user', 'root\@localhost', "$date_to_restore_priv", 'Select', '');

Expand All @@ -87,4 +101,13 @@ call mtr.add_suppression("It was not possible to establish a connection to serve
call mtr.add_suppression("On plugin shutdown it was not possible to reset the server read mode settings.");
SET SESSION sql_log_bin= 1;

--let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address`
--let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds`
--let $restart_parameters=restart:--group_replication_local_address=$_group_replication_local_address --group_replication_group_seeds=$_group_replication_group_seeds --group_replication_start_on_boot=0 --group_replication_group_name=$group_replication_group_name
--replace_result $_group_replication_local_address GROUP_REPLICATION_LOCAL_ADDRESS $_group_replication_group_seeds GROUP_REPLICATION_GROUP_SEEDS $group_replication_group_name GROUP_REPLICATION_GROUP_NAME
--source include/restart_mysqld.inc
--let $rpl_server_number= 1
--source include/rpl_reconnect.inc


--source include/group_replication_end.inc
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,11 @@ COMMIT;

DROP TABLE t1;

--let $rpl_connection_name= server2
--source include/rpl_connection.inc

DROP TABLE t1;

--let $rpl_group_replication_single_primary_mode=1
--let $rpl_group_replication_reset_persistent_vars=1
--source include/group_replication_end.inc
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,14 @@ UNLOCK TABLES;

DROP TABLE t1;

--let $rpl_connection_name= server2
--source include/rpl_connection.inc

DROP TABLE t1;

--let $rpl_connection_name= server1
--source include/rpl_connection.inc

set session sql_log_bin=0;
call mtr.add_suppression("Error while executing a group configuration operation: The appointed primary for election left the group, this operation will be aborted.*");
set session sql_log_bin=1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ INSERT INTO t1 VALUES (1);
--source include/rpl_connection.inc


DROP TABLE t1;

--let $rpl_connection_name= server3
--source include/rpl_connection.inc

DROP TABLE t1;

--let $rpl_group_replication_single_primary_mode=1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,12 @@ COMMIT;

DROP TABLE t1;

--let $rpl_connection_name= server_3
--source include/rpl_connection.inc
DROP TABLE t1;

--let $rpl_connection_name= server_2
--source include/rpl_connection.inc

--let $rpl_group_replication_reset_persistent_vars=1
--source include/group_replication_end.inc
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,13 @@ RESET SLAVE FOR CHANNEL 'group_replication_applier';
--let $group_replication_member_state= ONLINE
--source include/gr_wait_for_member_state.inc

--source include/stop_group_replication.inc
--let $allow_rpl_inited=1
--let $restart_parameters= $restart_parameters --relay-log=server-relay-log --group_replication_start_on_boot=OFF
--replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME $_group_replication_local_address GROUP_REPLICATION_LOCAL_ADDRESS $_group_replication_group_seeds GROUP_REPLICATION_GROUP_SEEDS
--source include/restart_mysqld.inc
--let $rpl_server_number= 1
--let $rpl_connection_name= server_1
--source include/rpl_connect.inc

--let $skip_recovery_configuration= 1
--source include/gr_clear_configuration.inc
Original file line number Diff line number Diff line change
Expand Up @@ -231,4 +231,25 @@ RESET SLAVE ALL FOR CHANNEL 'ch3_2';

RESET SLAVE ALL FOR CHANNEL '';

--let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address`
--let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds`
--let $restart_parameters=restart:--group-replication-start-on-boot=OFF --group-replication-group-name=$group_replication_group_name --group_replication_local_address=$_group_replication_local_address --group_replication_group_seeds=$_group_replication_group_seeds
--replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME $_group_replication_local_address GROUP_REPLICATION_LOCAL_ADDRESS $_group_replication_group_seeds GROUP_REPLICATION_GROUP_SEEDS
--source include/restart_mysqld.inc

--let $rpl_server_number= 2
--source include/rpl_reconnect.inc

--let $rpl_connection_name= server1
--source include/rpl_connection.inc

--let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address`
--let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds`
--let $restart_parameters=restart:--group-replication-start-on-boot=OFF --group-replication-group-name=$group_replication_group_name --group_replication_local_address=$_group_replication_local_address --group_replication_group_seeds=$_group_replication_group_seeds
--replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME $_group_replication_local_address GROUP_REPLICATION_LOCAL_ADDRESS $_group_replication_group_seeds GROUP_REPLICATION_GROUP_SEEDS
--source include/restart_mysqld.inc

--let $rpl_server_number= 1
--source include/rpl_reconnect.inc

--source include/group_replication_end.inc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
--let $rpl_connection_name= server1
--source include/rpl_connection.inc

--let $_default_report_port= `SELECT @@GLOBAL.report_port`

--let $allow_rpl_inited= 1
--let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address`
--let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds`
Expand Down Expand Up @@ -111,4 +113,16 @@ set session sql_log_bin=1;

DROP TABLE t1;

--let $allow_rpl_inited= 1
--let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address`
--let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds`
--let $_admin_port= `SELECT @@GLOBAL.admin_port`
--let $restart_parameters=restart:--group_replication_local_address=$_group_replication_local_address --group_replication_group_seeds=$_group_replication_group_seeds --report_port=$_default_report_port
--replace_result $_group_replication_local_address GROUP_REPLICATION_LOCAL_ADDRESS $_group_replication_group_seeds GROUP_REPLICATION_GROUP_SEEDS $_default_report_port ADMIN_PORT
--source include/restart_mysqld.inc

# Needed as we are not using rpl_restart_server.inc
--let $rpl_server_number= 1
--source include/rpl_reconnect.inc

--source include/group_replication_end.inc

0 comments on commit f5d57e2

Please sign in to comment.