1
0
mirror of https://github.com/MariaDB/server.git synced 2026-10-23 18:49:29 +03:00

Fix inconsistent terminology

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
This commit is contained in:
Kristian Nielsen
2026-06-15 10:43:23 +02:00
parent cbaa0fc1df
commit 40d6228811
76 changed files with 348 additions and 348 deletions

View File

@@ -1877,7 +1877,7 @@ static struct my_option my_options[] =
"applies to the first binlog passed on the command line. In GTID mode, "
"multiple GTIDs can be passed as a comma separated list, where each must "
"have a unique domain id. The list represents the gtid binlog state that "
"the client (another \"replica\" server) is aware of. Therefore, each GTID "
"the client (another \"slave\" server) is aware of. Therefore, each GTID "
"is exclusive; only events after a given sequence number will be printed to "
"allow users to receive events after their current state.",
&start_pos_str, &start_pos_str, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0,

View File

@@ -6255,9 +6255,9 @@ static int do_show_master_status(MYSQL *mysql_con, int consistent_binlog_pos,
print_comment(md_result_file, 0,
"\n--\n-- Alternately, following is the position of the binary "
"logging from SHOW MASTER STATUS at point of backup."
"\n-- Use this when creating a replica of the primary server "
"\n-- Use this when creating a slave of the master server "
"where the backup was made."
"\n-- The new server will be connecting to the primary server "
"\n-- The new server will be connecting to the master server "
"where the backup was taken."
"\n--\n\n");
fprintf(md_result_file,
@@ -6367,7 +6367,7 @@ static int do_show_slave_status(MYSQL *mysql_con, int have_mariadb_gtid,
"taken from SHOW SLAVE STATUS at the time of backup.\n"
"-- Use this position when creating a clone of, or replacement "
"server, from where the backup was taken."
"\n-- This new server will connects to the same primary "
"\n-- This new server will connects to the same master "
"server%s.\n--\n",
multi_source ? "(s)" : "");

View File

@@ -70,7 +70,7 @@ bind-address = 127.0.0.1
#log_slow_min_examined_row_limit = 1000
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replica, see README.Debian about other
# note: if you are setting up a replication slave, see README.Debian about other
# settings you may need to change.
#server-id = 1
#log_bin = /var/log/mysql/mysql-bin.log

View File

@@ -1012,7 +1012,7 @@ applies to the first binlog passed on the command line, and the first event
that has a position equal to or greater than \fIN\fR is printed\&. In GTID mode,
multiple GTIDs can be passed as a comma separated list, where each must have a
unique domain id\&. The list represents the gtid binlog state that the client
(another "replica" server) is aware of\&. Therefore, each GTID is exclusive; only
(another "slave" server) is aware of\&. Therefore, each GTID is exclusive; only
events after a given sequence number will be printed to allow users to receive
events after their current state\&.
.sp

View File

@@ -438,7 +438,7 @@ Note 1544 Event execution time is in the past. Event has been disabled
drop event event_35981;
drop database events_test;
#
# MDEV-37744 Table Charset Mismatch (Primary/Replica) via Event
# MDEV-37744 Table Charset Mismatch (Master/Slave) via Event
#
set global event_scheduler=1;
create schema andre default charset utf8mb4 collate utf8mb4_general_ci;

View File

@@ -528,7 +528,7 @@ drop database events_test;
--enable_service_connection
--echo #
--echo # MDEV-37744 Table Charset Mismatch (Primary/Replica) via Event
--echo # MDEV-37744 Table Charset Mismatch (Master/Slave) via Event
--echo #
set global event_scheduler=1;
create schema andre default charset utf8mb4 collate utf8mb4_general_ci;

View File

@@ -16,7 +16,7 @@ SHOW SLAVE STATUS;
ERROR 42000: Access denied; you need (at least one of) the SUPER, SLAVE MONITOR privilege(s) for this operation
#
# Verify that having REPLICATION SLAVE ADMIN doesn't allow SHOW RELAYLOG EVENTS
# Expected error: Access denied; you need (at least one of) the REPLICA MONITOR
# Expected error: Access denied; you need (at least one of) the SLAVE MONITOR
# privilege(s) for this operation
#
SHOW RELAYLOG EVENTS;

View File

@@ -44,7 +44,7 @@ SHOW SLAVE STATUS;
--echo #
--echo # Verify that having REPLICATION SLAVE ADMIN doesn't allow SHOW RELAYLOG EVENTS
--echo # Expected error: Access denied; you need (at least one of) the REPLICA MONITOR
--echo # Expected error: Access denied; you need (at least one of) the SLAVE MONITOR
--echo # privilege(s) for this operation
--echo #
--disable_ps_protocol

View File

@@ -73,13 +73,13 @@ GRANT SUPER, REPLICATION SLAVE, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, REA
# MDEV-23610: Slave user can't run "SHOW SLAVE STATUS" anymore after upgrade to 10.5, mysql_upgrade should take of that
#
#
# Should automatically get BINLOG MONITOR and REPLICA MONITOR
# Should automatically get BINLOG MONITOR and SLAVE MONITOR
#
SHOW GRANTS FOR user_replclient@localhost;
Grants for user_replclient@localhost
GRANT BINLOG MONITOR, SLAVE MONITOR ON *.* TO `user_replclient`@`localhost`
#
# Should automatically get REPLICA MONITOR
# Should automatically get SLAVE MONITOR
#
SHOW GRANTS FOR user_replslave@localhost;
Grants for user_replslave@localhost

View File

@@ -78,12 +78,12 @@ SHOW GRANTS FOR user_super_replslave@localhost;
--echo #
--echo #
--echo # Should automatically get BINLOG MONITOR and REPLICA MONITOR
--echo # Should automatically get BINLOG MONITOR and SLAVE MONITOR
--echo #
SHOW GRANTS FOR user_replclient@localhost;
--echo #
--echo # Should automatically get REPLICA MONITOR
--echo # Should automatically get SLAVE MONITOR
--echo #
SHOW GRANTS FOR user_replslave@localhost;

View File

@@ -135,8 +135,8 @@ CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START
--
-- Alternately, following is the position of the binary logging from SHOW MASTER STATUS at point of backup.
-- Use this when creating a replica of the primary server where the backup was made.
-- The new server will be connecting to the primary server where the backup was taken.
-- Use this when creating a slave of the master server where the backup was made.
-- The new server will be connecting to the master server where the backup was taken.
--
-- CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START;
@@ -144,7 +144,7 @@ CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START
--
-- The following is the SQL position of the replication taken from SHOW SLAVE STATUS at the time of backup.
-- Use this position when creating a clone of, or replacement server, from where the backup was taken.
-- This new server will connects to the same primary server(s).
-- This new server will connects to the same master server(s).
--
-- A corresponding to the below dump-slave CHANGE-MASTER settings to the slave gtid state is printed later in the file.
@@ -196,8 +196,8 @@ CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START
--
-- Alternately, following is the position of the binary logging from SHOW MASTER STATUS at point of backup.
-- Use this when creating a replica of the primary server where the backup was made.
-- The new server will be connecting to the primary server where the backup was taken.
-- Use this when creating a slave of the master server where the backup was made.
-- The new server will be connecting to the master server where the backup was taken.
--
-- CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START;
@@ -207,7 +207,7 @@ CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START
--
-- The following is the SQL position of the replication taken from SHOW SLAVE STATUS at the time of backup.
-- Use this position when creating a clone of, or replacement server, from where the backup was taken.
-- This new server will connects to the same primary server(s).
-- This new server will connects to the same master server(s).
--
-- A corresponding to the below dump-slave CHANGE-MASTER settings to the slave gtid state is printed later in the file.
@@ -245,7 +245,7 @@ connection slave;
include/stop_slave.inc
change master to master_use_gtid=slave_pos;
connection master;
# Ensuring the binlog dump thread is killed on primary...
# Ensuring the binlog dump thread is killed on master...
/*M!999999\- enable the sandbox mode */
-- CHANGE MASTER TO MASTER_LOG_FILE='master-bin.000002', MASTER_LOG_POS=BINLOG_START;
-- SET GLOBAL gtid_slave_pos='0-1-1005';

View File

@@ -160,7 +160,7 @@ change master to master_use_gtid=slave_pos;
connection master;
--echo # Ensuring the binlog dump thread is killed on primary...
--echo # Ensuring the binlog dump thread is killed on master...
--disable_query_log
--let $binlog_dump_thd_tid= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND LIKE 'Binlog Dump'`
if ($binlog_dump_thd_tid)

View File

@@ -9,7 +9,7 @@
# released.
#
# References:
# DBAAS-7828: Primary/replica: configuration change of "autocommit=0" can
# DBAAS-7828: Master/slave: configuration change of "autocommit=0" can
# not be applied
#

View File

@@ -8,14 +8,14 @@ GRANT RELOAD, PROCESS on *.* to backup@localhost;
NOT FOUND /missing required privilege/ in backup.log
NOT FOUND /xyz/ in xtrabackup_info
FOUND 1 /missing required privilege SLAVE MONITOR/ in backup.log
GRANT REPLICA MONITOR ON *.* TO backup@localhost;
GRANT SLAVE MONITOR ON *.* TO backup@localhost;
NOT FOUND /missing required privilege/ in backup.log
NOT FOUND /xyz/ in xtrabackup_info
REVOKE REPLICA MONITOR ON *.* FROM backup@localhost;
REVOKE SLAVE MONITOR ON *.* FROM backup@localhost;
FOUND 1 /missing required privilege REPLICATION SLAVE ADMIN/ in backup.log
FOUND 1 /missing required privilege SLAVE MONITOR/ in backup.log
GRANT REPLICATION SLAVE ADMIN ON *.* TO backup@localhost;
GRANT REPLICA MONITOR ON *.* TO backup@localhost;
GRANT SLAVE MONITOR ON *.* TO backup@localhost;
NOT FOUND /missing required privilege/ in backup.log
NOT FOUND /xyz/ in xtrabackup_info
DROP USER backup@localhost;

View File

@@ -42,7 +42,7 @@ exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=1
rmdir $targetdir;
# MDEV-23607 Warning: missing required privilege REPLICATION CLIENT
# --slave-info and --galera-info require REPLICA MONITOR
# --slave-info and --galera-info require SLAVE MONITOR
--disable_result_log
error 1;
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --user=backup --password=xyz --slave-info --target-dir=$targetdir > $MYSQLTEST_VARDIR/tmp/backup.log 2>&1;
@@ -53,7 +53,7 @@ rmdir $targetdir;
--let SEARCH_PATTERN= missing required privilege SLAVE MONITOR
--source include/search_pattern_in_file.inc
GRANT REPLICA MONITOR ON *.* TO backup@localhost;
GRANT SLAVE MONITOR ON *.* TO backup@localhost;
--disable_result_log
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --user backup --password xyz --slave-info --target-dir=$targetdir > $MYSQLTEST_VARDIR/tmp/backup.log 2>&1;
--enable_result_log
@@ -63,9 +63,9 @@ exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --user backup
--let SEARCH_PATTERN=xyz
--source include/search_pattern_in_file.inc
rmdir $targetdir;
REVOKE REPLICA MONITOR ON *.* FROM backup@localhost;
REVOKE SLAVE MONITOR ON *.* FROM backup@localhost;
# --safe-slave-backup requires REPLICATION SLAVE ADMIN, and REPLICA MONITOR
# --safe-slave-backup requires REPLICATION SLAVE ADMIN, and SLAVE MONITOR
--disable_result_log
error 1;
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --user backup --password xyz --safe-slave-backup --target-dir=$targetdir > $MYSQLTEST_VARDIR/tmp/backup.log;
@@ -79,7 +79,7 @@ rmdir $targetdir;
--source include/search_pattern_in_file.inc
GRANT REPLICATION SLAVE ADMIN ON *.* TO backup@localhost;
GRANT REPLICA MONITOR ON *.* TO backup@localhost;
GRANT SLAVE MONITOR ON *.* TO backup@localhost;
--disable_result_log
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup -ubackup -pxyz --safe-slave-backup --target-dir=$targetdir > $MYSQLTEST_VARDIR/tmp/backup.log 2>&1;
--enable_result_log

View File

@@ -15,4 +15,4 @@ FOUND 1 matches in master_info_file.txt
FOUND 1 matches in master_info_file-named.txt
FOUND 1 matches in master_info_file-named.txt
FOUND 1 matches in master_info_file-named.txt
RESET REPLICA 'named' ALL;
RESET SLAVE 'named' ALL;

View File

@@ -35,4 +35,4 @@
--let SEARCH_PATTERN= \\n$SERVER_MYPORT_2\\n
--source include/search_pattern_in_file.inc
RESET REPLICA 'named' ALL;
RESET SLAVE 'named' ALL;

View File

@@ -2,12 +2,12 @@
# Test multi-source dynamically setting of replication filter
# "replicate_rewrite_db"
#
# This test ensures that setting a replica's replicate_rewrite_db works on a
# per-master basis. To ensure this, this test connects a replica to two
# different primary server instances. Each primary uses the same database
# This test ensures that setting a slave's replicate_rewrite_db works on a
# per-master basis. To ensure this, this test connects a slave to two
# different master server instances. Each master uses the same database
# name and table name. To ensure the data operations don't interfere with one
# another on the replica, it sets replicate_rewrite_db individually per
# connection to apply the events from each primary into a database specific to
# another on the slave, it sets replicate_rewrite_db individually per
# connection to apply the events from each master into a database specific to
# that connection.
#

View File

@@ -1,8 +1,8 @@
# This file provides the structure to run a single test that ensures the
# mariadb-binlog command line tool is consistent with replicas for event
# mariadb-binlog command line tool is consistent with slaves for event
# filtering. The test is configured using the following input parameters, where
# each is nullable (i.e. it will not be used to configure mariadb-binlog or
# the replica).
# the slave).
#
# param $do_domain_ids : A list of domain ids to include in replication
# param $ignore_domain_ids : A list of domain ids to exclude from replication
@@ -12,8 +12,8 @@
# param $stop_position : The GTID positions that mark the end of an event
# stream in a particular domain
#
# param $con1 : The connection name of the primary server
# param $con2 : The connection name of the replica server
# param $con1 : The connection name of the master server
# param $con2 : The connection name of the slave server
# param $strict_mode : Uses input and checks for out of order GTIDs
# param $strict_mode_err : A boolean that provides expectations for strict
# mode to error

View File

@@ -12,8 +12,8 @@
--echo ##############################################
--echo # Connection semantics change:
--echo # * True primary is now connection 'slave'
--echo # * True replica is now connection 'master'
--echo # * True master is now connection 'slave'
--echo # * True slave is now connection 'master'
--echo ##############################################
--connection master
@@ -73,8 +73,8 @@ SELECT VARIABLE_NAME, GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHER
--echo ##############################################
--echo # Connection semantics change:
--echo # * True primary is back to connection 'master'
--echo # * True replica is back to connection 'slave'
--echo # * True master is back to connection 'master'
--echo # * True slave is back to connection 'slave'
--echo ##############################################
--connection master

View File

@@ -3,9 +3,9 @@
#
# param $check_db : The name of the database to validate all tables are the
# same within (test by default)
# param $con1 : The connection name of the primary server, defaults to
# param $con1 : The connection name of the master server, defaults to
# master
# param $con2 : The connection name of the replica server, defaults to
# param $con2 : The connection name of the slave server, defaults to
# slave
--let $include_filename= rpl_check_table_consistency.inc

View File

@@ -1,8 +1,8 @@
include/master-slave.inc
[connection master]
#
# MDEV-33957 UPDATE fails on replica replicating blob virtual column in
# NOBLOB mode when replica logging is off
# MDEV-33957 UPDATE fails on slave replicating blob virtual column in
# NOBLOB mode when slave logging is off
#
connection slave;
select @@log_slave_updates;

View File

@@ -13,8 +13,8 @@ include/sync_with_master_gtid.inc
include/rpl_change_master_demote.inc
##############################################
# Connection semantics change:
# * True primary is now connection 'slave'
# * True replica is now connection 'master'
# * True master is now connection 'slave'
# * True slave is now connection 'master'
##############################################
connection master;
SELECT VARIABLE_NAME, GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME LIKE 'gtid_binlog_pos' OR VARIABLE_NAME LIKE 'gtid_slave_pos' OR VARIABLE_NAME LIKE 'gtid_current_pos' ORDER BY VARIABLE_NAME ASC;
@@ -52,8 +52,8 @@ GTID_CURRENT_POS 0-2-3
GTID_SLAVE_POS 0-2-3
##############################################
# Connection semantics change:
# * True primary is back to connection 'master'
# * True replica is back to connection 'slave'
# * True master is back to connection 'master'
# * True slave is back to connection 'slave'
##############################################
connection master;
connection slave;
@@ -80,8 +80,8 @@ include/sync_with_master_gtid.inc
include/rpl_change_master_demote.inc
##############################################
# Connection semantics change:
# * True primary is now connection 'slave'
# * True replica is now connection 'master'
# * True master is now connection 'slave'
# * True slave is now connection 'master'
##############################################
connection master;
SELECT VARIABLE_NAME, GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME LIKE 'gtid_binlog_pos' OR VARIABLE_NAME LIKE 'gtid_slave_pos' OR VARIABLE_NAME LIKE 'gtid_current_pos' ORDER BY VARIABLE_NAME ASC;
@@ -119,8 +119,8 @@ GTID_CURRENT_POS 0-2-5
GTID_SLAVE_POS 0-2-5
##############################################
# Connection semantics change:
# * True primary is back to connection 'master'
# * True replica is back to connection 'slave'
# * True master is back to connection 'master'
# * True slave is back to connection 'slave'
##############################################
connection master;
connection slave;
@@ -140,8 +140,8 @@ include/sync_with_master_gtid.inc
include/rpl_change_master_demote.inc
##############################################
# Connection semantics change:
# * True primary is now connection 'slave'
# * True replica is now connection 'master'
# * True master is now connection 'slave'
# * True slave is now connection 'master'
##############################################
connection master;
SELECT VARIABLE_NAME, GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME LIKE 'gtid_binlog_pos' OR VARIABLE_NAME LIKE 'gtid_slave_pos' OR VARIABLE_NAME LIKE 'gtid_current_pos' ORDER BY VARIABLE_NAME ASC;
@@ -179,8 +179,8 @@ GTID_CURRENT_POS 0-2-9
GTID_SLAVE_POS 0-2-9
##############################################
# Connection semantics change:
# * True primary is back to connection 'master'
# * True replica is back to connection 'slave'
# * True master is back to connection 'master'
# * True slave is back to connection 'slave'
##############################################
connection master;
connection slave;
@@ -202,8 +202,8 @@ include/sync_with_master_gtid.inc
include/rpl_change_master_demote.inc
##############################################
# Connection semantics change:
# * True primary is now connection 'slave'
# * True replica is now connection 'master'
# * True master is now connection 'slave'
# * True slave is now connection 'master'
##############################################
connection master;
SELECT VARIABLE_NAME, GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME LIKE 'gtid_binlog_pos' OR VARIABLE_NAME LIKE 'gtid_slave_pos' OR VARIABLE_NAME LIKE 'gtid_current_pos' ORDER BY VARIABLE_NAME ASC;
@@ -241,8 +241,8 @@ GTID_CURRENT_POS 0-2-13
GTID_SLAVE_POS 0-2-13
##############################################
# Connection semantics change:
# * True primary is back to connection 'master'
# * True replica is back to connection 'slave'
# * True master is back to connection 'master'
# * True slave is back to connection 'slave'
##############################################
connection master;
connection slave;
@@ -267,8 +267,8 @@ include/sync_with_master_gtid.inc
include/rpl_change_master_demote.inc
##############################################
# Connection semantics change:
# * True primary is now connection 'slave'
# * True replica is now connection 'master'
# * True master is now connection 'slave'
# * True slave is now connection 'master'
##############################################
connection master;
SELECT VARIABLE_NAME, GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME LIKE 'gtid_binlog_pos' OR VARIABLE_NAME LIKE 'gtid_slave_pos' OR VARIABLE_NAME LIKE 'gtid_current_pos' ORDER BY VARIABLE_NAME ASC;
@@ -306,8 +306,8 @@ GTID_CURRENT_POS 0-2-17,1-1-2
GTID_SLAVE_POS 0-2-17,1-1-2
##############################################
# Connection semantics change:
# * True primary is back to connection 'master'
# * True replica is back to connection 'slave'
# * True master is back to connection 'master'
# * True slave is back to connection 'slave'
##############################################
connection master;
connection slave;
@@ -350,8 +350,8 @@ include/sync_with_master_gtid.inc
include/rpl_change_master_demote.inc
##############################################
# Connection semantics change:
# * True primary is now connection 'slave'
# * True replica is now connection 'master'
# * True master is now connection 'slave'
# * True slave is now connection 'master'
##############################################
connection master;
SELECT VARIABLE_NAME, GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME LIKE 'gtid_binlog_pos' OR VARIABLE_NAME LIKE 'gtid_slave_pos' OR VARIABLE_NAME LIKE 'gtid_current_pos' ORDER BY VARIABLE_NAME ASC;
@@ -389,8 +389,8 @@ GTID_CURRENT_POS 0-2-21,1-3-4,2-1-2,4-3-2
GTID_SLAVE_POS 0-2-21,1-3-4,2-1-2,4-3-2
##############################################
# Connection semantics change:
# * True primary is back to connection 'master'
# * True replica is back to connection 'slave'
# * True master is back to connection 'master'
# * True slave is back to connection 'slave'
##############################################
connection master;
connection slave;
@@ -416,8 +416,8 @@ include/sync_with_master_gtid.inc
include/rpl_change_master_demote.inc
##############################################
# Connection semantics change:
# * True primary is now connection 'slave'
# * True replica is now connection 'master'
# * True master is now connection 'slave'
# * True slave is now connection 'master'
##############################################
connection master;
SELECT VARIABLE_NAME, GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME LIKE 'gtid_binlog_pos' OR VARIABLE_NAME LIKE 'gtid_slave_pos' OR VARIABLE_NAME LIKE 'gtid_current_pos' ORDER BY VARIABLE_NAME ASC;
@@ -455,8 +455,8 @@ GTID_CURRENT_POS 0-2-24,1-3-4,2-1-3,3-1-2,4-3-2
GTID_SLAVE_POS 0-2-24,1-3-4,2-1-3,3-1-2,4-3-2
##############################################
# Connection semantics change:
# * True primary is back to connection 'master'
# * True replica is back to connection 'slave'
# * True master is back to connection 'master'
# * True slave is back to connection 'slave'
##############################################
connection master;
connection slave;
@@ -518,8 +518,8 @@ connection master;
include/rpl_change_master_demote.inc
##############################################
# Connection semantics change:
# * True primary is now connection 'slave'
# * True replica is now connection 'master'
# * True master is now connection 'slave'
# * True slave is now connection 'master'
##############################################
connection master;
SELECT VARIABLE_NAME, GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME LIKE 'gtid_binlog_pos' OR VARIABLE_NAME LIKE 'gtid_slave_pos' OR VARIABLE_NAME LIKE 'gtid_current_pos' ORDER BY VARIABLE_NAME ASC;
@@ -559,8 +559,8 @@ GTID_CURRENT_POS 0-2-29,1-3-4,2-1-3,3-1-2,4-3-2
GTID_SLAVE_POS 0-2-29,1-3-4,2-1-3,3-1-2,4-3-2
##############################################
# Connection semantics change:
# * True primary is back to connection 'master'
# * True replica is back to connection 'slave'
# * True master is back to connection 'master'
# * True slave is back to connection 'slave'
##############################################
connection master;
connection slave;
@@ -584,8 +584,8 @@ connection master;
include/rpl_change_master_demote.inc
##############################################
# Connection semantics change:
# * True primary is now connection 'slave'
# * True replica is now connection 'master'
# * True master is now connection 'slave'
# * True slave is now connection 'master'
##############################################
connection master;
SELECT VARIABLE_NAME, GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME LIKE 'gtid_binlog_pos' OR VARIABLE_NAME LIKE 'gtid_slave_pos' OR VARIABLE_NAME LIKE 'gtid_current_pos' ORDER BY VARIABLE_NAME ASC;
@@ -623,8 +623,8 @@ GTID_CURRENT_POS 0-2-32,1-3-4,2-1-3,3-1-2,4-3-2
GTID_SLAVE_POS 0-2-32,1-3-4,2-1-3,3-1-2,4-3-2
##############################################
# Connection semantics change:
# * True primary is back to connection 'master'
# * True replica is back to connection 'slave'
# * True master is back to connection 'master'
# * True slave is back to connection 'slave'
##############################################
connection master;
connection slave;
@@ -698,7 +698,7 @@ CHANGE MASTER TO master_use_gtid=Replica_Pos, master_demote_to_replica=1;
DROP TABLE t_mdev_31768;
RESET MASTER;
include/reset_slave.inc
# Clear primary binlog state to match replica
# Clear master binlog state to match slave
connection master;
RESET MASTER;
#

View File

@@ -1,7 +1,7 @@
include/master-slave.inc
[connection master]
#
# Set replica to ignore system tables
# Set slave to ignore system tables
connection slave;
include/stop_slave.inc
SET @@GLOBAL.replicate_wild_ignore_table="mysql.%";
@@ -17,7 +17,7 @@ CREATE USER 'testuser'@'localhost' IDENTIFIED by '';
DROP USER 'testuser'@'localhost', 'nonexistentuser'@'%';
ERROR HY000: Operation DROP USER failed for 'nonexistentuser'@'%'
#
# Ensure the events exist in the primary's binary log
# Ensure the events exist in the master's binary log
FLUSH BINARY LOGS;
# MYSQL_BINLOG MYSQLD_DATADIR/binlog_file > MYSQL_TMP_DIR/mysqlbinlog_out.sql
# There should be three Query events: REVOKE, CREATE USER, and DROP USER
@@ -26,7 +26,7 @@ FOUND 1 /REVOKE ALL PRIVILEGES/ in mysqlbinlog_out.sql
FOUND 1 /CREATE USER/ in mysqlbinlog_out.sql
FOUND 1 /DROP USER/ in mysqlbinlog_out.sql
#
# Ensure that the replica receives the event without error
# Ensure that the slave receives the event without error
connection slave;
Last_SQL_Error =
Last_SQL_Errno = 0

View File

@@ -1,13 +1,13 @@
include/master-slave.inc
[connection master]
#
# Set replica to ignore system mysql tables
# Set slave to ignore system mysql tables
connection slave;
include/stop_slave.inc
SET @@GLOBAL.replicate_wild_ignore_table="mysql.%";
include/start_slave.inc
#
# Execute grant-based commands on primary which modify mysql system
# Execute grant-based commands on master which modify mysql system
# tables
connection master;
CREATE ROLE journalist;
@@ -19,7 +19,7 @@ SET DEFAULT ROLE journalist for testuser@localhost;
SET PASSWORD for testuser@localhost= PASSWORD('123');
include/save_master_gtid.inc
#
# Verify primary's grant tables have the correct user/role data
# Verify master's grant tables have the correct user/role data
select count(*)=1 from mysql.user where User='testuser';
count(*)=1
1
@@ -27,14 +27,14 @@ select count(*)=1 from mysql.roles_mapping where User='testuser';
count(*)=1
1
#
# Ensure that the replica receives all of the primary's events without
# Ensure that the slave receives all of the master's events without
# error
connection slave;
include/sync_with_master_gtid.inc
Last_SQL_Error =
Last_SQL_Errno = 0
#
# Verify that the replica did not execute the master's commands
# Verify that the slave did not execute the master's commands
select count(*)=0 from mysql.user where User='testuser';
count(*)=0
1

View File

@@ -11,19 +11,19 @@ SET @@session.server_id= 3;
create table t2 (a int);
include/save_master_gtid.inc
#
# Have the replica "reconnect" and the primary will send Gtid, Glle, DDL
# Have the slave "reconnect" and the master will send Gtid, Glle, DDL
connection slave;
set global gtid_slave_pos="0-3-1";
include/start_slave.inc
include/sync_with_master_gtid.inc
#
# Ensure that the replica did not error
# Ensure that the slave did not error
connection slave;
include/sync_with_master_gtid.inc
Last_SQL_Error =
Last_SQL_Errno = 0
#
# Ensure that the primary sent a Glle after a Gtid event
# Ensure that the master sent a Glle after a Gtid event
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
slave-relay-bin.000002 # Rotate # # master-bin.000001;pos=POS
@@ -34,10 +34,10 @@ slave-relay-bin.000002 # Gtid # # GTID #-#-#
slave-relay-bin.000002 # Gtid_list # # [#-#-#]
slave-relay-bin.000002 # Query # # use `test`; create table t2 (a int)
#
# Ensure the DDL was executed on the replica
# Ensure the DDL was executed on the slave
#
# Cleanup
# t1 does not make it to the replica
# t1 does not make it to the slave
connection master;
set sql_log_bin=0;
DROP TABLE t1;

View File

@@ -12,7 +12,7 @@ connection slave;
include/start_slave.inc
#
#
# Test Case 1: Base case to ensure that mariadb-binlog and replica
# Test Case 1: Base case to ensure that mariadb-binlog and slave
# are consistent without any filtering
#
include/mysqlbinlog_slave_consistency.inc
@@ -71,7 +71,7 @@ connection master;
#
#
# Test Case 2: Ensure filtering by a single id in --do-domain-ids is
# consistent between mariadb-binlog and replica
# consistent between mariadb-binlog and slave
#
include/mysqlbinlog_slave_consistency.inc
connection slave;
@@ -122,7 +122,7 @@ connection master;
#
#
# Test Case 3: Ensure filtering by multiple ids in --do-domain-ids is
# consistent between mariadb-binlog and replica
# consistent between mariadb-binlog and slave
#
include/mysqlbinlog_slave_consistency.inc
connection slave;
@@ -178,7 +178,7 @@ connection slave;
connection master;
#
# Test Case 4: Ensure filtering by a single id in --ignore-domain-ids
# is consistent between mariadb-binlog and replica
# is consistent between mariadb-binlog and slave
#
include/mysqlbinlog_slave_consistency.inc
connection slave;
@@ -232,7 +232,7 @@ connection master;
#
#
# Test Case 5: Ensure filtering by multiple ids in --ignore-domain-ids
# is consistent between mariadb-binlog and replica
# is consistent between mariadb-binlog and slave
#
include/mysqlbinlog_slave_consistency.inc
connection slave;
@@ -279,7 +279,7 @@ connection slave;
connection master;
#
# Test Case 6: Ensure filtering by a single id in --ignore-server-ids
# is consistent between mariadb-binlog and replica
# is consistent between mariadb-binlog and slave
#
include/mysqlbinlog_slave_consistency.inc
connection slave;
@@ -330,7 +330,7 @@ connection master;
#
#
# Test Case 7: Ensure filtering by multiple ids in --ignore-server-ids
# is consistent between mariadb-binlog and replica
# is consistent between mariadb-binlog and slave
#
include/mysqlbinlog_slave_consistency.inc
connection slave;

View File

@@ -1,7 +1,7 @@
include/master-slave.inc
[connection master]
#
# MDEV-29639: Seconds_Behind_Master is incorrect for Delayed, Parallel Replicas
# MDEV-29639: Seconds_Behind_Master is incorrect for Delayed, Parallel Slaves
#
connection slave;
include/stop_slave.inc
@@ -55,7 +55,7 @@ connection slave;
include/sync_with_master_sql_delay_debug_sync.inc
set debug_sync= "now WAIT_FOR at_sql_delay";
set debug_sync= "now SIGNAL continue_sql_thread";
# Waiting for replica to get blocked by the table lock
# Waiting for slave to get blocked by the table lock
# Sleeping 1s to increment SBM
# Ensuring Seconds_Behind_Master increases after sleeping..
# ..done
@@ -99,7 +99,7 @@ include/start_slave.inc
# MDEV-30619: Parallel Slave SQL Thread Can Update Seconds_Behind_Master with Active Workers
#
connection slave;
# Ensure the replica is fully idle before starting transactions
# Ensure the slave is fully idle before starting transactions
# Lock t1 on slave so the first received transaction does not complete/commit
LOCK TABLES t1 WRITE;
connection master;

View File

@@ -15,7 +15,7 @@ create database test_replica;
SELECT @@GLOBAL.replicate_rewrite_db, 'primary_db1->replica_db1,x->y' as 'Replicate_Rewrite_DB from SHOW SLAVE STATUS';
@@GLOBAL.replicate_rewrite_db Replicate_Rewrite_DB from SHOW SLAVE STATUS
primary_db1->replica_db1,x->y primary_db1->replica_db1,x->y
# Create DBs and tables on primary
# Create DBs and tables on master
connection master;
create database primary_db1;
create database x;
@@ -26,7 +26,7 @@ use x;
create table my_table (t int);
insert into my_table values (654),(532);
include/save_master_gtid.inc
# Check replica
# Check slave
connection slave;
include/sync_with_master_gtid.inc
include/diff_tables.inc [master:primary_db1.my_table,slave:replica_db1.my_table]
@@ -48,7 +48,7 @@ select * from y.my_table;
t
654
532
# Set replica sys var replicate_rewrite_db
# Set slave sys var replicate_rewrite_db
connection slave;
SET @@GLOBAL.replicate_rewrite_db="test_master->test_replica";
ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first
@@ -65,14 +65,14 @@ include/start_slave.inc
SELECT @@GLOBAL.replicate_rewrite_db, 'test_master->test_replica' as 'Replicate_Rewrite_DB from SHOW SLAVE STATUS';
@@GLOBAL.replicate_rewrite_db Replicate_Rewrite_DB from SHOW SLAVE STATUS
test_master->test_replica test_master->test_replica
# Create DB and tables on primary
# Create DB and tables on master
connection master;
create database test_master;
use test_master;
create table my_table (t int);
insert into my_table values (1),(3);
include/save_master_gtid.inc
# Ensure that the replica receives all of the primary's events without
# Ensure that the slave receives all of the master's events without
# error
connection slave;
include/sync_with_master_gtid.inc
@@ -89,7 +89,7 @@ t
1
3
include/diff_tables.inc [master:test_master.my_table,slave:test_replica.my_table]
# Update of values on primary for DB not set in replication_rewrite_db
# Update of values on master for DB not set in replication_rewrite_db
include/stop_slave.inc
include/reset_slave.inc
connection master;

View File

@@ -18,7 +18,7 @@ set @old_dbug= @@global.debug_dbug;
set global rpl_semi_sync_slave_enabled= 1;
set global debug_dbug="+d,simulate_delay_semisync_slave_reply";
include/start_slave.inc
# Ensure primary recognizes both replicas are semi-sync
# Ensure master recognizes both slaves are semi-sync
connection server_1;
connection default;
create table t1 (a int);;

View File

@@ -5,7 +5,7 @@
# Note: Simulated master shutdown delay is hardcoded to 500 milliseconds
include/rpl_init.inc [topology=1->2, 1->3]
connection server_1;
# Slaves which simulate an error will produce a timeout on the primary
# Slaves which simulate an error will produce a timeout on the master
call mtr.add_suppression("Timeout waiting");
call mtr.add_suppression("did not exit");
call mtr.add_suppression("Got an error reading communication packets");
@@ -33,8 +33,8 @@ connect server_1_con2, localhost, root,,;
# Test cases
#############################
#
# Test Case 1) If both replicas simulate a delay that is within the
# allowed timeout, the primary should delay killing the Ack_thread
# Test Case 1) If both slaves simulate a delay that is within the
# allowed timeout, the master should delay killing the Ack_thread
# until an ACK is received.
#
connection server_1;
@@ -148,8 +148,8 @@ SELECT COUNT(*)=0 from t1;
COUNT(*)=0
1
#
# Test Case 2) If both replicas simulate an error before sending an ACK,
# the primary should delay killing the Ack_thread until the
# Test Case 2) If both slaves simulate an error before sending an ACK,
# the master should delay killing the Ack_thread until the
# timeout is reached.
#
connection server_1;
@@ -221,7 +221,7 @@ count(*)=0
1
#
#-- Re-synchronize slaves with master and disable semi-sync
#-- FIXME: workaround for MDEV-28141, preventing errored replicas from
#-- FIXME: workaround for MDEV-28141, preventing errored slaves from
# killing their semi-sync connections
connection server_2;
set debug_sync= "now wait_for at_semisync_kill_connection";
@@ -267,9 +267,9 @@ SELECT COUNT(*)=0 from t1;
COUNT(*)=0
1
#
# Test Case 3) If one replica simulates a delay within the allowed
# Test Case 3) If one slave simulates a delay within the allowed
# timeout and the other simulates an error before sending an ACK, the
# primary should delay killing the Ack_thread until it receives an
# master should delay killing the Ack_thread until it receives an
# ACK from the delayed slave.
#
connection server_1;
@@ -345,7 +345,7 @@ count(*)=1
1
#
#-- Re-synchronize slaves with master and disable semi-sync
#-- FIXME: workaround for MDEV-28141, preventing errored replicas from
#-- FIXME: workaround for MDEV-28141, preventing errored slaves from
# killing their semi-sync connections
connection server_2;
set debug_sync= "now wait_for at_semisync_kill_connection";
@@ -386,13 +386,13 @@ SELECT COUNT(*)=0 from t1;
COUNT(*)=0
1
#
# Test Case 4) If a replica errors before sending an ACK, it will cause
# Test Case 4) If a slave errors before sending an ACK, it will cause
# the IO thread to stop and handle the error. During error handling, if
# semi-sync is active, the replica will form a new connection with the
# primary to kill the active connection. However, if the primary is
# semi-sync is active, the slave will form a new connection with the
# master to kill the active connection. However, if the master is
# shutting down, it may kill the new connection, thereby leaving the
# active semi-sync connection in-tact. The slave should notice this, and
# not issue a `QUIT` command to the primary, which would otherwise be
# not issue a `QUIT` command to the master, which would otherwise be
# sent to kill an active connection. This test case validates that the
# slave does not send a `QUIT` in this case.
#
@@ -469,7 +469,7 @@ count(*)=1
1
#
#-- Re-synchronize slaves with master and disable semi-sync
#-- FIXME: workaround for MDEV-28141, preventing errored replicas from
#-- FIXME: workaround for MDEV-28141, preventing errored slaves from
# killing their semi-sync connections
connection server_2;
set debug_sync= "now wait_for at_semisync_kill_connection";
@@ -511,8 +511,8 @@ COUNT(*)=0
1
#
# Test Case 5) If a waiting-for-ACK user thread is killed (disconnected)
# during SHUTDOWN WAIT FOR ALL SLAVES, ensure the primary will still
# await the ACK from the replica before killing the Ack_receiver thread
# during SHUTDOWN WAIT FOR ALL SLAVES, ensure the master will still
# await the ACK from the slave before killing the Ack_receiver thread
#
connection server_1;
insert into t1 values (1);

View File

@@ -30,23 +30,23 @@ Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No'
include/start_slave.inc
# Clear SHOW WARNINGS
#
# If the primary does not support GTIDs (version < 10), the replica
# If the master does not support GTIDs (version < 10), the slave
# should fall back to Using_Gtid=No on slave start, and should not
# revert Using_Gtid to Slave_Pos after RESET SLAVE
include/stop_slave.inc
RESET SLAVE ALL;
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=1;
SET @saved_dbug= @@GLOBAL.debug_dbug;
set @@global.debug_dbug= "d,mock_mariadb_primary_v5_in_get_master_version";
set @@global.debug_dbug= "d,mock_mariadb_master_v5_in_get_master_version";
include/start_slave.inc
# Replica should detect at start that the primary does not support GTIDs
# Slave should detect at start that the master does not support GTIDs
# and fall-back to Using_Gtid=No
# Replica should have an informational message stating it is falling
# Slave should have an informational message stating it is falling
# back to Using_Gtid=No
FOUND 1 /Falling back to Using_Gtid=No because master does not support GTIDs/ in mysqld.2.err
include/stop_slave.inc
RESET SLAVE;
# Replica should know that the primary does not support GTIDs and
# Slave should know that the master does not support GTIDs and
# preserve Using_Gtid=No
# 'No' was not reverted and therefore no note should be added
SHOW WARNINGS;
@@ -111,7 +111,7 @@ include/reset_slave.inc
set global gtid_slave_pos="old_slave_pos";
include/start_slave.inc
#
# A replica issued CHANGE MASTER TO specified with log coordinates but
# A slave issued CHANGE MASTER TO specified with log coordinates but
# not master_use_gtid=no should warn the user that Using_Gtid is being
# changed to No.
#
@@ -125,7 +125,7 @@ Warnings:
Note 4190 CHANGE MASTER TO is implicitly changing the value of 'Using_Gtid' from 'Slave_Pos' to 'No'
include/start_slave.inc
#
# A replica issued CHANGE MASTER TO specified with log coordinates and
# A slave issued CHANGE MASTER TO specified with log coordinates and
# master_use_gtid=Slave_Pos should warn the user that the log
# coordinates will be ignored.
#

View File

@@ -4,8 +4,8 @@
--source include/master-slave.inc
--echo #
--echo # MDEV-33957 UPDATE fails on replica replicating blob virtual column in
--echo # NOBLOB mode when replica logging is off
--echo # MDEV-33957 UPDATE fails on slave replicating blob virtual column in
--echo # NOBLOB mode when slave logging is off
--echo #
--connection slave

View File

@@ -503,7 +503,7 @@ DROP TABLE t_mdev_31768;
RESET MASTER;
--source include/reset_slave.inc
--echo # Clear primary binlog state to match replica
--echo # Clear master binlog state to match slave
--connection master
RESET MASTER;

View File

@@ -1,8 +1,8 @@
#
# Purpose:
# This test ensures that issuing a CHANGE MASTER will not put a replica into
# This test ensures that issuing a CHANGE MASTER will not put a slave into
# an inconsistent state if the slave cannot find the log files (i.e. the call to
# find_log_pos in reset_logs fails). More specifically, right before a replica
# find_log_pos in reset_logs fails). More specifically, right before a slave
# purges the relay logs (part of the `CHANGE MASTER TO` logic), the relay log is
# temporarily closed with state LOG_TO_BE_OPENED. If the server is issued a
# CHANGE MASTER and it errors in-between the temporary log closure and purge,
@@ -59,7 +59,7 @@ insert into t1 values (1);
--connection slave
if ($master_checksum != `CHECKSUM TABLE t1`)
{
die("Replica failed to pull data from primary after failed CHANGE MASTER TO");
die("Slave failed to pull data from master after failed CHANGE MASTER TO");
}

View File

@@ -1,5 +1,5 @@
#
# Verify that SHOW SLAVE STATUS will not cause deadlocks on the replica.
# Verify that SHOW SLAVE STATUS will not cause deadlocks on the slave.
# A deadlock has been seen in do_gco_wait if the thread is killed, as it will
# hold the LOCK_parallel_entry, and during error reporting, try to grab the
# err_lock. Prior to MDEV-10653, SHOW SLAVE STATUS would grab these locks in

View File

@@ -199,7 +199,7 @@ COMMIT; # IO thread gets killed here.
# MDEV-14357
# As the prior transaction will be ignored on slave because its domain id is
# ignored, the replica's gtid_slave_pos will be updated to have seen it,
# ignored, the slave's gtid_slave_pos will be updated to have seen it,
# despite its eventual failure to queue the whole transaction to the relay log.
# So for test consistency, we need to synchronize the SQL thread with this
# position; otherwise, when restarting the server after resetting

View File

@@ -1,20 +1,20 @@
#
# Purpose:
# This test ensures that a binlogged Query_log_event which failed on the
# primary server does not break replication if it is ignored by Grant_tables
# on the replica. The bug reported by MDEV-28530 shows this with
# REVOKE ALL PRIVILEGES.. using a non-existent user. The primary will binlog
# the REVOKE command with an error code, and the replica will think the command
# master server does not break replication if it is ignored by Grant_tables
# on the slave. The bug reported by MDEV-28530 shows this with
# REVOKE ALL PRIVILEGES.. using a non-existent user. The master will binlog
# the REVOKE command with an error code, and the slave will think the command
# executed with success because the replication filter will ignore the command
# while accessing the Grant_tables classes. When the replica performs an error
# while accessing the Grant_tables classes. When the slave performs an error
# check, it sees the difference between the error codes, and replication
# breaks.
#
# Methodology:
# Using a replica configured with replicate_wild_ignore_table="schema.%",
# on the primary, execute REVOKE ALL PRVILEGES using a non-existent user and
# Using a slave configured with replicate_wild_ignore_table="schema.%",
# on the master, execute REVOKE ALL PRVILEGES using a non-existent user and
# DROP USER using a list of users where not all users exist, and ensure that
# the replica acknowledges and ignores the events without erroring.
# the slave acknowledges and ignores the events without erroring.
#
# References:
# MDEV-28530: Revoking privileges from a non-existing user on a master breaks
@@ -25,7 +25,7 @@ source include/master-slave.inc;
source include/have_binlog_format_statement.inc;
--echo #
--echo # Set replica to ignore system tables
--echo # Set slave to ignore system tables
connection slave;
let $old_filter= query_get_value(SHOW SLAVE STATUS, Replicate_Wild_Ignore_Table, 1);
source include/stop_slave.inc;
@@ -49,7 +49,7 @@ DROP USER 'testuser'@'localhost', 'nonexistentuser'@'%';
--echo #
--echo # Ensure the events exist in the primary's binary log
--echo # Ensure the events exist in the master's binary log
--let $MYSQLD_DATADIR= `select @@datadir`
--let $binlog_file=query_get_value(SHOW MASTER STATUS, File, 1)
FLUSH BINARY LOGS;
@@ -73,7 +73,7 @@ FLUSH BINARY LOGS;
--echo #
--echo # Ensure that the replica receives the event without error
--echo # Ensure that the slave receives the event without error
connection slave;
--sync_with_master
let $error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);

View File

@@ -1,18 +1,18 @@
#
# Purpose:
# This test ensures that the SET DEFAULT ROLE and SET PASSWORD commands can
# be ignored by replica filter rules. MDEV-28294 exposed a bug in which
# be ignored by slave filter rules. MDEV-28294 exposed a bug in which
# SET DEFAULT ROLE would check for the existence of the given roles/user even
# when the targeted tables are ignored, resulting in errors if the targeted
# data does not exist. More specifically, when previously issued
# CREATE USER/ROLE commands are ignored by the replica because of the
# CREATE USER/ROLE commands are ignored by the slave because of the
# replication filtering rules, SET DEFAULT ROLE would result in an error
# because the targeted data does not exist.
#
# Methodology:
# Using a replica configured with replicate_wild_ignore_table="mysql.%",
# execute SET DEFAULT ROLE and SET PASSWORD on the primary and ensure that the
# replica neither errors nor executes the commands which the primary sends.
# Using a slave configured with replicate_wild_ignore_table="mysql.%",
# execute SET DEFAULT ROLE and SET PASSWORD on the master and ensure that the
# slave neither errors nor executes the commands which the master sends.
#
# References:
# MDEV-28294: set default role bypasses Replicate_Wild_Ignore_Table: mysql.%
@@ -22,7 +22,7 @@ source include/master-slave.inc;
source include/have_binlog_format_mixed.inc;
--echo #
--echo # Set replica to ignore system mysql tables
--echo # Set slave to ignore system mysql tables
connection slave;
let $old_filter= query_get_value(SHOW SLAVE STATUS, Replicate_Wild_Ignore_Table, 1);
source include/stop_slave.inc;
@@ -30,7 +30,7 @@ SET @@GLOBAL.replicate_wild_ignore_table="mysql.%";
source include/start_slave.inc;
--echo #
--echo # Execute grant-based commands on primary which modify mysql system
--echo # Execute grant-based commands on master which modify mysql system
--echo # tables
connection master;
CREATE ROLE journalist;
@@ -44,12 +44,12 @@ SET PASSWORD for testuser@localhost= PASSWORD('123');
--source include/save_master_gtid.inc
--echo #
--echo # Verify primary's grant tables have the correct user/role data
--echo # Verify master's grant tables have the correct user/role data
select count(*)=1 from mysql.user where User='testuser';
select count(*)=1 from mysql.roles_mapping where User='testuser';
--echo #
--echo # Ensure that the replica receives all of the primary's events without
--echo # Ensure that the slave receives all of the master's events without
--echo # error
connection slave;
--source include/sync_with_master_gtid.inc
@@ -59,7 +59,7 @@ let $errno= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
--echo Last_SQL_Errno = $errno
--echo #
--echo # Verify that the replica did not execute the master's commands
--echo # Verify that the slave did not execute the master's commands
select count(*)=0 from mysql.user where User='testuser';
select count(*)=0 from mysql.roles_mapping where User='testuser';

View File

@@ -5,8 +5,8 @@
# a Glle would terminate the event and upon reconnect, the DDL would be lost.
#
# Methodology:
# Force the primary to send a fake GLLE event after a GTID on a "reconnect"
# and ensure that both 1) the replica does not error, and 2) the original
# Force the master to send a fake GLLE event after a GTID on a "reconnect"
# and ensure that both 1) the slave does not error, and 2) the original
# command within the GTID is executed.
#
# References:
@@ -30,14 +30,14 @@ create table t2 (a int);
--source include/save_master_gtid.inc
--echo #
--echo # Have the replica "reconnect" and the primary will send Gtid, Glle, DDL
--echo # Have the slave "reconnect" and the master will send Gtid, Glle, DDL
--connection slave
eval set global gtid_slave_pos="0-3-1";
--source include/start_slave.inc
--source include/sync_with_master_gtid.inc
--echo #
--echo # Ensure that the replica did not error
--echo # Ensure that the slave did not error
connection slave;
--source include/sync_with_master_gtid.inc
let $error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
@@ -46,14 +46,14 @@ let $errno= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
--echo Last_SQL_Errno = $errno
--echo #
--echo # Ensure that the primary sent a Glle after a Gtid event
--echo # Ensure that the master sent a Glle after a Gtid event
let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1);
let $binlog_start= $relaylog_start;
let $binlog_limit=0,10;
--source include/show_relaylog_events.inc
--echo #
--echo # Ensure the DDL was executed on the replica
--echo # Ensure the DDL was executed on the slave
if (!`SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'test' AND table_name = 't2'`)
{
die "t2 should exist on slave";
@@ -62,7 +62,7 @@ if (!`SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'test'
--echo #
--echo # Cleanup
--echo # t1 does not make it to the replica
--echo # t1 does not make it to the slave
--connection master
set sql_log_bin=0;
DROP TABLE t1;

View File

@@ -1,6 +1,6 @@
#
# This test ensures that, when a GTID event is constructed by reading its
# content from a binlog file, the reader (e.g. replica, in this test) cannot
# content from a binlog file, the reader (e.g. slave, in this test) cannot
# read beyond the length of the GTID event. That is, we ensure that the
# structure indicated by its flags and extra_flags are consistent with the
# actual content of the event.

View File

@@ -14,7 +14,7 @@
#
#
# References:
# MDEV-29881: Replica stops with "Found invalid event in binary log"
# MDEV-29881: Slave stops with "Found invalid event in binary log"
#
--source include/have_debug.inc
--source include/have_debug_sync.inc

View File

@@ -33,7 +33,7 @@ create temporary table t2 like t1;
# read the values from the master table
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
eval load data local infile '$MYSQLD_DATADIR/test/rpl_misc_functions.outfile' into table t2;
# compare them with the replica; the SELECT below should return no row
# compare them with the slave; the SELECT below should return no row
select * from t1, t2 where (t1.id=t2.id) and not(t1.i=t2.i and t1.r1=t2.r1 and t1.r2=t2.r2 and t1.p=t2.p);
connection master;

View File

@@ -3,29 +3,29 @@
#
# This test ensures the mariadb-binlog command line tool filters events
# by domain id (via --do-domain-ids and --ignore-domain-ids) and server id (via
# --ignore-server-ids) in the same way that a replica server does.
# --ignore-server-ids) in the same way that a slave server does.
#
#
# Methodology:
#
# This test validates that the domain and server id filtering logic of
# mariadb-binlog matches that of a replica server. In particular, it validates
# mariadb-binlog matches that of a slave server. In particular, it validates
# a mariadb-binlog replay of a master's binary log is consistent with a
# replica's state which is configured using the same filtering configuration.
# slave's state which is configured using the same filtering configuration.
#
# It uses a repeatable process to allow for multiple test cases that span
# different filtering configurations. First, a master is seeded with an initial
# set of SQL statements with varying domain and server ids. Then, a set of
# filtering parameters supported by both mariadb-binlog and replica
# capabilities are defined. The replica is configured using these parameters
# and run it until it has processed all events from the primary server; it is
# filtering parameters supported by both mariadb-binlog and slave
# capabilities are defined. The slave is configured using these parameters
# and run it until it has processed all events from the master server; it is
# stopped afterward. For mariadb-binlog validation, the binary log of the
# primary server is copied to a different location for later replay. The
# primary is then reset to its initial state (i.e. the tables are dropped and
# master server is copied to a different location for later replay. The
# master is then reset to its initial state (i.e. the tables are dropped and
# the logs are reset). The mariadb-binlog tool is then used to replay the
# copied binary log file back onto the clean primary server under the same
# filtering conditions as the replica. At this point, the data on the primary
# and replica should be exactly the same because the filtering conditions were
# copied binary log file back onto the clean master server under the same
# filtering conditions as the slave. At this point, the data on the master
# and slave should be exactly the same because the filtering conditions were
# the same, and all existing tables on both servers are compared using.
# checksums.
#
@@ -61,7 +61,7 @@ let $ORIG_SERVER_ID = `select @@session.server_id`;
--echo #
--echo #
--echo # Test Case 1: Base case to ensure that mariadb-binlog and replica
--echo # Test Case 1: Base case to ensure that mariadb-binlog and slave
--echo # are consistent without any filtering
--echo #
--let $do_domain_ids=
@@ -74,7 +74,7 @@ let $ORIG_SERVER_ID = `select @@session.server_id`;
--echo #
--echo #
--echo # Test Case 2: Ensure filtering by a single id in --do-domain-ids is
--echo # consistent between mariadb-binlog and replica
--echo # consistent between mariadb-binlog and slave
--echo #
--let $do_domain_ids=0
--let $ignore_domain_ids=
@@ -86,7 +86,7 @@ let $ORIG_SERVER_ID = `select @@session.server_id`;
--echo #
--echo #
--echo # Test Case 3: Ensure filtering by multiple ids in --do-domain-ids is
--echo # consistent between mariadb-binlog and replica
--echo # consistent between mariadb-binlog and slave
--echo #
--let $do_domain_ids=0,1
--let $ignore_domain_ids=
@@ -97,7 +97,7 @@ let $ORIG_SERVER_ID = `select @@session.server_id`;
--echo #
--echo # Test Case 4: Ensure filtering by a single id in --ignore-domain-ids
--echo # is consistent between mariadb-binlog and replica
--echo # is consistent between mariadb-binlog and slave
--echo #
--let $do_domain_ids=
--let $ignore_domain_ids=0
@@ -109,7 +109,7 @@ let $ORIG_SERVER_ID = `select @@session.server_id`;
--echo #
--echo #
--echo # Test Case 5: Ensure filtering by multiple ids in --ignore-domain-ids
--echo # is consistent between mariadb-binlog and replica
--echo # is consistent between mariadb-binlog and slave
--echo #
--let $do_domain_ids=
--let $ignore_domain_ids=0,1
@@ -120,7 +120,7 @@ let $ORIG_SERVER_ID = `select @@session.server_id`;
--echo #
--echo # Test Case 6: Ensure filtering by a single id in --ignore-server-ids
--echo # is consistent between mariadb-binlog and replica
--echo # is consistent between mariadb-binlog and slave
--echo #
--let $do_domain_ids=
--let $ignore_domain_ids=
@@ -132,7 +132,7 @@ let $ORIG_SERVER_ID = `select @@session.server_id`;
--echo #
--echo #
--echo # Test Case 7: Ensure filtering by multiple ids in --ignore-server-ids
--echo # is consistent between mariadb-binlog and replica
--echo # is consistent between mariadb-binlog and slave
--echo #
--let $do_domain_ids=
--let $ignore_domain_ids=

View File

@@ -1,5 +1,5 @@
#
# Ensure that Seconds_Behind_Master works correctly on the parallel replica.
# Ensure that Seconds_Behind_Master works correctly on the parallel slave.
#
--source include/have_log_bin.inc
--source include/have_debug.inc
@@ -7,7 +7,7 @@
--source include/master-slave.inc
--echo #
--echo # MDEV-29639: Seconds_Behind_Master is incorrect for Delayed, Parallel Replicas
--echo # MDEV-29639: Seconds_Behind_Master is incorrect for Delayed, Parallel Slaves
--echo #
# This test ensures that after a delayed parallel slave has idled, i.e.
@@ -108,7 +108,7 @@ LOCK TABLES t1 WRITE;
--let $slave_sync_method= none
--source include/sync_with_master_sql_delay_debug_sync.inc
--echo # Waiting for replica to get blocked by the table lock
--echo # Waiting for slave to get blocked by the table lock
--let $wait_condition= SELECT count(*) FROM information_schema.processlist WHERE state LIKE 'Waiting for table metadata lock';
--source include/wait_condition.inc
@@ -196,12 +196,12 @@ set @@GLOBAL.debug_dbug= "-d,sql_delay_by_debug_sync";
# This test ensures that a parallel slave will not update
# Seconds_Behind_Master after the SQL Thread has idled if the worker threads
# are still executing events. To test this, two events are executed on the
# primary with $sleep seconds in-between them. Once the second event begins
# execution on the replica, Seconds_Behind_Master is queried to ensure it
# master with $sleep seconds in-between them. Once the second event begins
# execution on the slave, Seconds_Behind_Master is queried to ensure it
# reflects the value of the first transaction, rather than the second.
--connection slave
--echo # Ensure the replica is fully idle before starting transactions
--echo # Ensure the slave is fully idle before starting transactions
--let $wait_condition= SELECT count(*) FROM information_schema.processlist WHERE state LIKE 'Slave has read all relay log%';
--source include/wait_condition.inc
--let $wait_condition= SELECT count(*)=2 FROM information_schema.processlist WHERE state LIKE 'Waiting for work from SQL thread';

View File

@@ -22,7 +22,7 @@ create database test_replica;
let $rewrite_db_sss= query_get_value(SHOW SLAVE STATUS, Replicate_Rewrite_DB, 1);
eval SELECT @@GLOBAL.replicate_rewrite_db, '$rewrite_db_sss' as 'Replicate_Rewrite_DB from SHOW SLAVE STATUS';
--echo # Create DBs and tables on primary
--echo # Create DBs and tables on master
connection master;
--enable_warnings
create database primary_db1;
@@ -35,7 +35,7 @@ create table my_table (t int);
insert into my_table values (654),(532);
--source include/save_master_gtid.inc
--echo # Check replica
--echo # Check slave
--connection slave
--source include/sync_with_master_gtid.inc
--let $diff_tables=master:primary_db1.my_table,slave:replica_db1.my_table
@@ -48,7 +48,7 @@ select * from replica_db1.my_table;
show tables from y;
select * from y.my_table;
--echo # Set replica sys var replicate_rewrite_db
--echo # Set slave sys var replicate_rewrite_db
connection slave;
--error ER_SLAVE_MUST_STOP
SET @@GLOBAL.replicate_rewrite_db="test_master->test_replica";
@@ -61,7 +61,7 @@ source include/start_slave.inc;
let $rewrite_db_sss= query_get_value(SHOW SLAVE STATUS, Replicate_Rewrite_DB, 1);
eval SELECT @@GLOBAL.replicate_rewrite_db, '$rewrite_db_sss' as 'Replicate_Rewrite_DB from SHOW SLAVE STATUS';
--echo # Create DB and tables on primary
--echo # Create DB and tables on master
connection master;
--enable_warnings
create database test_master;
@@ -70,7 +70,7 @@ create table my_table (t int);
insert into my_table values (1),(3);
--source include/save_master_gtid.inc
--echo # Ensure that the replica receives all of the primary's events without
--echo # Ensure that the slave receives all of the master's events without
--echo # error
--connection slave
--source include/sync_with_master_gtid.inc
@@ -87,7 +87,7 @@ select * from test_replica.my_table;
--let $diff_tables=master:test_master.my_table,slave:test_replica.my_table
--source include/diff_tables.inc
--echo # Update of values on primary for DB not set in replication_rewrite_db
--echo # Update of values on master for DB not set in replication_rewrite_db
--source include/stop_slave.inc
--source include/reset_slave.inc
@@ -128,7 +128,7 @@ connection slave;
--source include/start_slave.inc
SELECT @@GLOBAL.replicate_rewrite_db;
--source include/sync_with_master_gtid.inc
# This should update values with 314 and 1000 from primary
# This should update values with 314 and 1000 from master
select * from y.my_table;
--echo # Cleanup

View File

@@ -16,7 +16,7 @@
# Specifically, mysqlbinlog is used in verbose mode so it outputs the columns
# which belong to the event, and the columns are analyzed to ensure the correct
# ones were logged. rpl_row_img_general_loop.inc is used to test with multiple
# chained replicas, varying engines between InnoDB and MyISAM.
# chained slaves, varying engines between InnoDB and MyISAM.
#
# References:
# MDEV-28487: sequences not respect value of binlog_row_image with select

View File

@@ -16,7 +16,7 @@
# Specifically, mysqlbinlog is used in verbose mode so it outputs the columns
# which belong to the event, and the columns are analyzed to ensure the correct
# ones were logged. rpl_row_img_general_loop.inc is used to test with multiple
# chained replicas, varying engines between InnoDB and MyISAM.
# chained slaves, varying engines between InnoDB and MyISAM.
#
# References:
# MDEV-28487: sequences not respect value of binlog_row_image with select

View File

@@ -16,7 +16,7 @@
# Specifically, mysqlbinlog is used in verbose mode so it outputs the columns
# which belong to the event, and the columns are analyzed to ensure the correct
# ones were logged. rpl_row_img_general_loop.inc is used to test with multiple
# chained replicas, varying engines between InnoDB and MyISAM.
# chained slaves, varying engines between InnoDB and MyISAM.
#
# References:
# MDEV-28487: sequences not respect value of binlog_row_image with select

View File

@@ -19,7 +19,7 @@
# References:
# MDEV-16091: Seconds_Behind_Master spikes to millions of seconds
# MDEV-25999: Unrealistic "Seconds behind master" value
# MDEV-36840: Seconds_Behind_Master Spike at Log Rotation on Parallel Replica
# MDEV-36840: Seconds_Behind_Master Spike at Log Rotation on Parallel Slave
#
--source include/have_debug.inc
--source include/have_debug_sync.inc
@@ -130,7 +130,7 @@ while (!$caught_up)
# Wait 30s
if (`SELECT $tries > 300`)
{
--die Replica failed to sync with primary
--die Slave failed to sync with master
}
sleep 0.1;
}
@@ -169,7 +169,7 @@ while (!$caught_up)
# Wait 30s
if (`SELECT $tries > 300`)
{
--die Replica failed to sync with primary
--die Slave failed to sync with master
}
sleep 0.1;
}

