Merge 10.1 into 10.2

This commit is contained in:
Eugene Kosov 2019-07-09 13:22:22 +03:00
commit 26c389b7b7
49 changed files with 616 additions and 170 deletions

View file

@ -22,3 +22,7 @@ connection node_3;
connection node_2;
STOP SLAVE;
RESET SLAVE ALL;
#cleanup
reset master;
reset master;
reset master;

View file

@ -1,3 +1,7 @@
connection node_1;
reset master;
connection node_2;
reset master;
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
CREATE TABLE t2 (id INT) ENGINE=InnoDB;
@ -12,58 +16,60 @@ COUNT(*) = 2
1
connection node_1;
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
FLUSH LOGS;
SHOW BINLOG EVENTS IN 'mysqld-bin.000002' LIMIT 4,21;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
mysqld-bin.000002 # Gtid # # GTID 0-1-1
mysqld-bin.000002 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB
mysqld-bin.000002 # Gtid # # BEGIN GTID 0-1-2
mysqld-bin.000002 # Annotate_rows # # INSERT INTO t1 VALUES (1)
mysqld-bin.000002 # Table_map # # table_id: # (test.t1)
mysqld-bin.000002 # Write_rows_v1 # # table_id: # flags: STMT_END_F
mysqld-bin.000002 # Xid # # COMMIT /* xid=# */
mysqld-bin.000002 # Gtid # # GTID 0-1-3
mysqld-bin.000002 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB
mysqld-bin.000002 # Gtid # # BEGIN GTID 0-1-4
mysqld-bin.000002 # Annotate_rows # # INSERT INTO t2 VALUES (1)
mysqld-bin.000002 # Table_map # # table_id: # (test.t2)
mysqld-bin.000002 # Write_rows_v1 # # table_id: # flags: STMT_END_F
mysqld-bin.000002 # Xid # # COMMIT /* xid=# */
mysqld-bin.000002 # Gtid # # BEGIN GTID 0-1-5
mysqld-bin.000002 # Annotate_rows # # INSERT INTO t2 VALUES (1)
mysqld-bin.000002 # Table_map # # table_id: # (test.t2)
mysqld-bin.000002 # Write_rows_v1 # # table_id: # flags: STMT_END_F
mysqld-bin.000002 # Xid # # COMMIT /* xid=# */
mysqld-bin.000002 # Gtid # # GTID 0-1-6
mysqld-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER
mysqld-bin.000001 # Gtid # # GTID #-#-#
mysqld-bin.000001 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB
mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-#
mysqld-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES (1)
mysqld-bin.000001 # Table_map # # table_id: # (test.t1)
mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
mysqld-bin.000001 # Xid # # COMMIT /* XID */
mysqld-bin.000001 # Gtid # # GTID #-#-#
mysqld-bin.000001 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB
mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-#
mysqld-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1)
mysqld-bin.000001 # Table_map # # table_id: # (test.t2)
mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
mysqld-bin.000001 # Xid # # COMMIT /* XID */
mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-#
mysqld-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1)
mysqld-bin.000001 # Table_map # # table_id: # (test.t2)
mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
mysqld-bin.000001 # Xid # # COMMIT /* XID */
mysqld-bin.000001 # Gtid # # GTID #-#-#
mysqld-bin.000001 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER
connection node_2;
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
COUNT(*) = 2
1
SHOW BINLOG EVENTS IN 'mysqld-bin.000003' LIMIT 3,21;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
mysqld-bin.000003 # Gtid # # GTID 0-1-1
mysqld-bin.000003 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB
mysqld-bin.000003 # Gtid # # BEGIN GTID 0-1-2
mysqld-bin.000003 # Annotate_rows # # INSERT INTO t1 VALUES (1)
mysqld-bin.000003 # Table_map # # table_id: # (test.t1)
mysqld-bin.000003 # Write_rows_v1 # # table_id: # flags: STMT_END_F
mysqld-bin.000003 # Xid # # COMMIT /* xid=# */
mysqld-bin.000003 # Gtid # # GTID 0-1-3
mysqld-bin.000003 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB
mysqld-bin.000003 # Gtid # # BEGIN GTID 0-1-4
mysqld-bin.000003 # Annotate_rows # # INSERT INTO t2 VALUES (1)
mysqld-bin.000003 # Table_map # # table_id: # (test.t2)
mysqld-bin.000003 # Write_rows_v1 # # table_id: # flags: STMT_END_F
mysqld-bin.000003 # Xid # # COMMIT /* xid=# */
mysqld-bin.000003 # Gtid # # BEGIN GTID 0-1-5
mysqld-bin.000003 # Annotate_rows # # INSERT INTO t2 VALUES (1)
mysqld-bin.000003 # Table_map # # table_id: # (test.t2)
mysqld-bin.000003 # Write_rows_v1 # # table_id: # flags: STMT_END_F
mysqld-bin.000003 # Xid # # COMMIT /* xid=# */
mysqld-bin.000003 # Gtid # # GTID 0-1-6
mysqld-bin.000003 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER
mysqld-bin.000001 # Gtid # # GTID #-#-#
mysqld-bin.000001 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB
mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-#
mysqld-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES (1)
mysqld-bin.000001 # Table_map # # table_id: # (test.t1)
mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
mysqld-bin.000001 # Xid # # COMMIT /* XID */
mysqld-bin.000001 # Gtid # # GTID #-#-#
mysqld-bin.000001 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB
mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-#
mysqld-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1)
mysqld-bin.000001 # Table_map # # table_id: # (test.t2)
mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
mysqld-bin.000001 # Xid # # COMMIT /* XID */
mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-#
mysqld-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1)
mysqld-bin.000001 # Table_map # # table_id: # (test.t2)
mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
mysqld-bin.000001 # Xid # # COMMIT /* XID */
mysqld-bin.000001 # Gtid # # GTID #-#-#
mysqld-bin.000001 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER
DROP TABLE t1;
DROP TABLE t2;
#cleanup
connection node_1;
RESET MASTER;
connection node_2;
reset master;

View file

@ -18,3 +18,5 @@ COUNT(*) = 1
1
connection node_1;
DROP TABLE t1;
truncate table mysql.slow_log;
truncate table mysql.general_log;

View file

@ -78,6 +78,11 @@ wsrep_gtid_mode 1
# On node_1
connection node_1;
DROP TABLE t1, t2;
#cleanup
connection node_1;
reset master;
connection node_2;
reset master;
disconnect node_2;
disconnect node_1;
# End of test

View file

@ -78,6 +78,11 @@ wsrep_gtid_mode 1
# On node_1
connection node_1;
DROP TABLE t1, t2;
#cleanup
connection node_1;
reset master;
connection node_2;
reset master;
disconnect node_2;
disconnect node_1;
# End of test

View file

@ -65,3 +65,13 @@ DROP TABLE t1;
STOP SLAVE;
RESET SLAVE ALL;
--echo #cleanup
--connection node_1
reset master;
--connection node_2
reset master;
--connection node_3
reset master;

View file

@ -1,6 +1,11 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
--connection node_1
reset master;
--connection node_2
reset master;
#
# Test Galera with --log-bin --log-slave-updates .
# This way the actual MySQL binary log is used,
@ -20,20 +25,19 @@ SELECT COUNT(*) = 2 FROM t2;
--connection node_1
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
FLUSH LOGS;
--replace_column 2 # 4 # 5 #
--replace_regex /table_id: [0-9]+/table_id: #/ /xid=[0-9]+/xid=#/
SHOW BINLOG EVENTS IN 'mysqld-bin.000002' LIMIT 4,21;
--let $MASTER_MYPORT=$NODE_MYPORT_1
--source include/show_binlog_events.inc
--connection node_2
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
--replace_column 2 # 4 # 5 #
--replace_regex /table_id: [0-9]+/table_id: #/ /xid=[0-9]+/xid=#/
SHOW BINLOG EVENTS IN 'mysqld-bin.000003' LIMIT 3,21;
--let $MASTER_MYPORT=$NODE_MYPORT_2
--source include/show_binlog_events.inc
DROP TABLE t1;
DROP TABLE t2;
--echo #cleanup
--connection node_1
RESET MASTER;
--connection node_2
reset master;

View file

@ -22,3 +22,5 @@ SELECT COUNT(*) = 1 FROM mysql.slow_log WHERE sql_text = 'SELECT 2 = 2 FROM t1';
--connection node_1
DROP TABLE t1;
truncate table mysql.slow_log;
truncate table mysql.general_log;

View file

@ -64,7 +64,9 @@ DROP TABLE t1;
--connection node_1
--disable_warnings
CREATE EVENT event1 ON SCHEDULE AT '2038-01-01 23:59:59' DO SELECT 1;
--enable_warnings
--connection node_2
SHOW CREATE EVENT event1;

View file

@ -48,6 +48,13 @@ source include/print_gtid.inc;
# Cleanup
DROP TABLE t1, t2;
--echo #cleanup
--connection node_1
reset master;
--connection node_2
reset master;
--source include/galera_end.inc
--echo # End of test

View file

@ -48,6 +48,13 @@ source include/print_gtid.inc;
# Cleanup
DROP TABLE t1, t2;
--echo #cleanup
--connection node_1
reset master;
--connection node_2
reset master;
--source include/galera_end.inc
--echo # End of test

View file

@ -0,0 +1,25 @@
!include my.cnf
[mysqld.1]
log-bin
log-slave-updates
[mysqld.2]
log-bin
log-slave-updates
[mysqld.3]
log-bin
log-slave-updates
[mysqld.4]
server-id=4
log-bin=server4-bin
log-slave-updates
m1.replicate_ignore_table='a.t1'
m2.replicate_ignore_table='b.t1'
replicate_ignore_table='c.t1'
[ENV]
SERVER_MYPORT_4= @mysqld.4.port
SERVER_MYSOCK_4= @mysqld.4.socket

View file

@ -0,0 +1,114 @@
create database a;
use a;
create table t1(a int);
insert into t1 values(1);
create table t2(a int);
insert into t2 values(1);
create database b;
use b;
create table t1(a int);
insert into t1 values(1);
create table t2(a int);
insert into t2 values(1);
create database c;
use c;
create table t1(a int);
insert into t1 values(1);
create table t2(a int);
insert into t2 values(1);
change master 'm1' to master_port=MYPORT_1 , master_host='127.0.0.1', master_user='root';
change master 'm2' to master_port=MYPORT_2 , master_host='127.0.0.1', master_user='root';
change master to master_port=MYPORT_3 , master_host='127.0.0.1', master_user='root';
start all slaves;
set default_master_connection = 'm1';
include/wait_for_slave_to_start.inc
set default_master_connection = 'm2';
include/wait_for_slave_to_start.inc
set default_master_connection = '';
include/wait_for_slave_to_start.inc
select @@global.'m1'.replicate_ignore_table;
@@global.'m1'.replicate_ignore_table
a.t1
select @@global.'m2'.replicate_ignore_table;
@@global.'m2'.replicate_ignore_table
b.t1
select @@global.replicate_ignore_table;
@@global.replicate_ignore_table
c.t1
use a;
#No t1 table
show tables;
Tables_in_a
t2
use b;
#No t1 table
show tables;
Tables_in_b
t2
use c;
#No t1 table
show tables;
Tables_in_c
t2
#TEST
STOP ALL SLAVES;
Warnings:
Note 1938 SLAVE 'm2' stopped
Note 1938 SLAVE '' stopped
Note 1938 SLAVE 'm1' stopped
RESET SLAVE 'm1' ALL ;
RESET SLAVE 'm2' ALL ;
RESET SLAVE ALL ;
drop database a;
drop database b;
drop database c;
change master 'm1' to master_port=MYPORT_1 , master_host='127.0.0.1', master_user='root';
change master 'm2' to master_port=MYPORT_2 , master_host='127.0.0.1', master_user='root';
change master to master_port=MYPORT_3 , master_host='127.0.0.1', master_user='root';
start all slaves;
Warnings:
Note 1937 SLAVE 'm2' started
Note 1937 SLAVE '' started
Note 1937 SLAVE 'm1' started
set default_master_connection = 'm1';
include/wait_for_slave_to_start.inc
set default_master_connection = 'm2';
include/wait_for_slave_to_start.inc
set default_master_connection = '';
include/wait_for_slave_to_start.inc
#Replication Filter should be intact (t1 still not replicated)
select @@global.'m1'.replicate_ignore_table;
@@global.'m1'.replicate_ignore_table
a.t1
select @@global.'m2'.replicate_ignore_table;
@@global.'m2'.replicate_ignore_table
b.t1
select @@global.replicate_ignore_table;
@@global.replicate_ignore_table
c.t1
use a;
#No t1 table
show tables;
Tables_in_a
t2
use b;
#No t1 table
show tables;
Tables_in_b
t2
use c;
#No t1 table
show tables;
Tables_in_c
t2
#CleanUp
drop database a;
drop database b;
drop database c;
stop all slaves;
SET default_master_connection = "m1";
include/wait_for_slave_to_stop.inc
SET default_master_connection = "m2";
include/wait_for_slave_to_stop.inc
SET default_master_connection = "";
include/wait_for_slave_to_stop.inc

View file

@ -0,0 +1,141 @@
--source include/not_embedded.inc
--source include/have_innodb.inc
--source include/have_debug.inc
# MDEV-8874
# In Named Master slave connection if we do reset slave 'connection_name' ALL and then
# if we reconnect slave, replication filters are ignored.
# This patch fixes this issue.
--connect (server_1,127.0.0.1,root,,,$SERVER_MYPORT_1)
--connect (server_2,127.0.0.1,root,,,$SERVER_MYPORT_2)
--connect (server_3,127.0.0.1,root,,,$SERVER_MYPORT_3)
--connect (server_4,127.0.0.1,root,,,$SERVER_MYPORT_4)
--connection server_1
create database a;
use a;
create table t1(a int);
insert into t1 values(1);
create table t2(a int);
insert into t2 values(1);
--save_master_pos
--connection server_2
create database b;
use b;
create table t1(a int);
insert into t1 values(1);
create table t2(a int);
insert into t2 values(1);
--save_master_pos
--connection server_3
create database c;
use c;
create table t1(a int);
insert into t1 values(1);
create table t2(a int);
insert into t2 values(1);
--save_master_pos
--connection server_4
--disable_warnings
--replace_result $SERVER_MYPORT_1 MYPORT_1
eval change master 'm1' to master_port=$SERVER_MYPORT_1 , master_host='127.0.0.1', master_user='root';
--replace_result $SERVER_MYPORT_2 MYPORT_2
eval change master 'm2' to master_port=$SERVER_MYPORT_2 , master_host='127.0.0.1', master_user='root';
--replace_result $SERVER_MYPORT_3 MYPORT_3
eval change master to master_port=$SERVER_MYPORT_3 , master_host='127.0.0.1', master_user='root';
start all slaves;
set default_master_connection = 'm1';
--source include/wait_for_slave_to_start.inc
set default_master_connection = 'm2';
--source include/wait_for_slave_to_start.inc
set default_master_connection = '';
--source include/wait_for_slave_to_start.inc
select @@global.'m1'.replicate_ignore_table;
select @@global.'m2'.replicate_ignore_table;
select @@global.replicate_ignore_table;
--enable_warnings
--sync_with_master 0,'m1'
--sync_with_master 0,'m2'
--sync_with_master 0,''
use a;
--echo #No t1 table
show tables;
use b;
--echo #No t1 table
show tables;
use c;
--echo #No t1 table
show tables;
--echo #TEST
STOP ALL SLAVES;
RESET SLAVE 'm1' ALL ;
RESET SLAVE 'm2' ALL ;
RESET SLAVE ALL ;
drop database a;
drop database b;
drop database c;
--replace_result $SERVER_MYPORT_1 MYPORT_1
eval change master 'm1' to master_port=$SERVER_MYPORT_1 , master_host='127.0.0.1', master_user='root';
--replace_result $SERVER_MYPORT_2 MYPORT_2
eval change master 'm2' to master_port=$SERVER_MYPORT_2 , master_host='127.0.0.1', master_user='root';
--replace_result $SERVER_MYPORT_3 MYPORT_3
eval change master to master_port=$SERVER_MYPORT_3 , master_host='127.0.0.1', master_user='root';
start all slaves;
set default_master_connection = 'm1';
--source include/wait_for_slave_to_start.inc
set default_master_connection = 'm2';
--source include/wait_for_slave_to_start.inc
set default_master_connection = '';
--source include/wait_for_slave_to_start.inc
--sync_with_master 0,'m1'
--sync_with_master 0,'m2'
--sync_with_master 0,''
--echo #Replication Filter should be intact (t1 still not replicated)
select @@global.'m1'.replicate_ignore_table;
select @@global.'m2'.replicate_ignore_table;
select @@global.replicate_ignore_table;
use a;
--echo #No t1 table
show tables;
use b;
--echo #No t1 table
show tables;
use c;
--echo #No t1 table
show tables;
#--echo #restart the server
#--source include/restart_mysqld.inc
--echo #CleanUp
--connection server_1
drop database a;
--save_master_pos
--connection server_2
drop database b;
--save_master_pos
--connection server_3
drop database c;
--save_master_pos
--connection server_4
--sync_with_master 0,'m1'
--sync_with_master 0,'m2'
--sync_with_master 0,''
--disable_warnings
stop all slaves;
--enable_warnings
SET default_master_connection = "m1";
--source include/wait_for_slave_to_stop.inc
SET default_master_connection = "m2";
--source include/wait_for_slave_to_stop.inc
SET default_master_connection = "";
--source include/wait_for_slave_to_stop.inc

View file

@ -1,18 +1,23 @@
include/master-slave.inc
[connection master]
connection slave;
set global debug_dbug='d,rows_log_event_before_open_table';
set debug_sync='now WAIT_FOR before_open_table';
connection master;
create table t1 (a int);
connection slave;
connection slave;
set global debug_dbug='d,rows_log_event_before_open_table';
connection master;
insert t1 values (1),(2),(3);
connection slave;
set debug_sync='now WAIT_FOR before_open_table';
kill slave_sql_thread;
set debug_sync='now SIGNAL go_ahead_sql';
include/wait_for_slave_sql_error.inc [errno=1927]
Last_SQL_Error = Error executing row event: 'Connection was killed'
set global debug_dbug='';
set debug_sync='RESET';
connection master;
drop table t1;
connection slave;
start slave;
include/start_slave.inc
Last_SQL_Error =
include/rpl_end.inc

View file

@ -27,10 +27,6 @@ select plugin_name,plugin_status from information_schema.plugins where plugin_na
plugin_name plugin_status
rpl_semi_sync_slave DELETED
connection master;
show global status like "Slave%_connect%";
Variable_name Value
Slave_connections 2
Slaves_connected 1
UNINSTALL PLUGIN rpl_semi_sync_master;
Warnings:
Warning 1620 Plugin is busy and will be uninstalled on shutdown

View file

@ -2,27 +2,34 @@ source include/have_debug_sync.inc;
source include/have_binlog_format_row.inc;
source include/master-slave.inc;
connection slave;
set global debug_dbug='d,rows_log_event_before_open_table';
send set debug_sync='now WAIT_FOR before_open_table';
connection master;
create table t1 (a int);
--sync_slave_with_master
connection slave;
set global debug_dbug='d,rows_log_event_before_open_table';
connection master;
insert t1 values (1),(2),(3);
connection slave;
reap;
set debug_sync='now WAIT_FOR before_open_table';
let $a=`select id from information_schema.processlist where state='debug sync point: now'`;
replace_result $a slave_sql_thread;
eval kill $a;
set debug_sync='now SIGNAL go_ahead_sql';
--let $slave_sql_errno= 1927
--source include/wait_for_slave_sql_error.inc
let $error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
--echo Last_SQL_Error = $error
set global debug_dbug='';
set debug_sync='RESET';
connection master;
drop table t1;
connection slave;
start slave;
--source include/start_slave.inc
let $error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
--echo Last_SQL_Error = $error
source include/rpl_end.inc;

View file

@ -63,8 +63,13 @@ select plugin_name,plugin_status from information_schema.plugins where plugin_na
--connection master
# The following is to catch errors if the next uninstall plugin would succeed
show global status like "Slave%_connect%";
let $slaves_connected_value= query_get_value(SHOW GLOBAL STATUS LIKE 'Slaves_connected', Value, 1);
if (`SELECT $slaves_connected_value <> 1`)
{
SHOW GLOBAL STATUS LIKE 'Slave_connections';
SHOW GLOBAL STATUS LIKE 'Slaves_connected';
--die *** Unexpected number of connected slaves ***
}
UNINSTALL PLUGIN rpl_semi_sync_master;
select plugin_name,plugin_status from information_schema.plugins where plugin_name like 'rpl_%';