1
0
mirror of https://github.com/MariaDB/server.git synced 2025-11-28 17:36:30 +03:00

Merge 10.3 into 10.4

This commit is contained in:
Marko Mäkelä
2022-03-29 11:13:18 +03:00
66 changed files with 1972 additions and 197 deletions

View File

@@ -0,0 +1,6 @@
ALTER TABLE mysql.gtid_slave_pos ENGINE=innodb;
# Restart the server so mysqld reads the gtid_slave_pos using innodb
# Set gtid_slave_pos should not hang
SET GLOBAL gtid_slave_pos=@@gtid_binlog_pos;
COMMIT;
RESET MASTER;

View File

@@ -0,0 +1,7 @@
CREATE TABLE t1 (a int);
FLUSH LOGS;
INSERT INTO t1 VALUES (1);
# timeout TIMEOUT MYSQL_BINLOG --raw --read-from-remote-server --user=root --host=127.0.0.1 --port=MASTER_MYPORT --stop-never --result-file=MYSQLTEST_VARDIR/tmp/ master-bin.000001
# MYSQL_BINLOG MYSQLTEST_VARDIR/tmp/master-bin.000002 > MYSQLTEST_VARDIR/tmp/local-bin.000002.out
FOUND 1 /GTID 0-1-2/ in local-bin.000002.out
DROP TABLE t1;

View File

@@ -0,0 +1 @@
--autocommit=0

View File

@@ -0,0 +1,45 @@
#
# Purpose:
# When the mysql.gtid_slave_pos table uses the InnoDB engine, and mysqld
# starts, it reads the table and begins a transaction. After mysqld reads the
# value, it should end the transaction and release all associated locks.
# The bug reported in DBAAS-7828 shows that when autocommit is off, the locks
# are not released, resulting in indefinite hangs on future attempts to change
# gtid_slave_pos. This test ensures its fix such that the locks are properly
# released.
#
# References:
# DBAAS-7828: Primary/replica: configuration change of "autocommit=0" can
# not be applied
#
--source include/have_innodb.inc
--source include/have_log_bin.inc
# Reading gtid_slave_pos table is format independent so just use one for
# reduced test time
--source include/have_binlog_format_row.inc
--let old_slave_pos_engine= query_get_value(SHOW TABLE STATUS FROM mysql LIKE 'gtid_slave_pos', Engine, 1)
# Use a transactional engine
ALTER TABLE mysql.gtid_slave_pos ENGINE=innodb;
--echo # Restart the server so mysqld reads the gtid_slave_pos using innodb
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server
--source include/wait_until_disconnected.inc
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect
--source include/wait_until_connected_again.inc
--echo # Set gtid_slave_pos should not hang
SET GLOBAL gtid_slave_pos=@@gtid_binlog_pos;
COMMIT;
# Revert table type
--disable_query_log
--eval ALTER TABLE mysql.gtid_slave_pos ENGINE=$old_slave_pos_engine
--enable_query_log
RESET MASTER;

View File

@@ -0,0 +1,45 @@
#
# Purpose:
# When using mariadb-binlog with options for --raw and --stop-never, events
# from the master's currently active log file should be written to their
# respective log file specified by --result-file, and shown on-disk. This test
# ensures that the log files on disk, created by mariadb-binlog, have the most
# up-to-date events from the master.
#
# Methodology:
# On the master, rotate to a newly active binlog file and write an event to
# it. Read the master's binlog using mariadb-binlog with --raw and --stop-never
# and write the data to an intermediary binlog file (a timeout is used on this
# command to ensure it exits). Read the local intermediary binlog file to ensure
# that the master's most recent event exists in the local file.
#
# References:
# MDEV-14608: mysqlbinlog lastest backupfile size is 0
#
--source include/linux.inc
--source include/have_log_bin.inc
# Create newly active log
CREATE TABLE t1 (a int);
FLUSH LOGS;
INSERT INTO t1 VALUES (1);
# Read binlog data from master to intermediary result file
--let TIMEOUT=1
--echo # timeout TIMEOUT MYSQL_BINLOG --raw --read-from-remote-server --user=root --host=127.0.0.1 --port=MASTER_MYPORT --stop-never --result-file=MYSQLTEST_VARDIR/tmp/ master-bin.000001
--error 124 # Error 124 means timeout was reached
--exec timeout $TIMEOUT $MYSQL_BINLOG --raw --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --stop-never --result-file=$MYSQLTEST_VARDIR/tmp/ master-bin.000001
# Ensure the binlog output has the most recent events from the master
--echo # MYSQL_BINLOG MYSQLTEST_VARDIR/tmp/master-bin.000002 > MYSQLTEST_VARDIR/tmp/local-bin.000002.out
--exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/tmp/master-bin.000002 > $MYSQLTEST_VARDIR/tmp/local-bin.000002.out
--let SEARCH_PATTERN= GTID 0-1-2
--let SEARCH_FILE= $MYSQLTEST_VARDIR/tmp/local-bin.000002.out
--source include/search_pattern_in_file.inc
# Cleanup
DROP TABLE t1;
--remove_file $MYSQLTEST_VARDIR/tmp/master-bin.000001
--remove_file $MYSQLTEST_VARDIR/tmp/master-bin.000002
--remove_file $MYSQLTEST_VARDIR/tmp/local-bin.000002.out