View File

@@ -2,7 +2,7 @@
# This test ensures that a race condition (reported in MDEV-35109) which
# could cause semi-sync transactions binlogging through MYSQL_BIN_LOG::write()
# to hang until the semi-sync timeout has been hit, despite the ACK actually
# having been received. The problem was that, for a primary configured with
# having been received. The problem was that, for a master configured with
# wait_point=AFTER_SYNC, if two threads T1 (binlogging through
# MYSQL_BIN_LOG::write()) and T2 were binlogging at the same time, T1 could
# accidentally wait for the binlog coordinates of T2. Prior to MDEV-33551,
@@ -37,7 +37,7 @@
# through binlog group commit. We use debug_sync to stop both T1 and T2
# after binlogging, reporting their coordinates to the semi-sync cache (i.e.
# after report_binlog_update()), and after releasing LOCK_log. Debug_sync is
# used on the replica to ensure no ACKs are sent until after both T1 and T2
# used on the slave to ensure no ACKs are sent until after both T1 and T2
# are paused. Then, T1 and T2 are signaled for wakeup, and both ACKs are sent.
# Prior to MDEV-35109 fixes, this results in T1 timing out after the configured
# 2 second timeout.
@@ -45,7 +45,7 @@
# References:
# MDEV-33551: Semi-sync Wait Point AFTER_COMMIT Slow on Workloads with Heavy
# Concurrency
# MDEV-35109: Semi-sync Replication stalling Primary using
# MDEV-35109: Semi-sync Replication stalling Master using
# wait_point=AFTER_SYNC
#

View File

@@ -1,18 +1,18 @@
#
# This test ensures that a primary will listen for ACKs by newly added
# This test ensures that a master will listen for ACKs by newly added
# semi-sync connections connections, after a pre-existing connection is already
# established. MDEV-32960 reported that the newly added slave's ACK can be
# ignored if listen_on_sockets() does not timeout before
# rpl_semi_sync_master_timeout, and if the existing semi-sync connections fail
# to send ACKs, semi-sync is switched off.
#
# This test ensures this in a two-replica setup with a semi-sync timeout of
# 500ms, and delaying the ACK reply of the first-established replica by 800ms
# to force a timeout, and allowing the second replica to immediately ACK.
# This test ensures this in a two-slave setup with a semi-sync timeout of
# 500ms, and delaying the ACK reply of the first-established slave by 800ms
# to force a timeout, and allowing the second slave to immediately ACK.
#
# References:
# MDEV-32960: Semi-sync ACKed Transaction can Timeout and Switch Off
# Semi-sync with Multiple Replicas
# Semi-sync with Multiple Slaves
#
--source include/have_debug.inc
# binlog_format independent
@@ -44,7 +44,7 @@ set global rpl_semi_sync_slave_enabled= 1;
set global debug_dbug="+d,simulate_delay_semisync_slave_reply";
--source include/start_slave.inc
--echo # Ensure primary recognizes both replicas are semi-sync
--echo # Ensure master recognizes both slaves are semi-sync
--connection server_1
--let $status_var_value= 2
--let $status_var= rpl_semi_sync_master_clients
@@ -81,7 +81,7 @@ set debug_sync= "now signal io_thd_do_reply";
if (`SELECT $slave1_sent_ack`)
{
SHOW STATUS LIKE 'rpl_semi_sync_slave_send_ack';
--die server_2 should not have sent semi-sync ACK to primary
--die server_2 should not have sent semi-sync ACK to master
}
--connection server_3
@@ -94,7 +94,7 @@ if (`SELECT $slave1_sent_ack`)
if (`SELECT NOT $slave2_sent_ack`)
{
SHOW STATUS LIKE 'rpl_semi_sync_slave_send_ack';
--die server_3 should have sent semi-sync ACK to primary
--die server_3 should have sent semi-sync ACK to master
}
--connection server_1
@@ -112,7 +112,7 @@ if (`SELECT $cur_master_yes_tx != ($init_master_yes_tx + 1)`)
{
--echo # Initial yes_tx: $init_master_yes_tx
--echo # Current yes_tx: $cur_master_yes_tx
--die rpl_semi_sync_master_yes_tx should have been incremented by primary
--die rpl_semi_sync_master_yes_tx should have been incremented by master
}
--connection server_2

View File

@@ -1,17 +1,17 @@
#
# Helper file to ensure that a primary waits for all ACKS (or timeout) from its
# replicas before shutting down.
# Helper file to ensure that a master waits for all ACKS (or timeout) from its
# slaves before shutting down.
#
# Parameters:
# server_2_dbug (string) Debug setting to simulate delay or error on
# the first replica (server 2)
# the first slave (server 2)
# server_3_dbug (string) Debug setting to simulate delay or error on
# the second replica (server 3)
# the second slave (server 3)
# semisync_timeout (int) Rpl_semi_sync_master_timeout to use
# server_2_expect_row_count (int) The number of rows expected on the first
# replica after the shutdown
# slave after the shutdown
# server_3_expect_row_count (int) The number of rows expected on the second
# replica after the shutdown
# slave after the shutdown
# server_2_sync_slave_reply (bool) True if server_2_dbug is configured to use
# debug_sync to synchronize the slave reply
# (i.e. to pause before the reply)
@@ -160,15 +160,15 @@ if (`SELECT $server_3_sync_slave_reply AND NOT $server_3_expect_row_count`)
if (`SELECT ($server_2_expect_row_count + $server_3_expect_row_count) < 2`)
{
--echo #-- FIXME: workaround for MDEV-28141, preventing errored replicas from
--echo #-- FIXME: workaround for MDEV-28141, preventing errored slaves from
--echo # killing their semi-sync connections
# I.e. we can't create a new kill connection to the primary if we know that the
# primary is shutting down for risk of Packets out of order error. So we wait
# I.e. we can't create a new kill connection to the master if we know that the
# master is shutting down for risk of Packets out of order error. So we wait
# to hit a debug_sync point before the creation of the new kill_connection, and
# don't progress until the primary has been shutdown, so no new connection can
# don't progress until the master has been shutdown, so no new connection can
# be formed.
# Note this is only needed in the error case (using corrupt_queue_event), as
# the running io_thread will otherwise automatically detect that the primary
# the running io_thread will otherwise automatically detect that the master
# has shutdown before progressing to the cleanup of the io thread.
}
@@ -196,7 +196,7 @@ if (!$server_3_expect_row_count)
--echo #-- Stop slaves
--connection server_2
# If server_2_expect_row_count is 0, we are simulating an error on the replica
# If server_2_expect_row_count is 0, we are simulating an error on the slave
# and the IO thread will end with errno 1595.
# Otherwise, we still expect error, because the master has shutdown at this
# point, and the IO thread may or may not have realized the shutdown, and

View File

@@ -2,44 +2,44 @@
#
# Purpose:
# This test validates that data is consistent between a primary and replica
# in semi-sync mode when the primary is issued `SHUTDOWN WAIT FOR SLAVES`
# during an active communication. More specifically, the primary should not
# kill the Ack_thread until it is sure a replica has received all binlog
# data, i.e. once the primary receives the ACK. If a primary is issued a
# This test validates that data is consistent between a master and slave
# in semi-sync mode when the master is issued `SHUTDOWN WAIT FOR SLAVES`
# during an active communication. More specifically, the master should not
# kill the Ack_thread until it is sure a slave has received all binlog
# data, i.e. once the master receives the ACK. If a master is issued a
# shutdown before receiving an ACK, it should wait until either 1) the ACK is
# received, or 2) the configured timeout (rpl_semi_sync_master_timeout) is
# reached.
#
# Methodology:
# Using a topology consisting of one primary with two replicas, all in
# Using a topology consisting of one master with two slaves, all in
# semi-sync mode, we use DEBUG_DBUG to simulate an error or delay on the
# replicas during an active communication while the primary is issued
# slaves during an active communication while the master is issued
# `SHUTDOWN WAIT FOR SLAVES`. We create four test cases to ensure the
# Ack_thread is not prematurely killed due to the shutdown.
# Test Case 1) If both replicas simulate a delay that is within the allowed
# timeout, the primary should delay killing the Ack_thread
# Test Case 1) If both slaves simulate a delay that is within the allowed
# timeout, the master should delay killing the Ack_thread
# until an ACK is received.
# Test Case 2) If both replicas simulate an error before sending an ACK, the
# primary should delay killing the Ack_thread until the
# Test Case 2) If both slaves simulate an error before sending an ACK, the
# master should delay killing the Ack_thread until the
# the timeout is reached.
# Test Case 3) If one replica simulates a delay within the allowed timeout
# Test Case 3) If one slave simulates a delay within the allowed timeout
# and the other simulates an error before sending an ACK, the
# primary should delay killing the Ack_thread until it
# master should delay killing the Ack_thread until it
# receives an ACK from the delayed slave.
# Test Case 4) If a replica errors before sending an ACK, it will cause the
# Test Case 4) If a slave errors before sending an ACK, it will cause the
# IO thread to stop and handle the error. During error handling,
# if semi-sync is active, the replica will form a new connection
# with the primary to kill the active connection. However, if
# the primary is shutting down, it may kill the new connection,
# if semi-sync is active, the slave will form a new connection
# with the master to kill the active connection. However, if
# the master is shutting down, it may kill the new connection,
# thereby leaving the active semi-sync connection in-tact. The
# slave should notice this, and not issue a `QUIT` command to
# the primary, which would otherwise be sent to kill an active
# the master, which would otherwise be sent to kill an active
# connection. This test case validates that the slave does not
# send a `QUIT` in this case.
# Test Case 5) If a waiting-for-ACK user thread is killed (disconnected)
# during SHUTDOWN WAIT FOR ALL SLAVES, ensure the primary will
# still await the ACK from the replica before killing the
# during SHUTDOWN WAIT FOR ALL SLAVES, ensure the master will
# still await the ACK from the slave before killing the
# Ack_thread.
#
# References:
@@ -62,7 +62,7 @@
--connection server_1
--echo # Slaves which simulate an error will produce a timeout on the primary
--echo # Slaves which simulate an error will produce a timeout on the master
call mtr.add_suppression("Timeout waiting");
call mtr.add_suppression("did not exit");
call mtr.add_suppression("Got an error reading communication packets");
@@ -109,8 +109,8 @@ while (`SELECT $i <= $slave_last`)
--echo #############################
--echo #
--echo # Test Case 1) If both replicas simulate a delay that is within the
--echo # allowed timeout, the primary should delay killing the Ack_thread
--echo # Test Case 1) If both slaves simulate a delay that is within the
--echo # allowed timeout, the master should delay killing the Ack_thread
--echo # until an ACK is received.
--echo #
--let server_2_sync_slave_reply=1
@@ -123,8 +123,8 @@ while (`SELECT $i <= $slave_last`)
--source rpl_semi_sync_shutdown_await_ack.inc
--echo #
--echo # Test Case 2) If both replicas simulate an error before sending an ACK,
--echo # the primary should delay killing the Ack_thread until the
--echo # Test Case 2) If both slaves simulate an error before sending an ACK,
--echo # the master should delay killing the Ack_thread until the
--echo # timeout is reached.
--echo #
--let server_2_sync_slave_reply=0
@@ -137,9 +137,9 @@ while (`SELECT $i <= $slave_last`)
--source rpl_semi_sync_shutdown_await_ack.inc
--echo #
--echo # Test Case 3) If one replica simulates a delay within the allowed
--echo # Test Case 3) If one slave simulates a delay within the allowed
--echo # timeout and the other simulates an error before sending an ACK, the
--echo # primary should delay killing the Ack_thread until it receives an
--echo # master should delay killing the Ack_thread until it receives an
--echo # ACK from the delayed slave.
--echo #
--let server_2_sync_slave_reply=0
@@ -152,13 +152,13 @@ while (`SELECT $i <= $slave_last`)
--source rpl_semi_sync_shutdown_await_ack.inc
--echo #
--echo # Test Case 4) If a replica errors before sending an ACK, it will cause
--echo # Test Case 4) If a slave errors before sending an ACK, it will cause
--echo # the IO thread to stop and handle the error. During error handling, if
--echo # semi-sync is active, the replica will form a new connection with the
--echo # primary to kill the active connection. However, if the primary is
--echo # semi-sync is active, the slave will form a new connection with the
--echo # master to kill the active connection. However, if the master is
--echo # shutting down, it may kill the new connection, thereby leaving the
--echo # active semi-sync connection in-tact. The slave should notice this, and
--echo # not issue a `QUIT` command to the primary, which would otherwise be
--echo # not issue a `QUIT` command to the master, which would otherwise be
--echo # sent to kill an active connection. This test case validates that the
--echo # slave does not send a `QUIT` in this case.
--echo #
@@ -176,8 +176,8 @@ while (`SELECT $i <= $slave_last`)
#
--echo #
--echo # Test Case 5) If a waiting-for-ACK user thread is killed (disconnected)
--echo # during SHUTDOWN WAIT FOR ALL SLAVES, ensure the primary will still
--echo # await the ACK from the replica before killing the Ack_receiver thread
--echo # during SHUTDOWN WAIT FOR ALL SLAVES, ensure the master will still
--echo # await the ACK from the slave before killing the Ack_receiver thread
--echo #
--connection server_1
insert into t1 values (1);

View File

@@ -2,9 +2,9 @@
# This test verifies that semi-sync setups configured to use SSL can kill
# the replication connection when the IO thread is stopped (e.g. from
# STOP SLAVE). The way it should happen, is that the IO thread creates a new
# connection to the primary which issues KILL on the connection id of the
# connection to the master which issues KILL on the connection id of the
# replication connection. MDEV-36663 reported an issue where this new
# kill-oriented connection could not connect to a primary when it requires
# kill-oriented connection could not connect to a master when it requires
# connections to use SSL.
#
# This test sets up a semi-sync SSL master-slave topology, and stops the
@@ -14,7 +14,7 @@
# reports as 0.
#
# References:
# MDEV-36663: Semi-sync Replica Can't Kill Dump Thread When Using SSL
# MDEV-36663: Semi-sync Slave Can't Kill Dump Thread When Using SSL
#
--source include/have_binlog_format_mixed.inc # format-agnostic
--source include/have_ssl_communication.inc

View File

@@ -199,11 +199,11 @@ SELECT * FROM t3 ORDER BY i;
# Step-5.5: Sync slave with master
--sync_slave_with_master
# Step-5.6: Diff master-replica tables insert statements are in sync
# Step-5.6: Diff master-slave tables insert statements are in sync
--let $diff_tables=master:t2, slave:t2
--source include/diff_tables.inc
# Step-5.7: Diff master-replica tables create select table is in sync
# Step-5.7: Diff master-slave tables create select table is in sync
--let $diff_tables=master:t3, slave:t3
--source include/diff_tables.inc

View File

@@ -1,39 +1,39 @@
#
# Purpose:
# This test ensures that a replica's default value for Using_Gtid is set
# correctly. Specifically, it should default to 'Slave_Pos' unless the primary
# This test ensures that a slave's default value for Using_Gtid is set
# correctly. Specifically, it should default to 'Slave_Pos' unless the master
# server does not support GTIDs (if its version is less than 10), in which case
# the replica should fall back to 'No'.
# the slave should fall back to 'No'.
#
# Methodology:
# Validate the value of Using_Gtid on replica initialization and after
# Validate the value of Using_Gtid on slave initialization and after
# RESET SLAVE commands. Specifically, we validate the following use cases:
#
# Case 1) A replica will initialize with Slave_Pos if the primary supports
# Case 1) A slave will initialize with Slave_Pos if the master supports
# GTIDs
# Case 2) A replica configured with the Using_Gtid=Slave_Pos issued
# Case 2) A slave configured with the Using_Gtid=Slave_Pos issued
# RESET SLAVE will preserve Using_Gtid without any informational
# messages.
# Case 3) A replica configured with Using_Gtid=No against a master which
# Case 3) A slave configured with Using_Gtid=No against a master which
# supports GTIDs will revert to Using_Gtid=Slave_Pos after issued
# RESET SLAVE and provide an informational note
# Case 4) A fresh replica targeting a primary which does not support GTIDs
# Case 4) A fresh slave targeting a master which does not support GTIDs
# will fall back to Using_Gtid=No when starting. An informational
# message should be logged.
# Case 5) A replica connected to a primary which does not support GTIDs
# Case 5) A slave connected to a master which does not support GTIDs
# should preserve Using_Gtid=No when issued RESET SLAVE. No message
# should be provided to the user.
# Case 6) A replica configured with Using_Gtid=Current_Pos should revert
# Case 6) A slave configured with Using_Gtid=Current_Pos should revert
# to Slave_Pos when issued RESET SLAVE. An informational message
# should be provided to the user.
# Case 7) The MTR include file rpl_change_topology.inc should implicitly
# set MASTER_USE_GTID=NO when provided with $rpl_master_log_file
# Case 8) The MTR include file reset_slave.inc should keep/delete GTID state
# when reset_slave_keep_gtid_state is set, respectively.
# Case 9) A replica issued CHANGE MASTER TO specified with log coordinates
# Case 9) A slave issued CHANGE MASTER TO specified with log coordinates
# but not master_use_gtid=No should warn the user that Using_Gtid is
# being changed to No.
# Case 10) A replica issued CHANGE MASTER TO specified with log coordinates
# Case 10) A slave issued CHANGE MASTER TO specified with log coordinates
# and master_use_gtid=Slave_Pos should warn the user that the log
# coordinates will be ignored.
#
@@ -100,7 +100,7 @@ set SQL_LOG_BIN=1;
--echo #
--echo # If the primary does not support GTIDs (version < 10), the replica
--echo # If the master does not support GTIDs (version < 10), the slave
--echo # should fall back to Using_Gtid=No on slave start, and should not
--echo # revert Using_Gtid to Slave_Pos after RESET SLAVE
@@ -110,10 +110,10 @@ RESET SLAVE ALL;
--replace_result $MASTER_MYPORT MASTER_MYPORT
--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=1
SET @saved_dbug= @@GLOBAL.debug_dbug;
set @@global.debug_dbug= "d,mock_mariadb_primary_v5_in_get_master_version";
set @@global.debug_dbug= "d,mock_mariadb_master_v5_in_get_master_version";
--source include/start_slave.inc
--echo # Replica should detect at start that the primary does not support GTIDs
--echo # Slave should detect at start that the master does not support GTIDs
--echo # and fall-back to Using_Gtid=No
--let $using_gtid= query_get_value(SHOW SLAVE STATUS, Using_Gtid, 1)
if ($using_gtid != 'No')
@@ -121,7 +121,7 @@ if ($using_gtid != 'No')
--die Using_Gtid has wrong value of '$using_gtid' when it should be 'No'
}
--echo # Replica should have an informational message stating it is falling
--echo # Slave should have an informational message stating it is falling
--echo # back to Using_Gtid=No
let $log_error_= `SELECT @@GLOBAL.log_error`;
if(!$log_error_)
@@ -137,7 +137,7 @@ if(!$log_error_)
--source include/stop_slave.inc
RESET SLAVE;
--echo # Replica should know that the primary does not support GTIDs and
--echo # Slave should know that the master does not support GTIDs and
--echo # preserve Using_Gtid=No
--let $using_gtid= query_get_value(SHOW SLAVE STATUS, Using_Gtid, 1)
if ($using_gtid != 'No')
@@ -266,7 +266,7 @@ eval set global gtid_slave_pos="$old_slave_pos";
--source include/start_slave.inc
--echo #
--echo # A replica issued CHANGE MASTER TO specified with log coordinates but
--echo # A slave issued CHANGE MASTER TO specified with log coordinates but
--echo # not master_use_gtid=no should warn the user that Using_Gtid is being
--echo # changed to No.
--echo #
@@ -283,7 +283,7 @@ eval set global gtid_slave_pos="$old_slave_pos";
--echo #
--echo # A replica issued CHANGE MASTER TO specified with log coordinates and
--echo # A slave issued CHANGE MASTER TO specified with log coordinates and
--echo # master_use_gtid=Slave_Pos should warn the user that the log
--echo # coordinates will be ignored.
--echo #

