Commit 1e89d2a1 authored by Brandon Nesterenko's avatar Brandon Nesterenko

MDEV-34122: Update tests to check message is provided

parent 66eae3ad
......@@ -45,13 +45,21 @@ drop table t1, t2, t3;
# Here, debug_sync is used to pause the leader thread between reporting
# the binlogging to semi-sync, and starting the wait for ACK; and during
# this pause, semi-sync is manually switched off and on.
# Waiting for semi-sync to turn on..
connection slave;
connection master;
set @old_master_wait_point= @@global.rpl_semi_sync_master_wait_point;
set @old_master_wait_no_slave= @@global.rpl_semi_sync_master_wait_no_slave;
set @@global.rpl_semi_sync_master_wait_point= AFTER_SYNC;
set @@global.rpl_semi_sync_master_wait_no_slave= 1;
# Waiting for semi-sync to turn on..
connection slave;
connection master;
create table t (a int) engine=innodb;
connection slave;
# Wait no slave is on, so we don't need to slave on to wait for the
# ACK, and this way we guarantee the ACK doesn't come, so we can verify
# the informational message is displayed
connection slave;
include/stop_slave.inc
connection server_1;
start transaction;
insert into t values (0);
......@@ -65,9 +73,13 @@ set @@global.rpl_semi_sync_master_enabled= 1;
# Resuming transaction to await ACK
set debug_sync= "now SIGNAL continue_commit";
connection server_1;
include/assert_grep.inc [Ensure error log shows that transaction is skipping its semi-sync wait]
# Cleanup
connection slave;
include/start_slave.inc
connection master;
drop table t;
connection slave;
#
# MDEV-34122.b: Test wait_point = AFTER_COMMIT
# Here, use a transaction with a non-transactional statement to write to
......@@ -75,6 +87,9 @@ drop table t;
# transaction.
connection master;
set @@global.rpl_semi_sync_master_wait_point= AFTER_COMMIT;
# Waiting for semi-sync to turn on..
connection slave;
connection master;
create table tn (a int) engine=Aria;
start transaction;
insert into tn values (NULL);
......@@ -85,4 +100,5 @@ commit;
connection master;
drop table tn;
set @@global.rpl_semi_sync_master_wait_point= @old_master_wait_point;
set @@global.rpl_semi_sync_master_wait_no_slave= @old_master_wait_no_slave;
include/rpl_end.inc
......@@ -96,22 +96,32 @@ drop table t1, t2, t3;
--echo # the binlogging to semi-sync, and starting the wait for ACK; and during
--echo # this pause, semi-sync is manually switched off and on.
--echo # Waiting for semi-sync to turn on..
--connection slave
let $status_var= rpl_semi_sync_slave_status;
let $status_var_value= ON;
source include/wait_for_status_var.inc;
--connection master
set @old_master_wait_point= @@global.rpl_semi_sync_master_wait_point;
set @old_master_wait_no_slave= @@global.rpl_semi_sync_master_wait_no_slave;
set @@global.rpl_semi_sync_master_wait_point= AFTER_SYNC;
set @@global.rpl_semi_sync_master_wait_no_slave= 1;
--echo # Waiting for semi-sync to turn on..
let $status_var= rpl_semi_sync_master_status;
let $status_var_value= ON;
source include/wait_for_status_var.inc;
--connection slave
let $status_var= rpl_semi_sync_slave_status;
let $status_var_value= ON;
source include/wait_for_status_var.inc;
--connection master
create table t (a int) engine=innodb;
--sync_slave_with_master
--echo # Wait no slave is on, so we don't need to slave on to wait for the
--echo # ACK, and this way we guarantee the ACK doesn't come, so we can verify
--echo # the informational message is displayed
--connection slave
--source include/stop_slave.inc
--connection server_1
start transaction;
insert into t values (0);
......@@ -134,9 +144,20 @@ set debug_sync= "now SIGNAL continue_commit";
--connection server_1
--reap
--let $assert_text= Ensure error log shows that transaction is skipping its semi-sync wait
--let $assert_select=Skipping semi-sync wait for transaction
--let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.1.err
--let $assert_count= 1
--let $assert_only_after=CURRENT_TEST
--source include/assert_grep.inc
--echo # Cleanup
--connection slave
--source include/start_slave.inc
--connection master
drop table t;
--sync_slave_with_master
--echo #
......@@ -148,6 +169,16 @@ drop table t;
--connection master
set @@global.rpl_semi_sync_master_wait_point= AFTER_COMMIT;
--echo # Waiting for semi-sync to turn on..
let $status_var= rpl_semi_sync_master_status;
let $status_var_value= ON;
source include/wait_for_status_var.inc;
--connection slave
let $status_var= rpl_semi_sync_slave_status;
let $status_var_value= ON;
source include/wait_for_status_var.inc;
--connection master
create table tn (a int) engine=Aria;
start transaction;
insert into tn values (NULL);
......@@ -159,5 +190,6 @@ commit;
--connection master
drop table tn;
set @@global.rpl_semi_sync_master_wait_point= @old_master_wait_point;
set @@global.rpl_semi_sync_master_wait_no_slave= @old_master_wait_no_slave;
--source include/rpl_end.inc
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment