mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
Merge branch '10.5' into 10.6
This commit is contained in:
@@ -15,9 +15,6 @@ create table t2 (a int);
|
||||
include/sync_slave_sql_with_master.inc
|
||||
#
|
||||
# Pt 1) Ensure SBM is updated immediately upon arrival of the next event
|
||||
# Lock t1 on slave so the first received transaction does not complete/commit
|
||||
connection slave;
|
||||
LOCK TABLES t1 WRITE;
|
||||
connection master;
|
||||
# Sleep 2 to allow a buffer between events for SBM check
|
||||
insert into t1 values (0);
|
||||
@@ -26,8 +23,16 @@ connection slave;
|
||||
# Waiting for transaction to arrive on slave and begin SQL Delay..
|
||||
# Validating SBM is updated on event arrival..
|
||||
# ..done
|
||||
# MDEV-32265. At time of STOP SLAVE, if the SQL Thread is currently
|
||||
# delaying a transaction; then when the reciprocal START SLAVE occurs,
|
||||
# if the event is still to be delayed, SBM should resume accordingly
|
||||
include/stop_slave.inc
|
||||
include/start_slave.inc
|
||||
connection slave;
|
||||
UNLOCK TABLES;
|
||||
# Waiting for replica to resume the delay for the transaction
|
||||
# Sleeping 1s to increment SBM
|
||||
# Ensuring Seconds_Behind_Master increases after sleeping..
|
||||
# ..done
|
||||
include/sync_with_master_gtid.inc
|
||||
#
|
||||
# Pt 2) If the worker threads have not entered an idle state, ensure
|
||||
|
@@ -82,6 +82,37 @@ SELECT @@global.gtid_binlog_state, @@global.gtid_slave_pos as "all through 101 h
|
||||
@@global.gtid_binlog_state all through 101 have been committed
|
||||
0-1-101 0-1-101
|
||||
connection slave;
|
||||
flush tables with read lock;
|
||||
connection master;
|
||||
CREATE OR REPLACE SEQUENCE s3 ENGINE=innodb;
|
||||
SELECT NEXT VALUE FOR s3 into @tmpvar;
|
||||
include/save_master_gtid.inc
|
||||
connection slave;
|
||||
unlock tables;
|
||||
include/sync_with_master_gtid.inc
|
||||
connection slave;
|
||||
flush tables with read lock;
|
||||
connection master;
|
||||
CREATE OR REPLACE SEQUENCE s3 ENGINE=innodb;
|
||||
SELECT NEXT VALUE FOR s3 into @tmpvar;
|
||||
include/save_master_gtid.inc
|
||||
connection slave;
|
||||
unlock tables;
|
||||
include/sync_with_master_gtid.inc
|
||||
connection slave;
|
||||
BEGIN /* slave local Trx */;
|
||||
select count(*) from s3;
|
||||
count(*)
|
||||
1
|
||||
connection master;
|
||||
CREATE OR REPLACE SEQUENCE s3 ENGINE=innodb;
|
||||
SELECT NEXT VALUE FOR s3 into @tmpvar;
|
||||
include/save_master_gtid.inc
|
||||
connection slave;
|
||||
connection slave;
|
||||
rollback /* Trx */;
|
||||
include/sync_with_master_gtid.inc
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
SET debug_sync = RESET;
|
||||
SET @@global.slave_parallel_threads= 0;
|
||||
@@ -90,7 +121,10 @@ SET @@global.debug_dbug = "";
|
||||
SET @@global.gtid_strict_mode=0;
|
||||
include/start_slave.inc
|
||||
connection master;
|
||||
DROP SEQUENCE s2;
|
||||
BEGIN;
|
||||
INSERT INTO ti SET a=32593;
|
||||
CREATE SEQUENCE s4;
|
||||
DROP SEQUENCE s2,s3,s4;
|
||||
DROP TABLE ti;
|
||||
connection slave;
|
||||
include/rpl_end.inc
|
||||
|
@@ -19,6 +19,64 @@ connection master;
|
||||
INSERT INTO t1(c1) VALUES ('insert into t1');
|
||||
DROP TABLE t1;
|
||||
connection slave;
|
||||
#
|
||||
# MDEV-32249 strings/ctype-ucs2.c:2336: my_vsnprintf_utf32: Assertion `(n
|
||||
#
|
||||
#
|
||||
# Testing with VARCHAR
|
||||
#
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
SET GLOBAL SLAVE_TYPE_CONVERSIONS= '';
|
||||
include/start_slave.inc
|
||||
connection master;
|
||||
CREATE TABLE t1 (a INT);
|
||||
connection slave;
|
||||
ALTER TABLE t1 MODIFY a VARCHAR(1) CHARACTER SET utf32;
|
||||
connection master;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
connection slave;
|
||||
include/wait_for_slave_sql_error.inc [errno=1677]
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(1) CHARACTER SET utf32 COLLATE utf32_general_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
a
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
|
||||
START SLAVE;
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
connection slave;
|
||||
#
|
||||
# Testing with CHAR
|
||||
#
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
SET GLOBAL SLAVE_TYPE_CONVERSIONS= '';
|
||||
include/start_slave.inc
|
||||
connection master;
|
||||
CREATE TABLE t1 (a INT);
|
||||
connection slave;
|
||||
ALTER TABLE t1 MODIFY a CHAR(1) CHARACTER SET utf32;
|
||||
connection master;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
connection slave;
|
||||
include/wait_for_slave_sql_error.inc [errno=1677]
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` char(1) CHARACTER SET utf32 COLLATE utf32_general_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
a
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
|
||||
START SLAVE;
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
connection slave;
|
||||
connection slave;
|
||||
SET GLOBAL SLAVE_TYPE_CONVERSIONS= @saved_slave_type_conversions;
|
||||
include/stop_slave.inc
|
||||
include/start_slave.inc
|
||||
|
@@ -8,6 +8,7 @@ connection server_1;
|
||||
# Slaves which simulate an error will produce a timeout on the primary
|
||||
call mtr.add_suppression("Timeout waiting");
|
||||
call mtr.add_suppression("did not exit");
|
||||
call mtr.add_suppression("Got an error reading communication packets");
|
||||
# Suppress slave errors related to the simulated error
|
||||
connection server_2;
|
||||
call mtr.add_suppression("reply failed");
|
||||
|
@@ -31,6 +31,13 @@ connection slave;
|
||||
# Compare the tables on master and slave.
|
||||
include/diff_tables.inc [master:t1, slave:t1]
|
||||
connection master;
|
||||
set statement sql_log_bin=0 for call mtr.add_suppression("Read semi-sync reply magic number error");
|
||||
SET @save_debug_master= @@global.debug;
|
||||
SET GLOBAL debug_dbug="+d,semisync_corrupt_magic";
|
||||
insert into t1 values (11);
|
||||
connection slave;
|
||||
connection master;
|
||||
SET GLOBAL debug_dbug= @save_debug_master;
|
||||
drop table t1;
|
||||
connection slave;
|
||||
set global rpl_semi_sync_slave_enabled = OFF;
|
||||
|
@@ -36,10 +36,6 @@ create table t2 (a int);
|
||||
--echo #
|
||||
--echo # Pt 1) Ensure SBM is updated immediately upon arrival of the next event
|
||||
|
||||
--echo # Lock t1 on slave so the first received transaction does not complete/commit
|
||||
--connection slave
|
||||
LOCK TABLES t1 WRITE;
|
||||
|
||||
--connection master
|
||||
--echo # Sleep 2 to allow a buffer between events for SBM check
|
||||
sleep 2;
|
||||
@@ -65,8 +61,31 @@ if (`SELECT $sbm_trx1_arrive > ($seconds_since_idling + 1)`)
|
||||
}
|
||||
--echo # ..done
|
||||
|
||||
|
||||
--echo # MDEV-32265. At time of STOP SLAVE, if the SQL Thread is currently
|
||||
--echo # delaying a transaction; then when the reciprocal START SLAVE occurs,
|
||||
--echo # if the event is still to be delayed, SBM should resume accordingly
|
||||
|
||||
--source include/stop_slave.inc
|
||||
--source include/start_slave.inc
|
||||
|
||||
--connection slave
|
||||
UNLOCK TABLES;
|
||||
--echo # Waiting for replica to resume the delay for the transaction
|
||||
--let $wait_condition= SELECT count(*) FROM information_schema.processlist WHERE state LIKE 'Waiting until MASTER_DELAY seconds after master executed event';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--echo # Sleeping 1s to increment SBM
|
||||
sleep 1;
|
||||
|
||||
--echo # Ensuring Seconds_Behind_Master increases after sleeping..
|
||||
--let $sbm_trx1_after_1s_sleep= query_get_value(SHOW SLAVE STATUS, Seconds_Behind_Master, 1)
|
||||
if (`SELECT $sbm_trx1_after_1s_sleep <= $sbm_trx1_arrive`)
|
||||
{
|
||||
--echo # ..failed
|
||||
--die Seconds_Behind_Master did not increase after sleeping, but should have
|
||||
}
|
||||
--echo # ..done
|
||||
|
||||
--source include/sync_with_master_gtid.inc
|
||||
|
||||
--echo #
|
||||
|
@@ -128,8 +128,51 @@ SET DEBUG_SYNC = 'now SIGNAL continue_worker';
|
||||
|
||||
SELECT @@global.gtid_binlog_state, @@global.gtid_slave_pos as "all through 101 have been committed";
|
||||
|
||||
# MDEV-31792 Assertion in MDL_context::acquire_lock upon parallel replication of CREATE SEQUENCE
|
||||
|
||||
--let $iter = 3
|
||||
while ($iter)
|
||||
{
|
||||
--connection slave
|
||||
if (`select $iter > 1`)
|
||||
{
|
||||
flush tables with read lock;
|
||||
}
|
||||
if (`select $iter = 1`)
|
||||
{
|
||||
BEGIN /* slave local Trx */;
|
||||
select count(*) from s3;
|
||||
}
|
||||
|
||||
--connection master
|
||||
CREATE OR REPLACE SEQUENCE s3 ENGINE=innodb;
|
||||
# select may return non-deterministically, don't print its result
|
||||
SELECT NEXT VALUE FOR s3 into @tmpvar;
|
||||
--source include/save_master_gtid.inc
|
||||
|
||||
--connection slave
|
||||
--let $wait_condition= SELECT count(*) = 1 FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to start commit%"
|
||||
--source include/wait_condition.inc
|
||||
|
||||
if (`select $iter > 1`)
|
||||
{
|
||||
unlock tables;
|
||||
}
|
||||
if (`select $iter = 1`)
|
||||
{
|
||||
--connection slave
|
||||
rollback /* Trx */;
|
||||
}
|
||||
|
||||
|
||||
--source include/sync_with_master_gtid.inc
|
||||
|
||||
--dec $iter
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# MDEV-29621/MDEV-31077 clean up.
|
||||
# MDEV-29621/MDEV-31077/MDEV-31792 clean up.
|
||||
#
|
||||
--connection slave
|
||||
--source include/stop_slave.inc
|
||||
@@ -142,7 +185,12 @@ SET debug_sync = RESET;
|
||||
--source include/start_slave.inc
|
||||
|
||||
--connection master
|
||||
DROP SEQUENCE s2;
|
||||
# MDEV-32593 Assertion failure upon CREATE SEQUENCE
|
||||
BEGIN;
|
||||
INSERT INTO ti SET a=32593;
|
||||
CREATE SEQUENCE s4;
|
||||
|
||||
DROP SEQUENCE s2,s3,s4;
|
||||
DROP TABLE ti;
|
||||
|
||||
--sync_slave_with_master
|
||||
|
@@ -34,10 +34,78 @@ DROP TABLE t1;
|
||||
|
||||
--sync_slave_with_master
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-32249 strings/ctype-ucs2.c:2336: my_vsnprintf_utf32: Assertion `(n
|
||||
--echo #
|
||||
|
||||
--echo #
|
||||
--echo # Testing with VARCHAR
|
||||
--echo #
|
||||
|
||||
-- connection slave
|
||||
-- source include/stop_slave.inc
|
||||
SET GLOBAL SLAVE_TYPE_CONVERSIONS= '';
|
||||
-- source include/start_slave.inc
|
||||
|
||||
--connection master
|
||||
CREATE TABLE t1 (a INT);
|
||||
|
||||
--sync_slave_with_master
|
||||
ALTER TABLE t1 MODIFY a VARCHAR(1) CHARACTER SET utf32;
|
||||
|
||||
--connection master
|
||||
INSERT INTO t1 VALUES (1);
|
||||
|
||||
--connection slave
|
||||
# ER_SLAVE_CONVERSION_FAILED
|
||||
--let $slave_sql_errno= 1677
|
||||
--source include/wait_for_slave_sql_error.inc
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
|
||||
START SLAVE;
|
||||
|
||||
--connection master
|
||||
DROP TABLE t1;
|
||||
--sync_slave_with_master
|
||||
|
||||
--echo #
|
||||
--echo # Testing with CHAR
|
||||
--echo #
|
||||
|
||||
-- connection slave
|
||||
-- source include/stop_slave.inc
|
||||
SET GLOBAL SLAVE_TYPE_CONVERSIONS= '';
|
||||
-- source include/start_slave.inc
|
||||
|
||||
--connection master
|
||||
CREATE TABLE t1 (a INT);
|
||||
|
||||
--sync_slave_with_master
|
||||
ALTER TABLE t1 MODIFY a CHAR(1) CHARACTER SET utf32;
|
||||
|
||||
--connection master
|
||||
INSERT INTO t1 VALUES (1);
|
||||
|
||||
--connection slave
|
||||
# ER_SLAVE_CONVERSION_FAILED
|
||||
--let $slave_sql_errno= 1677
|
||||
--source include/wait_for_slave_sql_error.inc
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
|
||||
START SLAVE;
|
||||
|
||||
--connection master
|
||||
DROP TABLE t1;
|
||||
--sync_slave_with_master
|
||||
|
||||
|
||||
# assertion: the slave woul hit an/several assertions:
|
||||
# before and during slave conversion procedure
|
||||
# Now that is fixed, it wont.
|
||||
|
||||
-- connection slave
|
||||
SET GLOBAL SLAVE_TYPE_CONVERSIONS= @saved_slave_type_conversions;
|
||||
-- source include/stop_slave.inc
|
||||
-- source include/start_slave.inc
|
||||
|
@@ -67,6 +67,7 @@
|
||||
--echo # Slaves which simulate an error will produce a timeout on the primary
|
||||
call mtr.add_suppression("Timeout waiting");
|
||||
call mtr.add_suppression("did not exit");
|
||||
call mtr.add_suppression("Got an error reading communication packets");
|
||||
|
||||
--let $sav_master_timeout= `SELECT @@global.rpl_semi_sync_master_timeout`
|
||||
--let $sav_enabled_master= `SELECT @@GLOBAL.rpl_semi_sync_master_enabled`
|
||||
|
@@ -77,6 +77,16 @@ insert into t1 values (10);
|
||||
--source include/diff_tables.inc
|
||||
|
||||
--connection master
|
||||
set statement sql_log_bin=0 for call mtr.add_suppression("Read semi-sync reply magic number error");
|
||||
SET @save_debug_master= @@global.debug;
|
||||
SET GLOBAL debug_dbug="+d,semisync_corrupt_magic";
|
||||
insert into t1 values (11);
|
||||
|
||||
--sync_slave_with_master
|
||||
|
||||
--connection master
|
||||
SET GLOBAL debug_dbug= @save_debug_master;
|
||||
|
||||
drop table t1;
|
||||
--sync_slave_with_master
|
||||
set global rpl_semi_sync_slave_enabled = OFF;
|
||||
|
Reference in New Issue
Block a user