View File

@@ -19,7 +19,7 @@
# Create XA transactions with various combinations of erroring transactional
# or non-transactional statements. The binary log is examined to ensure all
# XA components are written. Chain replication is used, i.e.
# (primary->replica->replica), to ensure replica binlogging is consistent with
# (master->slave->slave), to ensure slave binlogging is consistent with
# manual execution. The transactional and non-transactional tables use InnoDB
# and MyISAM, respectively.
#

View File

@@ -501,7 +501,7 @@ res
SET GLOBAL character_set_client=2;
ERROR 42000: Unknown character set: '2'
#
# MDEV-31018 Replica of 10.3, 10.4, <10.5.19 and <10.6.12 to 10.11 will not work when using non-default charset
# MDEV-31018 Slave of 10.3, 10.4, <10.5.19 and <10.6.12 to 10.11 will not work when using non-default charset
#
SET @@pseudo_slave_mode=1;
SET character_set_client=2/*latin2_czech_cs*/;

View File

@@ -495,7 +495,7 @@ WHERE VARIABLE_NAME='character_set_connection') AS res;
res
1
#
# MDEV-31018 Replica of 10.3, 10.4, <10.5.19 and <10.6.12 to 10.11 will not work when using non-default charset
# MDEV-31018 Slave of 10.3, 10.4, <10.5.19 and <10.6.12 to 10.11 will not work when using non-default charset
#
SET character_set_connection=2/*latin2_czech_cs*/;
ERROR 42000: Unknown character set: '2'

View File

@@ -487,7 +487,7 @@ WHERE VARIABLE_NAME='character_set_server') AS res;
res
1
#
# MDEV-31018 Replica of 10.3, 10.4, <10.5.19 and <10.6.12 to 10.11 will not work when using non-default charset
# MDEV-31018 Slave of 10.3, 10.4, <10.5.19 and <10.6.12 to 10.11 will not work when using non-default charset
#
SET character_set_server=2/*latin2_czech_cs*/;
ERROR 42000: Unknown character set: '2'

View File

@@ -351,7 +351,7 @@ SELECT @@session.character_set_client =
SET GLOBAL character_set_client=2;
--echo #
--echo # MDEV-31018 Replica of 10.3, 10.4, <10.5.19 and <10.6.12 to 10.11 will not work when using non-default charset
--echo # MDEV-31018 Slave of 10.3, 10.4, <10.5.19 and <10.6.12 to 10.11 will not work when using non-default charset
--echo #
SET @@pseudo_slave_mode=1;

View File

@@ -276,7 +276,7 @@ SELECT @@session.character_set_connection =
WHERE VARIABLE_NAME='character_set_connection') AS res;
--echo #
--echo # MDEV-31018 Replica of 10.3, 10.4, <10.5.19 and <10.6.12 to 10.11 will not work when using non-default charset
--echo # MDEV-31018 Slave of 10.3, 10.4, <10.5.19 and <10.6.12 to 10.11 will not work when using non-default charset
--echo #
--error ER_UNKNOWN_CHARACTER_SET

View File

@@ -273,7 +273,7 @@ SELECT @@session.character_set_results =
WHERE VARIABLE_NAME='character_set_results') AS res;
--echo #
--echo # MDEV-31018 Replica of 10.3, 10.4, <10.5.19 and <10.6.12 to 10.11 will not work when using non-default charset
--echo # MDEV-31018 Slave of 10.3, 10.4, <10.5.19 and <10.6.12 to 10.11 will not work when using non-default charset
--echo #
--error ER_UNKNOWN_CHARACTER_SET

View File

@@ -267,7 +267,7 @@ SELECT @@session.character_set_server =
WHERE VARIABLE_NAME='character_set_server') AS res;
--echo #
--echo # MDEV-31018 Replica of 10.3, 10.4, <10.5.19 and <10.6.12 to 10.11 will not work when using non-default charset
--echo # MDEV-31018 Slave of 10.3, 10.4, <10.5.19 and <10.6.12 to 10.11 will not work when using non-default charset
--echo #
--error ER_UNKNOWN_CHARACTER_SET

File diff suppressed because one or more lines are too long

View File

@@ -8832,7 +8832,7 @@ MYSQL_BIN_LOG::trx_group_commit_leader(group_commit_entry *leader)
{
#ifdef HAVE_REPLICATION
/*
The thread which will await the ACK from the replica can change
The thread which will await the ACK from the slave can change
depending on the wait-point. If AFTER_COMMIT, then the user thread
will perform the wait. If AFTER_SYNC, the binlog group commit leader
will perform the wait on behalf of the user thread.

View File

@@ -393,7 +393,7 @@ class Master_info : public Slave_reporting_capability
bool is_shutdown= false;
/*
A replica will default to Slave_Pos for using Using_Gtid; however, we
A slave will default to Slave_Pos for using Using_Gtid; however, we
first need to test if the master supports GTIDs. If not, fall back to 'No'.
Cache the value so future RESET SLAVE commands don't revert to Slave_Pos.
*/

View File

@@ -209,7 +209,7 @@ a file name for --relay-log-index option", opt_relaylog_index_name);
sql_print_warning("Neither --relay-log nor --relay-log-index were used;"
" so replication "
"may break when this MariaDB server acts as a "
"replica and has its hostname changed. Please "
"slave and has its hostname changed. Please "
"use '--log-basename=#' or '--relay-log=%s' to avoid "
"this problem.", ln);
name_warning_sent= 1;

View File

@@ -694,7 +694,7 @@ int Repl_semi_sync_master::report_reply_binlog(uint32 server_id,
* thread sending the binlog to the slave.
* In reality, to improve the transaction availability, we allow multiple
* sync replication slaves. So, if any one of them get the transaction,
* the transaction session in the primary can move forward.
* the transaction session in the master can move forward.
*/
if (m_reply_file_name_inited)
{
@@ -705,7 +705,7 @@ int Repl_semi_sync_master::report_reply_binlog(uint32 server_id,
* would not adjust sending binlog position.
* We based on the assumption that there are multiple semi-sync slave,
* and at least one of them shou/ld be up to date.
* If all semi-sync slaves are behind, at least initially, the primary
* If all semi-sync slaves are behind, at least initially, the master
* can find the situation after the waiting timeout. After that, some
* slaves should catch up quickly.
*/
@@ -943,7 +943,7 @@ int Repl_semi_sync_master::commit_trx(const char *trx_wait_binlog_name,
/* In between the binlogging of this transaction and this wait, it is
* possible that our entry in Active_tranx was removed (i.e. if
* semi-sync was switched off and on). It is also possible that the
* event was already sent to a replica; however, we don't know if
* event was already sent to a slave; however, we don't know if
* semi-sync was on or off at that time, so an ACK may never come. So
* skip the wait. Note that rpl_semi_sync_master_request_acks was
* already incremented in report_binlog_update(), so to keep

View File

@@ -614,7 +614,7 @@ class Repl_semi_sync_master
* Inputs:
* trans_thd Thread of the transaction which is executing the
* transaction.
* waiter_thd Thread that will wait for the ACK from the replica,
* waiter_thd Thread that will wait for the ACK from the slave,
* which depends on the semi-sync wait point. If AFTER_SYNC,
* and also using binlog group commit, this will be the leader
* thread of the binlog commit. Otherwise, it is the thread that

View File

@@ -1958,7 +1958,7 @@ static int get_master_version_and_clock(MYSQL* mysql, Master_info* mi)
}
else
{
DBUG_EXECUTE_IF("mock_mariadb_primary_v5_in_get_master_version",
DBUG_EXECUTE_IF("mock_mariadb_master_v5_in_get_master_version",
version= 5;);
/*

View File

@@ -5471,7 +5471,7 @@ public:
1) Non-leader threads use COND_wakeup_ready to wait for the leader thread
to complete binlog commit.
2) The leader thread uses COND_wakeup_ready to await ACKs from the
replica before signalling the non-leader threads to wake up.
slave before signalling the non-leader threads to wake up.
With wait_point=AFTER_COMMIT, there is no overlap as binlogging has
finished, so COND_wakeup_ready is safe to re-use.

View File

@@ -2025,7 +2025,7 @@ public:
/**
INSERT .. SELECT ... SKIP LOCKED is unlikely to have the same
rows locked on the replica.
rows locked on the slave.
primary key.
*/
BINLOG_STMT_UNSAFE_SKIP_LOCKED,

View File

@@ -264,7 +264,7 @@ trx_purge_add_undo_to_history(const trx_t* trx, trx_undo_t*& undo, mtr_t* mtr)
if (trx->mysql_log_file_name && *trx->mysql_log_file_name)
/* Update the latest binlog name and offset if log_bin=ON or this
is a replica. */
is a slave. */
trx_rseg_update_binlog_offset(rseg_header, trx->mysql_log_file_name,
trx->mysql_log_offset, mtr);