mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge 10.11 into 11.4
This commit is contained in:
@@ -391,3 +391,16 @@ Warnings:
|
||||
Note 1003 select "test"."t1"."c1" AS "c1","test"."t1"."c2" AS "c2","test"."t1"."c1" like concat("test"."t1"."c2",'_') AS "c1 LIKE c2||'_'" from "test"."t1" order by "test"."t1"."ord"
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Start of 10.6 tests
|
||||
#
|
||||
#
|
||||
# MDEV-31910 ASAN memcpy-param-overlap upon CONCAT in ORACLE mode
|
||||
#
|
||||
SET SQL_MODE= ORACLE;
|
||||
SELECT CONCAT(SUBSTR(123 FROM 2));
|
||||
CONCAT(SUBSTR(123 FROM 2))
|
||||
23
|
||||
#
|
||||
# End of 10.6 tests
|
||||
#
|
||||
|
@@ -182,3 +182,19 @@ EXPLAIN EXTENDED SELECT * FROM v1;
|
||||
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Start of 10.6 tests
|
||||
--echo #
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-31910 ASAN memcpy-param-overlap upon CONCAT in ORACLE mode
|
||||
--echo #
|
||||
|
||||
SET SQL_MODE= ORACLE;
|
||||
SELECT CONCAT(SUBSTR(123 FROM 2));
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.6 tests
|
||||
--echo #
|
||||
|
@@ -870,3 +870,14 @@ USE test;
|
||||
DROP DATABASE events_test;
|
||||
SET GLOBAL event_scheduler= 'ON';
|
||||
SET @@global.concurrent_insert= @concurrent_insert;
|
||||
#
|
||||
# MDEV-33472 Assertion `0' failed in Item_row::illegal_method_call on CREATE EVENT
|
||||
#
|
||||
CREATE EVENT e ON SCHEDULE EVERY 1 HOUR STARTS ROW(1,2) DO SELECT 1;
|
||||
ERROR 21000: Operand should contain 1 column(s)
|
||||
CREATE EVENT e ON SCHEDULE EVERY 1 HOUR ENDS ROW(1,2) DO SELECT 1;
|
||||
ERROR 21000: Operand should contain 1 column(s)
|
||||
CREATE EVENT e ON SCHEDULE AT ROW(1,2) DO SELECT *;
|
||||
ERROR 21000: Operand should contain 1 column(s)
|
||||
CREATE EVENT e ON SCHEDULE EVERY ROW(1,2) HOUR DO SELECT 1;
|
||||
ERROR 21000: Operand should contain 1 column(s)
|
||||
|
@@ -1308,3 +1308,20 @@ SET GLOBAL event_scheduler= 'ON';
|
||||
--source include/running_event_scheduler.inc
|
||||
SET @@global.concurrent_insert= @concurrent_insert;
|
||||
# THIS MUST BE THE LAST LINE in this file.
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-33472 Assertion `0' failed in Item_row::illegal_method_call on CREATE EVENT
|
||||
--echo #
|
||||
|
||||
--error ER_OPERAND_COLUMNS
|
||||
CREATE EVENT e ON SCHEDULE EVERY 1 HOUR STARTS ROW(1,2) DO SELECT 1;
|
||||
|
||||
--error ER_OPERAND_COLUMNS
|
||||
CREATE EVENT e ON SCHEDULE EVERY 1 HOUR ENDS ROW(1,2) DO SELECT 1;
|
||||
|
||||
--error ER_OPERAND_COLUMNS
|
||||
CREATE EVENT e ON SCHEDULE AT ROW(1,2) DO SELECT *;
|
||||
|
||||
--error ER_OPERAND_COLUMNS
|
||||
CREATE EVENT e ON SCHEDULE EVERY ROW(1,2) HOUR DO SELECT 1;
|
||||
|
@@ -27,4 +27,4 @@ wsrep_last_written_gtid()
|
||||
connection node_1;
|
||||
drop table t1;
|
||||
connection node_2;
|
||||
CALL mtr.add_suppression("Ignoring server id for non bootstrap node");
|
||||
CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node");
|
||||
|
@@ -49,4 +49,4 @@ mysqld-bin.000003 # Query # # COMMIT
|
||||
BINLOG_POSITIONS_MATCH
|
||||
1
|
||||
DROP TABLE t1,ts1;
|
||||
CALL mtr.add_suppression("Ignoring server id for non bootstrap node");
|
||||
CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node");
|
||||
|
@@ -5,7 +5,7 @@ select @@gtid_domain_id, @@server_id, @@wsrep_gtid_domain_id,@@wsrep_gtid_mode;
|
||||
@@gtid_domain_id @@server_id @@wsrep_gtid_domain_id @@wsrep_gtid_mode
|
||||
0 11 1 1
|
||||
connection node_2;
|
||||
call mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node\\.");
|
||||
call mtr.add_suppression("WSREP: Ignoring server id .* for non bootstrap node");
|
||||
select @@gtid_domain_id, @@server_id, @@wsrep_gtid_domain_id,@@wsrep_gtid_mode;
|
||||
@@gtid_domain_id @@server_id @@wsrep_gtid_domain_id @@wsrep_gtid_mode
|
||||
0 12 1 1
|
||||
|
@@ -42,4 +42,4 @@ SET GLOBAL wsrep_on=ON;
|
||||
connection node_3;
|
||||
reset master;
|
||||
connection node_2;
|
||||
CALL mtr.add_suppression("Ignoring server id for non bootstrap node");
|
||||
CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node");
|
||||
|
@@ -167,4 +167,4 @@ set global wsrep_on=ON;
|
||||
connection node_3;
|
||||
reset master;
|
||||
connection node_2;
|
||||
CALL mtr.add_suppression("Ignoring server id for non bootstrap node");
|
||||
CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node");
|
||||
|
@@ -42,4 +42,4 @@ SELECT @@gtid_binlog_state;
|
||||
@@gtid_binlog_state
|
||||
1-1-101
|
||||
DROP TABLE t1;
|
||||
CALL mtr.add_suppression("Ignoring server id for non bootstrap node");
|
||||
CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node");
|
||||
|
@@ -34,4 +34,4 @@ wsrep_last_written_id_advanced
|
||||
SET AUTOCOMMIT=ON;
|
||||
DROP TABLE t1;
|
||||
connection node_2;
|
||||
CALL mtr.add_suppression("Ignoring server id for non bootstrap node");
|
||||
CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node");
|
||||
|
@@ -3,9 +3,9 @@ connection node_1;
|
||||
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
|
||||
connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4;
|
||||
connection node_2;
|
||||
call mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node\\.");
|
||||
call mtr.add_suppression("WSREP: Ignoring server id .* for non bootstrap node");
|
||||
connection node_4;
|
||||
call mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node\\.");
|
||||
call mtr.add_suppression("WSREP: Ignoring server id .* for non bootstrap node");
|
||||
connection node_3;
|
||||
CHANGE MASTER TO master_host='127.0.0.1', master_user='root', master_port=NODE_MYPORT_1, master_ssl_verify_server_cert=0, master_use_gtid=current_pos;
|
||||
START SLAVE;
|
||||
|
@@ -24,4 +24,4 @@ WSREP_SYNC_WAIT_UPTO
|
||||
connection node_1;
|
||||
DROP TABLE t1;
|
||||
connection node_2;
|
||||
CALL mtr.add_suppression("Ignoring server id for non bootstrap node");
|
||||
CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node");
|
||||
|
@@ -90,7 +90,7 @@ set global wsrep_on=OFF;
|
||||
reset master;
|
||||
set global wsrep_on=ON;
|
||||
connection node_2;
|
||||
CALL mtr.add_suppression("Ignoring server id for non bootstrap node");
|
||||
CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node");
|
||||
disconnect node_2;
|
||||
disconnect node_1;
|
||||
# End of test
|
||||
|
@@ -207,6 +207,7 @@ connection node_1;
|
||||
CREATE TABLE t1 (f1 INTEGER, f2 INTEGER);
|
||||
DROP TABLE t1;
|
||||
connection node_2;
|
||||
set session wsrep_sync_wait=0;
|
||||
SELECT * FROM t1;
|
||||
ERROR 42S02: Table 'test.t1' doesn't exist
|
||||
SET GLOBAL wsrep_ignore_apply_errors = 10;
|
||||
|
@@ -3,8 +3,9 @@ connection node_1;
|
||||
connection node_1;
|
||||
connection node_2;
|
||||
connection node_1;
|
||||
call mtr.add_suppression("WSREP: async IST sender failed to serve.*");
|
||||
call mtr.add_suppression("WSREP:.*");
|
||||
SET @wsrep_provider_options_orig = @@GLOBAL.wsrep_provider_options;
|
||||
SET GLOBAL wsrep_provider_options ='pc.ignore_sb=true;pc.weight=2';
|
||||
connection node_2;
|
||||
SET @wsrep_cluster_address_orig = @@GLOBAL.wsrep_cluster_address;
|
||||
SET GLOBAL WSREP_ON=0;
|
||||
@@ -26,11 +27,37 @@ SELECT 1;
|
||||
1
|
||||
1
|
||||
DELETE FROM mysql.wsrep_allowlist;
|
||||
connection node_1;
|
||||
SET GLOBAL wsrep_provider_options ='pc.ignore_sb=true';
|
||||
connection node_2;
|
||||
Killing server ...
|
||||
connection node_1;
|
||||
SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log;
|
||||
EXPECT_0
|
||||
0
|
||||
SELECT COUNT(*) AS EXPECT_1 FROM mysql.wsrep_cluster;
|
||||
EXPECT_1
|
||||
1
|
||||
SELECT COUNT(*) AS EXPECT_1 FROM mysql.wsrep_cluster_members;
|
||||
EXPECT_1
|
||||
1
|
||||
connection node_2;
|
||||
connection node_1;
|
||||
SET GLOBAL wsrep_provider_options ='pc.ignore_sb=false';
|
||||
SET GLOBAL wsrep_provider_options ='pc.ignore_sb=false;pc.weight=1';
|
||||
SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log;
|
||||
EXPECT_0
|
||||
0
|
||||
SELECT COUNT(*) AS EXPECT_1 FROM mysql.wsrep_cluster;
|
||||
EXPECT_1
|
||||
1
|
||||
SELECT COUNT(*) AS EXPECT_2 FROM mysql.wsrep_cluster_members;
|
||||
EXPECT_2
|
||||
2
|
||||
connection node_2;
|
||||
SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log;
|
||||
EXPECT_0
|
||||
0
|
||||
SELECT COUNT(*) AS EXPECT_1 FROM mysql.wsrep_cluster;
|
||||
EXPECT_1
|
||||
1
|
||||
SELECT COUNT(*) AS EXPECT_2 FROM mysql.wsrep_cluster_members;
|
||||
EXPECT_2
|
||||
2
|
||||
|
@@ -90,7 +90,7 @@ set global wsrep_on=OFF;
|
||||
reset master;
|
||||
set global wsrep_on=ON;
|
||||
connection node_2;
|
||||
CALL mtr.add_suppression("Ignoring server id for non bootstrap node");
|
||||
CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node");
|
||||
disconnect node_2;
|
||||
disconnect node_1;
|
||||
# End of test
|
||||
|
@@ -19,4 +19,4 @@ select wsrep_last_written_gtid();
|
||||
drop table t1;
|
||||
|
||||
--connection node_2
|
||||
CALL mtr.add_suppression("Ignoring server id for non bootstrap node");
|
||||
CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node");
|
||||
|
@@ -48,4 +48,4 @@ CREATE TABLE ts1 AS SELECT * FROM t1;
|
||||
|
||||
DROP TABLE t1,ts1;
|
||||
|
||||
CALL mtr.add_suppression("Ignoring server id for non bootstrap node");
|
||||
CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node");
|
||||
|
@@ -1,5 +1,7 @@
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_debug.inc
|
||||
--source include/have_debug_sync.inc
|
||||
--source include/galera_have_debug_sync.inc
|
||||
|
||||
#
|
||||
|
@@ -3,7 +3,7 @@
|
||||
--connection node_1
|
||||
select @@gtid_domain_id, @@server_id, @@wsrep_gtid_domain_id,@@wsrep_gtid_mode;
|
||||
--connection node_2
|
||||
call mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node\\.");
|
||||
call mtr.add_suppression("WSREP: Ignoring server id .* for non bootstrap node");
|
||||
select @@gtid_domain_id, @@server_id, @@wsrep_gtid_domain_id,@@wsrep_gtid_mode;
|
||||
|
||||
--connection node_1
|
||||
|
@@ -92,4 +92,4 @@ SET GLOBAL wsrep_on=ON;
|
||||
reset master;
|
||||
|
||||
--connection node_2
|
||||
CALL mtr.add_suppression("Ignoring server id for non bootstrap node");
|
||||
CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node");
|
||||
|
@@ -199,4 +199,4 @@ set global wsrep_on=ON;
|
||||
reset master;
|
||||
|
||||
--connection node_2
|
||||
CALL mtr.add_suppression("Ignoring server id for non bootstrap node");
|
||||
CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node");
|
||||
|
@@ -53,4 +53,4 @@ SELECT @@gtid_binlog_state;
|
||||
SELECT @@gtid_binlog_state;
|
||||
DROP TABLE t1;
|
||||
|
||||
CALL mtr.add_suppression("Ignoring server id for non bootstrap node");
|
||||
CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node");
|
||||
|
@@ -66,4 +66,4 @@ SET AUTOCOMMIT=ON;
|
||||
DROP TABLE t1;
|
||||
|
||||
--connection node_2
|
||||
CALL mtr.add_suppression("Ignoring server id for non bootstrap node");
|
||||
CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node");
|
||||
|
@@ -22,9 +22,9 @@
|
||||
--connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4
|
||||
|
||||
--connection node_2
|
||||
call mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node\\.");
|
||||
call mtr.add_suppression("WSREP: Ignoring server id .* for non bootstrap node");
|
||||
--connection node_4
|
||||
call mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node\\.");
|
||||
call mtr.add_suppression("WSREP: Ignoring server id .* for non bootstrap node");
|
||||
|
||||
--connection node_3
|
||||
|
||||
|
@@ -3,6 +3,7 @@
|
||||
#
|
||||
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_debug.inc
|
||||
--source include/have_debug_sync.inc
|
||||
|
||||
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
|
||||
@@ -72,4 +73,4 @@ INSERT INTO t1 VALUES (2);
|
||||
DROP TABLE t1;
|
||||
|
||||
--connection node_2
|
||||
CALL mtr.add_suppression("Ignoring server id for non bootstrap node");
|
||||
CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node");
|
||||
|
@@ -60,7 +60,7 @@ reset master;
|
||||
set global wsrep_on=ON;
|
||||
|
||||
--connection node_2
|
||||
CALL mtr.add_suppression("Ignoring server id for non bootstrap node");
|
||||
CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node");
|
||||
|
||||
--source include/galera_end.inc
|
||||
--echo # End of test
|
||||
|
@@ -259,6 +259,9 @@ CREATE TABLE t1 (f1 INTEGER, f2 INTEGER);
|
||||
DROP TABLE t1;
|
||||
|
||||
--connection node_2
|
||||
set session wsrep_sync_wait=0;
|
||||
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'
|
||||
--source include/wait_condition.inc
|
||||
--error ER_NO_SUCH_TABLE
|
||||
SELECT * FROM t1;
|
||||
SET GLOBAL wsrep_ignore_apply_errors = 10;
|
||||
|
@@ -6,8 +6,9 @@
|
||||
--source include/auto_increment_offset_save.inc
|
||||
|
||||
--connection node_1
|
||||
call mtr.add_suppression("WSREP: async IST sender failed to serve.*");
|
||||
call mtr.add_suppression("WSREP:.*");
|
||||
SET @wsrep_provider_options_orig = @@GLOBAL.wsrep_provider_options;
|
||||
SET GLOBAL wsrep_provider_options ='pc.ignore_sb=true;pc.weight=2';
|
||||
|
||||
--connection node_2
|
||||
SET @wsrep_cluster_address_orig = @@GLOBAL.wsrep_cluster_address;
|
||||
@@ -21,16 +22,15 @@ INSERT INTO mysql.wsrep_allowlist (ip) VALUES (0);
|
||||
SET GLOBAL wsrep_cluster_address = @wsrep_cluster_address_orig;
|
||||
SELECT 1;
|
||||
DELETE FROM mysql.wsrep_allowlist;
|
||||
|
||||
--connection node_1
|
||||
SET GLOBAL wsrep_provider_options ='pc.ignore_sb=true';
|
||||
|
||||
--connection node_2
|
||||
--source include/kill_galera.inc
|
||||
|
||||
--connection node_1
|
||||
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
|
||||
--source include/wait_condition.inc
|
||||
SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log;
|
||||
SELECT COUNT(*) AS EXPECT_1 FROM mysql.wsrep_cluster;
|
||||
SELECT COUNT(*) AS EXPECT_1 FROM mysql.wsrep_cluster_members;
|
||||
|
||||
--connection node_2
|
||||
--source include/start_mysqld.inc
|
||||
@@ -39,7 +39,15 @@ SET GLOBAL wsrep_provider_options ='pc.ignore_sb=true';
|
||||
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
|
||||
--source include/wait_condition.inc
|
||||
|
||||
SET GLOBAL wsrep_provider_options ='pc.ignore_sb=false';
|
||||
SET GLOBAL wsrep_provider_options ='pc.ignore_sb=false;pc.weight=1';
|
||||
SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log;
|
||||
SELECT COUNT(*) AS EXPECT_1 FROM mysql.wsrep_cluster;
|
||||
SELECT COUNT(*) AS EXPECT_2 FROM mysql.wsrep_cluster_members;
|
||||
|
||||
--connection node_2
|
||||
SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log;
|
||||
SELECT COUNT(*) AS EXPECT_1 FROM mysql.wsrep_cluster;
|
||||
SELECT COUNT(*) AS EXPECT_2 FROM mysql.wsrep_cluster_members;
|
||||
|
||||
# Cleanup
|
||||
--source include/auto_increment_offset_restore.inc
|
||||
|
@@ -60,7 +60,7 @@ reset master;
|
||||
set global wsrep_on=ON;
|
||||
|
||||
--connection node_2
|
||||
CALL mtr.add_suppression("Ignoring server id for non bootstrap node");
|
||||
CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node");
|
||||
|
||||
--source include/galera_end.inc
|
||||
--echo # End of test
|
||||
|
@@ -56,7 +56,7 @@ connection node_1;
|
||||
set global wsrep_gtid_domain_id=100;
|
||||
connection node_2;
|
||||
set global wsrep_gtid_domain_id=100;
|
||||
CALL mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node\\.");
|
||||
CALL mtr.add_suppression("WSREP: Ignoring server id .* for non bootstrap node");
|
||||
connection node_3;
|
||||
set global wsrep_gtid_domain_id=100;
|
||||
CALL mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node\\.");
|
||||
CALL mtr.add_suppression("WSREP: Ignoring server id .* for non bootstrap node");
|
||||
|
@@ -75,19 +75,19 @@ connection node_2;
|
||||
SET GLOBAL wsrep_on = OFF;
|
||||
RESET MASTER;
|
||||
SET GLOBAL wsrep_on = ON;
|
||||
CALL mtr.add_suppression("Ignoring server id for non bootstrap node");
|
||||
CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node");
|
||||
connection node_3;
|
||||
SET GLOBAL wsrep_on = OFF;
|
||||
RESET MASTER;
|
||||
SET GLOBAL wsrep_on = ON;
|
||||
CALL mtr.add_suppression("Ignoring server id for non bootstrap node");
|
||||
CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node");
|
||||
connection node_5;
|
||||
SET GLOBAL wsrep_on = OFF;
|
||||
RESET MASTER;
|
||||
SET GLOBAL wsrep_on = ON;
|
||||
CALL mtr.add_suppression("Ignoring server id for non bootstrap node");
|
||||
CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node");
|
||||
connection node_6;
|
||||
SET GLOBAL wsrep_on = OFF;
|
||||
RESET MASTER;
|
||||
SET GLOBAL wsrep_on = ON;
|
||||
CALL mtr.add_suppression("Ignoring server id for non bootstrap node");
|
||||
CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node");
|
||||
|
@@ -12,16 +12,10 @@ connection node_3;
|
||||
Suspending node ...
|
||||
connection node_1;
|
||||
SET SESSION wsrep_sync_wait=0;
|
||||
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
VARIABLE_VALUE = 2
|
||||
1
|
||||
CREATE TABLE t1 (f1 INTEGER) engine=InnoDB;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
connection node_2;
|
||||
SET SESSION wsrep_sync_wait=0;
|
||||
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
VARIABLE_VALUE = 2
|
||||
1
|
||||
SET SESSION wsrep_sync_wait = 15;
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
|
@@ -199,12 +199,12 @@ SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
1950
|
||||
connection node_2;
|
||||
call mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node");
|
||||
call mtr.add_suppression("WSREP: Ignoring server id .* for non bootstrap node");
|
||||
call mtr.add_suppression("Sending JOIN failed: ");
|
||||
call mtr.add_suppression("WSREP: Failed to JOIN the cluster after SST");
|
||||
call mtr.add_suppression("WSREP: FLOW message from member .* in non-primary configuration");
|
||||
connection node_3;
|
||||
call mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node");
|
||||
call mtr.add_suppression("WSREP: Ignoring server id .* for non bootstrap node");
|
||||
call mtr.add_suppression("Sending JOIN failed: ");
|
||||
call mtr.add_suppression("WSREP: Failed to JOIN the cluster after SST");
|
||||
call mtr.add_suppression("WSREP: FLOW message from member .* in non-primary configuration");
|
||||
|
@@ -119,8 +119,8 @@ set global wsrep_gtid_domain_id=100;
|
||||
|
||||
--connection node_2
|
||||
set global wsrep_gtid_domain_id=100;
|
||||
CALL mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node\\.");
|
||||
CALL mtr.add_suppression("WSREP: Ignoring server id .* for non bootstrap node");
|
||||
|
||||
--connection node_3
|
||||
set global wsrep_gtid_domain_id=100;
|
||||
CALL mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node\\.");
|
||||
CALL mtr.add_suppression("WSREP: Ignoring server id .* for non bootstrap node");
|
||||
|
@@ -129,7 +129,7 @@ SET GLOBAL wsrep_on = OFF;
|
||||
RESET MASTER;
|
||||
SET GLOBAL wsrep_on = ON;
|
||||
|
||||
CALL mtr.add_suppression("Ignoring server id for non bootstrap node");
|
||||
CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node");
|
||||
|
||||
--connection node_3
|
||||
|
||||
@@ -137,7 +137,7 @@ SET GLOBAL wsrep_on = OFF;
|
||||
RESET MASTER;
|
||||
SET GLOBAL wsrep_on = ON;
|
||||
|
||||
CALL mtr.add_suppression("Ignoring server id for non bootstrap node");
|
||||
CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node");
|
||||
|
||||
--connection node_5
|
||||
|
||||
@@ -145,7 +145,7 @@ SET GLOBAL wsrep_on = OFF;
|
||||
RESET MASTER;
|
||||
SET GLOBAL wsrep_on = ON;
|
||||
|
||||
CALL mtr.add_suppression("Ignoring server id for non bootstrap node");
|
||||
CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node");
|
||||
|
||||
--connection node_6
|
||||
|
||||
@@ -153,4 +153,4 @@ SET GLOBAL wsrep_on = OFF;
|
||||
RESET MASTER;
|
||||
SET GLOBAL wsrep_on = ON;
|
||||
|
||||
CALL mtr.add_suppression("Ignoring server id for non bootstrap node");
|
||||
CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node");
|
||||
|
@@ -18,6 +18,9 @@
|
||||
--source ../galera/include/auto_increment_offset_save.inc
|
||||
|
||||
--connection node_1
|
||||
--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--let $wsrep_provider_options_node1 = `SELECT @@wsrep_provider_options`
|
||||
SET GLOBAL wsrep_provider_options = 'evs.inactive_timeout=PT100M; evs.suspect_timeout=PT1S';
|
||||
|
||||
@@ -26,20 +29,20 @@ SET GLOBAL wsrep_provider_options = 'evs.inactive_timeout=PT100M; evs.suspect_ti
|
||||
SET GLOBAL wsrep_provider_options = 'evs.inactive_timeout=PT100M; evs.suspect_timeout=PT1S';
|
||||
|
||||
--connection node_3
|
||||
--source include/wait_until_connected_again.inc
|
||||
--let $wsrep_cluster_address_node3 = `SELECT @@wsrep_cluster_address`
|
||||
--let $wsrep_provider_options_node3 = `SELECT @@wsrep_provider_options`
|
||||
|
||||
# Suspend node #3
|
||||
--connection node_3
|
||||
--source include/galera_suspend.inc
|
||||
--sleep 5
|
||||
|
||||
# Confirm that the other nodes have booted it out
|
||||
|
||||
--connection node_1
|
||||
--source include/wait_until_connected_again.inc
|
||||
SET SESSION wsrep_sync_wait=0;
|
||||
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--disable_query_log
|
||||
--eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_node1';
|
||||
--enable_query_log
|
||||
@@ -49,9 +52,10 @@ CREATE TABLE t1 (f1 INTEGER) engine=InnoDB;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
|
||||
--connection node_2
|
||||
--source include/wait_until_connected_again.inc
|
||||
SET SESSION wsrep_sync_wait=0;
|
||||
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--disable_query_log
|
||||
--eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_node2';
|
||||
--enable_query_log
|
||||
@@ -67,6 +71,7 @@ SELECT COUNT(*) FROM t1;
|
||||
--source include/wait_until_connected_again.inc
|
||||
|
||||
--disable_query_log
|
||||
--eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_node3';
|
||||
--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_node3';
|
||||
--enable_query_log
|
||||
--source include/galera_wait_ready.inc
|
||||
@@ -78,6 +83,9 @@ SET SESSION wsrep_sync_wait = 15;
|
||||
SELECT COUNT(*) FROM t1;
|
||||
|
||||
--connection node_1
|
||||
--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
|
||||
--source include/wait_condition.inc
|
||||
|
||||
DROP TABLE t1;
|
||||
# Restore original auto_increment_offset values.
|
||||
--source ../galera/include/auto_increment_offset_restore.inc
|
||||
|
@@ -343,12 +343,12 @@ SELECT COUNT(*) FROM t1;
|
||||
# cleanups
|
||||
#
|
||||
--connection node_2
|
||||
call mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node");
|
||||
call mtr.add_suppression("WSREP: Ignoring server id .* for non bootstrap node");
|
||||
call mtr.add_suppression("Sending JOIN failed: ");
|
||||
call mtr.add_suppression("WSREP: Failed to JOIN the cluster after SST");
|
||||
call mtr.add_suppression("WSREP: FLOW message from member .* in non-primary configuration");
|
||||
--connection node_3
|
||||
call mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node");
|
||||
call mtr.add_suppression("WSREP: Ignoring server id .* for non bootstrap node");
|
||||
call mtr.add_suppression("Sending JOIN failed: ");
|
||||
call mtr.add_suppression("WSREP: Failed to JOIN the cluster after SST");
|
||||
call mtr.add_suppression("WSREP: FLOW message from member .* in non-primary configuration");
|
||||
|
@@ -37,8 +37,6 @@ f1 f2
|
||||
SET SESSION wsrep_trx_fragment_size = 10000;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUE (10, 'node1');
|
||||
SELECT * FROM mysql.wsrep_streaming_log;
|
||||
node_uuid trx_id seqno flags frag
|
||||
connection node_1a;
|
||||
INSERT INTO t1 VALUES(15, 'node2');
|
||||
connection node_1;
|
||||
@@ -47,6 +45,7 @@ f1 f2
|
||||
1 node1
|
||||
5 node2
|
||||
10 node1
|
||||
15 node2
|
||||
INSERT INTO t1 VALUES(15, 'node1');
|
||||
ERROR 23000: Duplicate entry '15' for key 'PRIMARY'
|
||||
COMMIT;
|
||||
|
9
mysql-test/suite/galera_sr/r/MDEV-35281.result
Normal file
9
mysql-test/suite/galera_sr/r/MDEV-35281.result
Normal file
@@ -0,0 +1,9 @@
|
||||
connection node_2;
|
||||
connection node_1;
|
||||
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
|
||||
SET SESSION wsrep_trx_fragment_size=1;
|
||||
SET SESSION innodb_snapshot_isolation=ON;
|
||||
START TRANSACTION WITH CONSISTENT SNAPSHOT;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
COMMIT;
|
||||
DROP TABLE t1;
|
@@ -5,7 +5,7 @@ connection node_1;
|
||||
CREATE TABLE t1(f1 INT PRIMARY KEY) ENGINE=INNODB;
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
connection node_2;
|
||||
call mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node\\.");
|
||||
call mtr.add_suppression("WSREP: Ignoring server id .* for non bootstrap node");
|
||||
SELECT * FROM t1;
|
||||
f1
|
||||
1
|
||||
|
@@ -61,7 +61,6 @@ SET SESSION wsrep_trx_fragment_size = 10000;
|
||||
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUE (10, 'node1');
|
||||
SELECT * FROM mysql.wsrep_streaming_log;
|
||||
|
||||
--connection node_1a
|
||||
INSERT INTO t1 VALUES(15, 'node2');
|
||||
|
37
mysql-test/suite/galera_sr/t/MDEV-35281.test
Normal file
37
mysql-test/suite/galera_sr/t/MDEV-35281.test
Normal file
@@ -0,0 +1,37 @@
|
||||
#
|
||||
# MDEV-35281 - SR transaction crashes with innodb_snapshot_isolation
|
||||
#
|
||||
# Test outline: a simple SR transaction fails to remove
|
||||
# its fragments from streaming_log table, with error
|
||||
# HA_ERR_RECORD_CHANGED.
|
||||
# This happens with the following sequence of events:
|
||||
# 1. Start a streaming replication transaction
|
||||
# 2. The transaction creates a read view in InnoDB
|
||||
# (this must happen before a fragment is replicated)
|
||||
# 3. The transaction replicates a fragment.
|
||||
# Internally, a new transaction is created to INSERT
|
||||
# a row representing the fragment into the streaming_log
|
||||
# table and is committed immediately.
|
||||
# 4. The streaming replication transaction COMMITs.
|
||||
# Before committing, the transaction replicates
|
||||
# a commit fragment and DELETEs its fragments that
|
||||
# were created in the streaming_log table.
|
||||
# If bug is present, fragment removal from the
|
||||
# streaming_log table violates snapshot isolation,
|
||||
# thus the operation fails with HA_ERR_RECORD_CHANGED.
|
||||
# (One or more records from the streaming_log table
|
||||
# are removed, while these were not visible to
|
||||
# the transaction).
|
||||
|
||||
--source include/galera_cluster.inc
|
||||
|
||||
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
|
||||
|
||||
SET SESSION wsrep_trx_fragment_size=1;
|
||||
SET SESSION innodb_snapshot_isolation=ON;
|
||||
|
||||
START TRANSACTION WITH CONSISTENT SNAPSHOT;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
COMMIT;
|
||||
|
||||
DROP TABLE t1;
|
@@ -13,7 +13,7 @@ CREATE TABLE t1(f1 INT PRIMARY KEY) ENGINE=INNODB;
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
|
||||
--connection node_2
|
||||
call mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node\\.");
|
||||
call mtr.add_suppression("WSREP: Ignoring server id .* for non bootstrap node");
|
||||
SELECT * FROM t1;
|
||||
|
||||
--connection node_1
|
||||
|
12
mysql-test/suite/innodb/r/innochecksum_undo_page.result
Normal file
12
mysql-test/suite/innodb/r/innochecksum_undo_page.result
Normal file
@@ -0,0 +1,12 @@
|
||||
SET GLOBAL INNODB_FILE_PER_TABLE= 0;
|
||||
Warnings:
|
||||
Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
|
||||
CREATE TABLE t1(f1 INT NOT NULL)ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(1);
|
||||
DROP TABLE t1;
|
||||
SET GLOBAL innodb_fast_shutdown=0;
|
||||
# Run the innochecksum to display undo log pages
|
||||
FOUND 1 /Undo page state: 0 active, [0-9]+ cached, [0-9]+ to_purge, [0-9]+ prepared, [0-9]+ other/ in result.log
|
||||
# Run the innochecksum with --skip-freed-pages
|
||||
FOUND 1 /Undo page state: 0 active, 0 cached, 0 to_purge, 0 prepared, 0 other/ in result.log
|
||||
# restart
|
16
mysql-test/suite/innodb/r/innodb-replace,INPLACE.rdiff
Normal file
16
mysql-test/suite/innodb/r/innodb-replace,INPLACE.rdiff
Normal file
@@ -0,0 +1,16 @@
|
||||
--- innodb-replace.result
|
||||
+++ innodb-replace,INPLACE.result
|
||||
@@ -31,10 +31,10 @@
|
||||
REPLACE INTO t1 (c1,c2,c3) VALUES (0,1,b'11');
|
||||
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME IN ('HANDLER_DELETE','HANDLER_WRITE','HANDLER_READ_KEY','HANDLER_UPDATE');
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
-HANDLER_DELETE 1
|
||||
+HANDLER_DELETE 2
|
||||
HANDLER_READ_KEY 2
|
||||
-HANDLER_UPDATE 1
|
||||
-HANDLER_WRITE 2
|
||||
+HANDLER_UPDATE 0
|
||||
+HANDLER_WRITE 3
|
||||
SELECT * FROM t1;
|
||||
c1 c2 c3
|
||||
0 1
|
@@ -11,3 +11,53 @@ ERROR HY000: DELAYED option not supported for table 't1'
|
||||
select * from t1;
|
||||
c1 c2 stamp
|
||||
drop table t1;
|
||||
#
|
||||
# MDEV-35115 Inconsistent Replace behaviour when multiple
|
||||
# unique index exist
|
||||
#
|
||||
CREATE TABLE t1 (c1 NUMERIC UNSIGNED NOT NULL,
|
||||
c2 INT3 UNIQUE,
|
||||
c3 BIT(2) PRIMARY KEY)ENGINE=InnoDB;
|
||||
ALTER TABLE t1 ADD UNIQUE INDEX(c1);
|
||||
INSERT INTO t1 (c1,c2,c3) VALUES (0,0,b'01');
|
||||
INSERT INTO t1 (c1,c2,c3) VALUES (1,1,b'10');
|
||||
FLUSH STATUS;
|
||||
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME IN ('HANDLER_DELETE','HANDLER_WRITE','HANDLER_READ_KEY','HANDLER_UPDATE');
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
HANDLER_DELETE 0
|
||||
HANDLER_READ_KEY 0
|
||||
HANDLER_UPDATE 0
|
||||
HANDLER_WRITE 0
|
||||
REPLACE INTO t1 (c1,c2,c3) VALUES (0,1,b'11');
|
||||
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME IN ('HANDLER_DELETE','HANDLER_WRITE','HANDLER_READ_KEY','HANDLER_UPDATE');
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
HANDLER_DELETE 1
|
||||
HANDLER_READ_KEY 2
|
||||
HANDLER_UPDATE 1
|
||||
HANDLER_WRITE 2
|
||||
SELECT * FROM t1;
|
||||
c1 c2 c3
|
||||
0 1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (f1 INT NOT NULL PRIMARY KEY,
|
||||
f2 INT, f3 INT, f4 INT,
|
||||
UNIQUE INDEX i1(f2))ENGINE=InnoDB;
|
||||
ALTER TABLE t1 ADD INDEX i3(f4);
|
||||
ALTER TABLE t1 ADD UNIQUE INDEX i2(f3);
|
||||
INSERT INTO t1 VALUES (0,0,0,0);
|
||||
INSERT INTO t1 VALUES (1,1,1,1);
|
||||
FLUSH STATUS;
|
||||
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME IN ('HANDLER_DELETE','HANDLER_WRITE','HANDLER_READ_KEY','HANDLER_UPDATE');
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
HANDLER_DELETE 0
|
||||
HANDLER_READ_KEY 0
|
||||
HANDLER_UPDATE 0
|
||||
HANDLER_WRITE 0
|
||||
REPLACE INTO t1 VALUES (0,0,1,1);
|
||||
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME IN ('HANDLER_DELETE','HANDLER_WRITE','HANDLER_READ_KEY','HANDLER_UPDATE');
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
HANDLER_DELETE 1
|
||||
HANDLER_READ_KEY 2
|
||||
HANDLER_UPDATE 1
|
||||
HANDLER_WRITE 2
|
||||
DROP TABLE t1;
|
||||
|
@@ -49,7 +49,6 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
|
||||
WHERE engine = 'innodb'
|
||||
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
||||
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
|
||||
FOUND 1 /InnoDB: Could not measure the size of single-table tablespace file '.*test/t2\.ibd'/ in mysqld.1.err
|
||||
# restart
|
||||
SELECT * FROM INFORMATION_SCHEMA.ENGINES
|
||||
WHERE engine = 'innodb'
|
||||
|
@@ -58,5 +58,13 @@ COUNT(*) LENGTH(b)
|
||||
SHOW VARIABLES LIKE 'innodb_log_file_size';
|
||||
Variable_name Value
|
||||
innodb_log_file_size 5242880
|
||||
FOUND 1 /InnoDB: Resized log to 5\.000MiB/ in mysqld.1.err
|
||||
SET GLOBAL innodb_log_file_size=6291456;
|
||||
SHOW VARIABLES LIKE 'innodb_log_file_size';
|
||||
Variable_name Value
|
||||
innodb_log_file_size 6291456
|
||||
SET GLOBAL innodb_log_file_size=5242880;
|
||||
SHOW VARIABLES LIKE 'innodb_log_file_size';
|
||||
Variable_name Value
|
||||
innodb_log_file_size 5242880
|
||||
FOUND 1 /InnoDB: Resized log to 6\.000MiB/ in mysqld.1.err
|
||||
DROP TABLE t;
|
||||
|
36
mysql-test/suite/innodb/r/purge_pessimistic.result
Normal file
36
mysql-test/suite/innodb/r/purge_pessimistic.result
Normal file
@@ -0,0 +1,36 @@
|
||||
#
|
||||
# MDEV-35508: Race condition between purge and secondary index INSERT or UPDATE
|
||||
#
|
||||
SET @old_debug_dbug = @@global.debug_dbug;
|
||||
CREATE TABLE t1(col1 INT PRIMARY KEY, col2 int, KEY k1(col2)) ENGINE=Innodb;
|
||||
INSERT INTO t1 VALUES(1, 100);
|
||||
CREATE TABLE t2(col1 INT PRIMARY KEY) Engine=Innodb;
|
||||
InnoDB 0 transactions not purged
|
||||
START TRANSACTION;
|
||||
INSERT INTO t2 VALUES(10);
|
||||
SET DEBUG_SYNC='RESET';
|
||||
SET GLOBAL debug_dbug= "+d,btr_force_pessimistic_delete";
|
||||
SET GLOBAL debug_dbug= "+d,enable_row_purge_sec_tree_sync";
|
||||
connect con1,localhost,root;
|
||||
UPDATE t1 SET col2 = 200 WHERE col1 = 1;
|
||||
connection default;
|
||||
SET DEBUG_SYNC= 'now WAIT_FOR purge_sec_tree_begin';
|
||||
SET GLOBAL debug_dbug= "-d,enable_row_purge_sec_tree_sync";
|
||||
UPDATE t1 SET col2 = 100 WHERE col1 = 1;
|
||||
SET DEBUG_SYNC= 'now SIGNAL purge_sec_tree_execute';
|
||||
COMMIT;
|
||||
InnoDB 0 transactions not purged
|
||||
disconnect con1;
|
||||
SELECT * FROM t1;
|
||||
col1 col2
|
||||
1 100
|
||||
CHECK TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
DROP TABLE t1;
|
||||
SELECT * FROM t2;
|
||||
col1
|
||||
10
|
||||
DROP TABLE t2;
|
||||
SET @@GLOBAL.debug_dbug = @old_debug_dbug;
|
||||
SET DEBUG_SYNC='RESET';
|
1
mysql-test/suite/innodb/t/innochecksum_undo_page.opt
Normal file
1
mysql-test/suite/innodb/t/innochecksum_undo_page.opt
Normal file
@@ -0,0 +1 @@
|
||||
--innodb_undo_tablespaces=0
|
27
mysql-test/suite/innodb/t/innochecksum_undo_page.test
Normal file
27
mysql-test/suite/innodb/t/innochecksum_undo_page.test
Normal file
@@ -0,0 +1,27 @@
|
||||
--source include/have_innodb.inc
|
||||
--source include/not_embedded.inc
|
||||
let MYSQLD_DATADIR= `SELECT @@datadir`;
|
||||
|
||||
SET GLOBAL INNODB_FILE_PER_TABLE= 0;
|
||||
CREATE TABLE t1(f1 INT NOT NULL)ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(1);
|
||||
DROP TABLE t1;
|
||||
SET GLOBAL innodb_fast_shutdown=0;
|
||||
--source include/shutdown_mysqld.inc
|
||||
|
||||
--echo # Run the innochecksum to display undo log pages
|
||||
let $resultlog=$MYSQLTEST_VARDIR/tmp/result.log;
|
||||
let SEARCH_FILE = $MYSQLTEST_VARDIR/tmp/result.log;
|
||||
let SEARCH_ABORT = NOT FOUND;
|
||||
exec $INNOCHECKSUM -S $MYSQLD_DATADIR/ibdata1 > $resultlog;
|
||||
# Expected > 0 cached undo log pages, but can't guarantee it because
|
||||
# the writes of freed pages may be optimized while flushing
|
||||
let SEARCH_PATTERN= Undo page state: 0 active, [0-9]+ cached, [0-9]+ to_purge, [0-9]+ prepared, [0-9]+ other;
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--echo # Run the innochecksum with --skip-freed-pages
|
||||
exec $INNOCHECKSUM -S -r $MYSQLD_DATADIR/ibdata1 > $resultlog;
|
||||
let SEARCH_PATTERN= Undo page state: 0 active, 0 cached, 0 to_purge, 0 prepared, 0 other;
|
||||
--source include/search_pattern_in_file.inc
|
||||
--remove_file $resultlog
|
||||
--source include/start_mysqld.inc
|
2
mysql-test/suite/innodb/t/innodb-replace.combinations
Normal file
2
mysql-test/suite/innodb/t/innodb-replace.combinations
Normal file
@@ -0,0 +1,2 @@
|
||||
[COPY]
|
||||
[INPLACE]
|
@@ -20,3 +20,67 @@ select * from t1;
|
||||
drop table t1;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-35115 Inconsistent Replace behaviour when multiple
|
||||
--echo # unique index exist
|
||||
--echo #
|
||||
let $get_handler_status_counts= SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME IN ('HANDLER_DELETE','HANDLER_WRITE','HANDLER_READ_KEY','HANDLER_UPDATE');
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
let $algorithm=`select regexp_replace('$MTR_COMBINATIONS', 'innodb,\|,innodb', '')`;
|
||||
|
||||
CREATE TABLE t1 (c1 NUMERIC UNSIGNED NOT NULL,
|
||||
c2 INT3 UNIQUE,
|
||||
c3 BIT(2) PRIMARY KEY)ENGINE=InnoDB;
|
||||
|
||||
replace_result ,ALGORITHM=COPY '' ,ALGORITHM=INPLACE '';
|
||||
eval ALTER TABLE t1 ADD UNIQUE INDEX(c1),ALGORITHM=$algorithm;
|
||||
INSERT INTO t1 (c1,c2,c3) VALUES (0,0,b'01');
|
||||
INSERT INTO t1 (c1,c2,c3) VALUES (1,1,b'10');
|
||||
|
||||
FLUSH STATUS;
|
||||
|
||||
--disable_ps2_protocol
|
||||
eval $get_handler_status_counts;
|
||||
--enable_ps2_protocol
|
||||
|
||||
# INPLACE algorithm appends the index, so unique index
|
||||
# reordering happened between innodb and .frm file. This
|
||||
# lead to deletion of 2 existing rows for the replace statement
|
||||
|
||||
# COPY algorithm does table rebuild everytime. No reordering
|
||||
# happened in this case. This lead to 1 deletion of record
|
||||
# and 1 update on the existing record
|
||||
REPLACE INTO t1 (c1,c2,c3) VALUES (0,1,b'11');
|
||||
|
||||
--disable_ps2_protocol
|
||||
eval $get_handler_status_counts;
|
||||
--enable_ps2_protocol
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (f1 INT NOT NULL PRIMARY KEY,
|
||||
f2 INT, f3 INT, f4 INT,
|
||||
UNIQUE INDEX i1(f2))ENGINE=InnoDB;
|
||||
replace_result ,ALGORITHM=COPY '' ,ALGORITHM=INPLACE '';
|
||||
eval ALTER TABLE t1 ADD INDEX i3(f4),ALGORITHM=$algorithm;
|
||||
|
||||
replace_result ,ALGORITHM=COPY '' ,ALGORITHM=INPLACE '';
|
||||
eval ALTER TABLE t1 ADD UNIQUE INDEX i2(f3),ALGORITHM=$algorithm;
|
||||
|
||||
INSERT INTO t1 VALUES (0,0,0,0);
|
||||
INSERT INTO t1 VALUES (1,1,1,1);
|
||||
|
||||
FLUSH STATUS;
|
||||
--disable_ps2_protocol
|
||||
eval $get_handler_status_counts;
|
||||
--enable_ps2_protocol
|
||||
|
||||
REPLACE INTO t1 VALUES (0,0,1,1);
|
||||
|
||||
--disable_ps2_protocol
|
||||
eval $get_handler_status_counts;
|
||||
--enable_ps2_protocol
|
||||
|
||||
DROP TABLE t1;
|
||||
|
@@ -92,7 +92,6 @@ let SEARCH_PATTERN= InnoDB: Set innodb_force_recovery=1 to ignore this and to pe
|
||||
|
||||
--source include/start_mysqld.inc
|
||||
eval $check_no_innodb;
|
||||
--let $on_linux= `select @@version_compile_os LIKE 'Linux%'`
|
||||
--source include/shutdown_mysqld.inc
|
||||
|
||||
let SEARCH_PATTERN= InnoDB: Tablespace \d+ was not found at .*t[12].ibd.
|
||||
@@ -107,17 +106,14 @@ let SEARCH_PATTERN= InnoDB: Tablespace \d+ was not found at .*t[12].ibd.
|
||||
eval $check_no_innodb;
|
||||
--source include/shutdown_mysqld.inc
|
||||
|
||||
--let SEARCH_PATTERN= InnoDB: Could not measure the size of single-table tablespace file '.*test/t2\\.ibd'
|
||||
if (!$on_linux)
|
||||
{
|
||||
# os_file_get_size() would succeed on a directory.
|
||||
--echo FOUND 1 /$SEARCH_PATTERN/ in mysqld.1.err
|
||||
}
|
||||
if ($on_linux)
|
||||
{
|
||||
# lseek() reports EINVAL when invoked on a directory.
|
||||
--source include/search_pattern_in_file.inc
|
||||
}
|
||||
# On Linux, lseek() would typically report EINVAL when invoked on a directory.
|
||||
# On other plaftorms as well as some GNU/Linux based environments, such as
|
||||
# a Ubuntu 22.04 based image on Amazon Web Services,
|
||||
# os_file_get_size() would succeed on a directory, and we would get another
|
||||
# error about inability to apply log to a corrupted page.
|
||||
|
||||
#--let SEARCH_PATTERN= InnoDB: Could not measure the size of single-table tablespace file '.*test/t2\\.ibd'
|
||||
#--source include/search_pattern_in_file.inc
|
||||
|
||||
--rmdir $MYSQLD_DATADIR/test/t2.ibd
|
||||
|
||||
|
@@ -60,7 +60,11 @@ SELECT * FROM t WHERE a<10;
|
||||
SELECT COUNT(*),LENGTH(b) FROM t GROUP BY b;
|
||||
|
||||
SHOW VARIABLES LIKE 'innodb_log_file_size';
|
||||
let SEARCH_PATTERN = InnoDB: Resized log to 5\\.000MiB;
|
||||
SET GLOBAL innodb_log_file_size=6291456;
|
||||
SHOW VARIABLES LIKE 'innodb_log_file_size';
|
||||
SET GLOBAL innodb_log_file_size=5242880;
|
||||
SHOW VARIABLES LIKE 'innodb_log_file_size';
|
||||
let SEARCH_PATTERN = InnoDB: Resized log to 6\\.000MiB;
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
DROP TABLE t;
|
||||
|
1
mysql-test/suite/innodb/t/purge_pessimistic.opt
Normal file
1
mysql-test/suite/innodb/t/purge_pessimistic.opt
Normal file
@@ -0,0 +1 @@
|
||||
--innodb_purge_threads=1
|
51
mysql-test/suite/innodb/t/purge_pessimistic.test
Normal file
51
mysql-test/suite/innodb/t/purge_pessimistic.test
Normal file
@@ -0,0 +1,51 @@
|
||||
--source include/have_innodb.inc
|
||||
--source include/count_sessions.inc
|
||||
--source include/have_debug.inc
|
||||
--source include/have_debug_sync.inc
|
||||
--source include/not_embedded.inc
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-35508: Race condition between purge and secondary index INSERT or UPDATE
|
||||
--echo #
|
||||
|
||||
SET @old_debug_dbug = @@global.debug_dbug;
|
||||
|
||||
CREATE TABLE t1(col1 INT PRIMARY KEY, col2 int, KEY k1(col2)) ENGINE=Innodb;
|
||||
INSERT INTO t1 VALUES(1, 100);
|
||||
|
||||
CREATE TABLE t2(col1 INT PRIMARY KEY) Engine=Innodb;
|
||||
--source include/wait_all_purged.inc
|
||||
|
||||
START TRANSACTION;
|
||||
INSERT INTO t2 VALUES(10);
|
||||
|
||||
SET DEBUG_SYNC='RESET';
|
||||
|
||||
SET GLOBAL debug_dbug= "+d,btr_force_pessimistic_delete";
|
||||
SET GLOBAL debug_dbug= "+d,enable_row_purge_sec_tree_sync";
|
||||
|
||||
--connect (con1,localhost,root)
|
||||
UPDATE t1 SET col2 = 200 WHERE col1 = 1;
|
||||
|
||||
--connection default
|
||||
SET DEBUG_SYNC= 'now WAIT_FOR purge_sec_tree_begin';
|
||||
SET GLOBAL debug_dbug= "-d,enable_row_purge_sec_tree_sync";
|
||||
|
||||
UPDATE t1 SET col2 = 100 WHERE col1 = 1;
|
||||
SET DEBUG_SYNC= 'now SIGNAL purge_sec_tree_execute';
|
||||
|
||||
COMMIT;
|
||||
--source include/wait_all_purged.inc
|
||||
|
||||
--disconnect con1
|
||||
--source include/wait_until_count_sessions.inc
|
||||
|
||||
SELECT * FROM t1;
|
||||
CHECK TABLE t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
SELECT * FROM t2;
|
||||
DROP TABLE t2;
|
||||
|
||||
SET @@GLOBAL.debug_dbug = @old_debug_dbug;
|
||||
SET DEBUG_SYNC='RESET';
|
@@ -801,10 +801,10 @@ title VARCHAR(200), book VARCHAR(200),
|
||||
FULLTEXT fidx(title)) ENGINE = InnoDB;
|
||||
INSERT INTO t1(title) VALUES('database');
|
||||
ALTER TABLE t1 DROP INDEX fidx;
|
||||
select space into @common_space from information_schema.innodb_sys_tables where name like "test/FTS_%_CONFIG";
|
||||
create table t2 as select space from information_schema.innodb_sys_tables where name like "test/FTS_%_CONFIG";
|
||||
ALTER TABLE t1 ADD FULLTEXT fidx_1(book);
|
||||
select space=@common_space from information_schema.innodb_sys_tables where name like "test/FTS_%_CONFIG";
|
||||
space=@common_space
|
||||
select i_s.space=t2.space from information_schema.innodb_sys_tables i_s join t2 where name like "test/FTS_%_CONFIG";
|
||||
i_s.space=t2.space
|
||||
1
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
@@ -815,4 +815,5 @@ t1 CREATE TABLE `t1` (
|
||||
PRIMARY KEY (`ID`),
|
||||
FULLTEXT KEY `fidx_1` (`book`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t1, t2;
|
||||
# End of 10.5 tests
|
||||
|
@@ -816,8 +816,10 @@ CREATE TABLE t1 (
|
||||
FULLTEXT fidx(title)) ENGINE = InnoDB;
|
||||
INSERT INTO t1(title) VALUES('database');
|
||||
ALTER TABLE t1 DROP INDEX fidx;
|
||||
select space into @common_space from information_schema.innodb_sys_tables where name like "test/FTS_%_CONFIG";
|
||||
create table t2 as select space from information_schema.innodb_sys_tables where name like "test/FTS_%_CONFIG";
|
||||
ALTER TABLE t1 ADD FULLTEXT fidx_1(book);
|
||||
select space=@common_space from information_schema.innodb_sys_tables where name like "test/FTS_%_CONFIG";
|
||||
select i_s.space=t2.space from information_schema.innodb_sys_tables i_s join t2 where name like "test/FTS_%_CONFIG";
|
||||
SHOW CREATE TABLE t1;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
--echo # End of 10.5 tests
|
||||
|
@@ -34,6 +34,7 @@ per-page-details FALSE
|
||||
log (No default value)
|
||||
leaf FALSE
|
||||
merge 0
|
||||
skip-freed-pages FALSE
|
||||
[1]:# check the both short and long options for "help"
|
||||
[2]:# Run the innochecksum when file isn't provided.
|
||||
# It will print the innochecksum usage similar to --help option.
|
||||
@@ -41,7 +42,7 @@ innochecksum Ver #.#.#
|
||||
Copyright (c) YEAR, YEAR , Oracle, MariaDB Corporation Ab and others.
|
||||
|
||||
InnoDB offline file checksum utility.
|
||||
Usage: innochecksum [-c] [-s <start page>] [-e <end page>] [-p <page>] [-i] [-v] [-a <allow mismatches>] [-n] [-S] [-D <page type dump>] [-l <log>] [-l] [-m <merge pages>] <filename or [-]>
|
||||
Usage: innochecksum [-c] [-r] [-s <start page>] [-e <end page>] [-p <page>] [-i] [-v] [-a <allow mismatches>] [-n] [-S] [-D <page type dump>] [-l <log>] [-l] [-m <merge pages>] <filename or [-]>
|
||||
See https://mariadb.com/kb/en/library/innochecksum/ for usage hints.
|
||||
-?, --help Displays this help and exits.
|
||||
-I, --info Synonym for --help.
|
||||
@@ -66,6 +67,8 @@ See https://mariadb.com/kb/en/library/innochecksum/ for usage hints.
|
||||
-f, --leaf Examine leaf index pages
|
||||
-m, --merge=# leaf page count if merge given number of consecutive
|
||||
pages
|
||||
-r, --skip-freed-pages
|
||||
skip freed pages for the tablespace
|
||||
|
||||
Variables (--variable-name=value)
|
||||
and boolean options {FALSE|TRUE} Value (after reading options)
|
||||
@@ -84,6 +87,7 @@ per-page-details FALSE
|
||||
log (No default value)
|
||||
leaf FALSE
|
||||
merge 0
|
||||
skip-freed-pages FALSE
|
||||
[3]:# check the both short and long options for "count" and exit
|
||||
Number of pages:#
|
||||
Number of pages:#
|
||||
|
@@ -139,6 +139,7 @@ per-page-details FALSE
|
||||
log (No default value)
|
||||
leaf FALSE
|
||||
merge 0
|
||||
skip-freed-pages FALSE
|
||||
[5]: Page type dump for with shortform for tab1.ibd
|
||||
|
||||
|
||||
|
22
mysql-test/suite/plugins/r/server_audit_pwd_mask.result
Normal file
22
mysql-test/suite/plugins/r/server_audit_pwd_mask.result
Normal file
@@ -0,0 +1,22 @@
|
||||
install plugin ed25519 soname 'auth_ed25519';
|
||||
install plugin server_audit soname 'server_audit';
|
||||
set global server_audit_file_path='server_audit.log';
|
||||
set global server_audit_output_type=file;
|
||||
set global server_audit_logging=on;
|
||||
# unsafe to log passwords (pwd-123)
|
||||
CREATE USER u1 IDENTIFIED BY 'pwd_123';
|
||||
create user u2 IDENTIFIED VIA ed25519 USING PASSWORD('pwd_123');
|
||||
SET PASSWORD FOR u1 = PASSWORD('pwd_123');
|
||||
ALTER USER u1 IDENTIFIED BY 'pwd_123';
|
||||
alter user u2 identified VIA ed25519 USING password('pwd_123');
|
||||
GRANT ALL ON test TO u1 IDENTIFIED BY "pwd_123";
|
||||
GRANT ALL ON test TO u1 identified VIA ed25519 as password('pwd_123') or ed25519 using password('pwd_123');
|
||||
# pattern should not be found
|
||||
NOT FOUND /pwd_123/ in server_audit.log
|
||||
# pattern should not be found
|
||||
# cleaunup
|
||||
DROP USER u1;
|
||||
DROP USER u2;
|
||||
set global server_audit_logging=off;
|
||||
UNINSTALL PLUGIN ed25519;
|
||||
UNINSTALL PLUGIN server_audit;
|
46
mysql-test/suite/plugins/t/server_audit_pwd_mask.test
Normal file
46
mysql-test/suite/plugins/t/server_audit_pwd_mask.test
Normal file
@@ -0,0 +1,46 @@
|
||||
|
||||
--source include/have_plugin_auth.inc
|
||||
--source include/not_embedded.inc
|
||||
|
||||
if (!$SERVER_AUDIT_SO) {
|
||||
skip No SERVER_AUDIT plugin;
|
||||
}
|
||||
if (!$AUTH_ED25519_SO) {
|
||||
skip No auth_ed25519 plugin;
|
||||
}
|
||||
--disable_ps2_protocol
|
||||
|
||||
let $MYSQLD_DATADIR= `SELECT @@datadir`;
|
||||
let SEARCH_FILE= $MYSQLD_DATADIR/server_audit.log;
|
||||
|
||||
install plugin ed25519 soname 'auth_ed25519';
|
||||
install plugin server_audit soname 'server_audit';
|
||||
|
||||
|
||||
set global server_audit_file_path='server_audit.log';
|
||||
set global server_audit_output_type=file;
|
||||
set global server_audit_logging=on;
|
||||
|
||||
--echo # unsafe to log passwords (pwd-123)
|
||||
|
||||
CREATE USER u1 IDENTIFIED BY 'pwd_123';
|
||||
create user u2 IDENTIFIED VIA ed25519 USING PASSWORD('pwd_123');
|
||||
SET PASSWORD FOR u1 = PASSWORD('pwd_123');
|
||||
ALTER USER u1 IDENTIFIED BY 'pwd_123';
|
||||
alter user u2 identified VIA ed25519 USING password('pwd_123');
|
||||
GRANT ALL ON test TO u1 IDENTIFIED BY "pwd_123";
|
||||
GRANT ALL ON test TO u1 identified VIA ed25519 as password('pwd_123') or ed25519 using password('pwd_123');
|
||||
--let SEARCH_PATTERN=pwd_123
|
||||
--echo # pattern should not be found
|
||||
--source include/search_pattern_in_file.inc
|
||||
--echo # pattern should not be found
|
||||
|
||||
--echo # cleaunup
|
||||
DROP USER u1;
|
||||
DROP USER u2;
|
||||
set global server_audit_logging=off;
|
||||
--remove_file $SEARCH_FILE
|
||||
--disable_warnings
|
||||
UNINSTALL PLUGIN ed25519;
|
||||
UNINSTALL PLUGIN server_audit;
|
||||
--enable_warnings
|
42
mysql-test/suite/rpl/r/parallel_backup_xa_debug.result
Normal file
42
mysql-test/suite/rpl/r/parallel_backup_xa_debug.result
Normal file
@@ -0,0 +1,42 @@
|
||||
include/master-slave.inc
|
||||
[connection master]
|
||||
connection master;
|
||||
CREATE TABLE t (a INT) ENGINE = innodb;
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
SET @old_parallel_threads= @@GLOBAL.slave_parallel_threads;
|
||||
SET @old_parallel_mode = @@GLOBAL.slave_parallel_mode;
|
||||
SET @@global.slave_parallel_threads= 2;
|
||||
SET @@global.slave_parallel_mode = 'optimistic';
|
||||
connection master;
|
||||
# MDEV-35110
|
||||
SET @@gtid_seq_no=100;
|
||||
insert into t set a=1;
|
||||
xa start 'x';
|
||||
insert into t set a=2;
|
||||
xa end 'x';
|
||||
xa prepare 'x';
|
||||
connection slave;
|
||||
SET @@global.debug_dbug="+d,hold_worker_on_schedule";
|
||||
start slave;
|
||||
connection slave1;
|
||||
backup stage start;
|
||||
backup stage block_commit;
|
||||
connection slave;
|
||||
SET debug_sync = 'now SIGNAL continue_worker';
|
||||
SET debug_sync = RESET;
|
||||
connection slave1;
|
||||
backup stage end;
|
||||
connection master;
|
||||
xa rollback 'x';
|
||||
connection slave;
|
||||
# Clean up.
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
SET @@global.debug_dbug="";
|
||||
SET @@global.slave_parallel_threads= @old_parallel_threads;
|
||||
SET @@global.slave_parallel_mode = @old_parallel_mode;
|
||||
include/start_slave.inc
|
||||
connection server_1;
|
||||
DROP TABLE t;
|
||||
include/rpl_end.inc
|
@@ -9,7 +9,6 @@ CHANGE MASTER TO MASTER_USE_GTID=slave_pos;
|
||||
include/start_slave.inc
|
||||
connection master;
|
||||
"Test Case 1: Start binlog_dump to slave_server(#), pos(master-bin.000001, ###), using_gtid(1), gtid('')"
|
||||
include/wait_for_pattern_in_file.inc
|
||||
FOUND 1 /using_gtid\(1\), gtid\(\'\'\).*/ in mysqld.1.err
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
@@ -17,7 +16,6 @@ CHANGE MASTER TO MASTER_USE_GTID=no;
|
||||
include/start_slave.inc
|
||||
connection master;
|
||||
"Test Case 2: Start binlog_dump to slave_server(#), pos(master-bin.000001, ###), using_gtid(0), gtid('')"
|
||||
include/wait_for_pattern_in_file.inc
|
||||
FOUND 1 /using_gtid\(0\), gtid\(\'\'\).*/ in mysqld.1.err
|
||||
CREATE TABLE t (f INT) ENGINE=INNODB;
|
||||
INSERT INTO t VALUES(10);
|
||||
@@ -28,7 +26,6 @@ CHANGE MASTER TO MASTER_USE_GTID=slave_pos;
|
||||
include/start_slave.inc
|
||||
connection master;
|
||||
"Test Case 3: Start binlog_dump to slave_server(#), pos(master-bin.000001, ###), using_gtid(1), gtid('0-1-2')"
|
||||
include/wait_for_pattern_in_file.inc
|
||||
FOUND 1 /using_gtid\(1\), gtid\(\'0-1-2\'\).*/ in mysqld.1.err
|
||||
SET @@SESSION.gtid_domain_id=10;
|
||||
INSERT INTO t VALUES(20);
|
||||
@@ -39,7 +36,6 @@ CHANGE MASTER TO MASTER_USE_GTID=slave_pos;
|
||||
include/start_slave.inc
|
||||
connection master;
|
||||
"Test Case 4: Start binlog_dump to slave_server(#), pos(master-bin.000001, ###), using_gtid(1), gtid('0-1-2,10-1-1')"
|
||||
include/wait_for_pattern_in_file.inc
|
||||
FOUND 1 /using_gtid\(1\), gtid\(\'0-1-2,10-1-1\'\).*/ in mysqld.1.err
|
||||
"===== Clean up ====="
|
||||
SET GLOBAL LOG_WARNINGS=@org_log_warnings;
|
||||
|
@@ -0,0 +1,88 @@
|
||||
include/master-slave.inc
|
||||
[connection master]
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
set @old_enabled= @@global.rpl_semi_sync_slave_enabled;
|
||||
set @old_dbug= @@global.debug_dbug;
|
||||
set global rpl_semi_sync_slave_enabled= 1;
|
||||
connection master;
|
||||
set @old_enabled= @@global.rpl_semi_sync_master_enabled;
|
||||
set @old_timeout= @@global.rpl_semi_sync_master_timeout;
|
||||
set @old_wait_point= @@global.rpl_semi_sync_master_wait_point;
|
||||
set global rpl_semi_sync_master_enabled= 1;
|
||||
set global rpl_semi_sync_master_timeout= 2000;
|
||||
set global rpl_semi_sync_master_wait_point= AFTER_SYNC;
|
||||
connection slave;
|
||||
include/start_slave.inc
|
||||
# Ensure slave connection is semi-simulate_delay_semisync_slave_reply
|
||||
connection master;
|
||||
connection slave;
|
||||
#
|
||||
# Initialize test data
|
||||
connection master;
|
||||
create table t1 (a int) engine=innodb;
|
||||
include/save_master_gtid.inc
|
||||
connection slave;
|
||||
include/sync_with_master_gtid.inc
|
||||
include/stop_slave.inc
|
||||
set @@global.debug_dbug="+d,simulate_delay_semisync_slave_reply";
|
||||
include/start_slave.inc
|
||||
# Ensure connection is semi-sync
|
||||
connection master;
|
||||
connection slave;
|
||||
connection master;
|
||||
set @old_bgc_count= @@global.binlog_commit_wait_count;
|
||||
set @old_bgc_usec= @@global.binlog_commit_wait_usec;
|
||||
set @@global.binlog_commit_wait_count=1;
|
||||
set @@global.binlog_commit_wait_usec=100000;
|
||||
connection server_1;
|
||||
set debug_sync= "commit_after_release_LOCK_log SIGNAL ddl_binlogged WAIT_FOR ddl_cont";
|
||||
# T1 (DDL)
|
||||
create table t2 (a int);
|
||||
connect server_1_sync, localhost, root,,;
|
||||
connection server_1_sync;
|
||||
set debug_sync= "now WAIT_FOR ddl_binlogged";
|
||||
include/save_master_gtid.inc
|
||||
connection server_2;
|
||||
set debug_sync= "now WAIT_FOR io_thd_at_slave_reply";
|
||||
connection master;
|
||||
set debug_sync= "commit_before_get_LOCK_after_binlog_sync SIGNAL mdl_binlogged WAIT_FOR mdl_cont";
|
||||
# T2 (DML)
|
||||
insert into t1 values (100);;
|
||||
connection server_1_sync;
|
||||
set debug_sync= "now WAIT_FOR mdl_binlogged";
|
||||
# Both transactions binlogged and released LOCK_log, and are just before
|
||||
# wait_after_sync()
|
||||
set debug_sync= "now SIGNAL ddl_cont";
|
||||
set debug_sync= "now SIGNAL mdl_cont";
|
||||
connection server_2;
|
||||
# slave_reply for DDL
|
||||
set debug_sync= "now SIGNAL io_thd_do_reply";
|
||||
# slave_reply for MDL
|
||||
set debug_sync= "now WAIT_FOR io_thd_at_slave_reply";
|
||||
set debug_sync= "now SIGNAL io_thd_do_reply";
|
||||
# Reaping MDL..
|
||||
connection master;
|
||||
# ..done
|
||||
# Reaping DDL..
|
||||
connection server_1;
|
||||
# ..done
|
||||
#
|
||||
# Cleanup
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
set @@global.rpl_semi_sync_slave_enabled= @old_enabled;
|
||||
set @@global.debug_dbug= @old_dbug;
|
||||
include/start_slave.inc
|
||||
connection master;
|
||||
set @@global.binlog_commit_wait_count= @old_bgc_count;
|
||||
set @@global.binlog_commit_wait_usec= @old_bgc_usec;
|
||||
set @@global.rpl_semi_sync_master_enabled= @old_enabled;
|
||||
set @@global.rpl_semi_sync_master_timeout= @old_timeout;
|
||||
set @@global.rpl_semi_sync_master_wait_point= @old_wait_point;
|
||||
drop table t1, t2;
|
||||
include/save_master_gtid.inc
|
||||
connection slave;
|
||||
include/sync_with_master_gtid.inc
|
||||
include/rpl_end.inc
|
||||
# End of rpl_semi_sync_after_sync_coord_consistency.test
|
@@ -3,7 +3,7 @@ connection server_1;
|
||||
set @old_enabled= @@global.rpl_semi_sync_master_enabled;
|
||||
set @old_timeout= @@global.rpl_semi_sync_master_timeout;
|
||||
set global rpl_semi_sync_master_enabled= 1;
|
||||
set global rpl_semi_sync_master_timeout= 500;
|
||||
set global rpl_semi_sync_master_timeout= 2000;
|
||||
connection server_2;
|
||||
include/stop_slave.inc
|
||||
set @old_enabled= @@global.rpl_semi_sync_slave_enabled;
|
||||
@@ -14,12 +14,24 @@ include/start_slave.inc
|
||||
connection server_3;
|
||||
include/stop_slave.inc
|
||||
set @old_enabled= @@global.rpl_semi_sync_slave_enabled;
|
||||
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
|
||||
connection server_1;
|
||||
connection server_1;
|
||||
create table t1 (a int);
|
||||
connection default;
|
||||
create table t1 (a int);;
|
||||
# Ensure both slaves get the event with the need_ack flag set (i.e. one
|
||||
# slave shouldn't be able to receive the event and send an ACK before
|
||||
# the dump thread for the other server prepares the event to send).
|
||||
connection server_3;
|
||||
set debug_sync= "now wait_for io_thd_at_slave_reply";
|
||||
connection server_2;
|
||||
set debug_sync= "now wait_for io_thd_at_slave_reply";
|
||||
connection server_3;
|
||||
set debug_sync= "now signal io_thd_do_reply";
|
||||
connection default;
|
||||
connection server_2;
|
||||
# Verifying server_2 did not send ACK
|
||||
connection server_3;
|
||||
@@ -27,15 +39,18 @@ connection server_3;
|
||||
connection server_1;
|
||||
# Verifying master's semi-sync status is still ON (This failed pre-MDEV-32960 fixes)
|
||||
# Verifying rpl_semi_sync_master_yes_tx incremented
|
||||
connection server_2;
|
||||
set debug_sync= "now signal io_thd_do_reply";
|
||||
#
|
||||
# Cleanup
|
||||
connection server_2;
|
||||
include/stop_slave.inc
|
||||
set global rpl_semi_sync_slave_enabled= @old_enabled;
|
||||
set global debug_dbug= @old_dbug;
|
||||
include/stop_slave.inc
|
||||
connection server_3;
|
||||
set global rpl_semi_sync_slave_enabled= @old_enabled;
|
||||
include/stop_slave.inc
|
||||
set global rpl_semi_sync_slave_enabled= @old_enabled;
|
||||
set global debug_dbug= @old_dbug;
|
||||
connection server_1;
|
||||
set global rpl_semi_sync_master_enabled= @old_enabled;
|
||||
set global rpl_semi_sync_master_timeout= @old_timeout;
|
||||
|
@@ -83,12 +83,26 @@ connection server_1;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
connection server_1_con2;
|
||||
#-- Wait until master recognizes a connection is awaiting semi-sync ACK
|
||||
connection server_2;
|
||||
set debug_sync= "now wait_for io_thd_at_slave_reply";
|
||||
connection server_3;
|
||||
set debug_sync= "now wait_for io_thd_at_slave_reply";
|
||||
connection server_1_con2;
|
||||
#-- Begin master shutdown
|
||||
SHUTDOWN WAIT FOR ALL SLAVES;
|
||||
connection server_2;
|
||||
# Waitng for shutdown to be delayed..
|
||||
FOUND 1 /Delaying shutdown to await semi-sync ACK/ in mysqld.1.err
|
||||
connection server_2;
|
||||
set debug_sync= "now signal io_thd_do_reply";
|
||||
connection server_3;
|
||||
set debug_sync= "now signal io_thd_do_reply";
|
||||
# Reaping transaction..
|
||||
connection server_1;
|
||||
ERROR HY000: Lost connection to server during query
|
||||
# Check logs to ensure shutdown was delayed
|
||||
FOUND 1 /Delaying shutdown to await semi-sync ACK/ in mysqld.1.err
|
||||
connection server_2;
|
||||
# Reaping shutdown..
|
||||
connection server_1_con2;
|
||||
# Validate slave data is in correct state
|
||||
connection server_2;
|
||||
select count(*)=1 from t1;
|
||||
@@ -184,12 +198,18 @@ connection server_1;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
connection server_1_con2;
|
||||
#-- Wait until master recognizes a connection is awaiting semi-sync ACK
|
||||
connection server_1_con2;
|
||||
#-- Begin master shutdown
|
||||
SHUTDOWN WAIT FOR ALL SLAVES;
|
||||
connection server_2;
|
||||
# Waitng for shutdown to be delayed..
|
||||
FOUND 2 /Delaying shutdown to await semi-sync ACK/ in mysqld.1.err
|
||||
# Reaping transaction..
|
||||
connection server_1;
|
||||
ERROR HY000: Lost connection to server during query
|
||||
# Check logs to ensure shutdown was delayed
|
||||
FOUND 2 /Delaying shutdown to await semi-sync ACK/ in mysqld.1.err
|
||||
connection server_2;
|
||||
# Reaping shutdown..
|
||||
connection server_1_con2;
|
||||
# Validate slave data is in correct state
|
||||
connection server_2;
|
||||
select count(*)=0 from t1;
|
||||
@@ -298,12 +318,22 @@ connection server_1;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
connection server_1_con2;
|
||||
#-- Wait until master recognizes a connection is awaiting semi-sync ACK
|
||||
connection server_3;
|
||||
set debug_sync= "now wait_for io_thd_at_slave_reply";
|
||||
connection server_1_con2;
|
||||
#-- Begin master shutdown
|
||||
SHUTDOWN WAIT FOR ALL SLAVES;
|
||||
connection server_2;
|
||||
# Waitng for shutdown to be delayed..
|
||||
FOUND 3 /Delaying shutdown to await semi-sync ACK/ in mysqld.1.err
|
||||
connection server_3;
|
||||
set debug_sync= "now signal io_thd_do_reply";
|
||||
# Reaping transaction..
|
||||
connection server_1;
|
||||
ERROR HY000: Lost connection to server during query
|
||||
# Check logs to ensure shutdown was delayed
|
||||
FOUND 3 /Delaying shutdown to await semi-sync ACK/ in mysqld.1.err
|
||||
connection server_2;
|
||||
# Reaping shutdown..
|
||||
connection server_1_con2;
|
||||
# Validate slave data is in correct state
|
||||
connection server_2;
|
||||
select count(*)=0 from t1;
|
||||
@@ -412,12 +442,22 @@ connection server_1;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
connection server_1_con2;
|
||||
#-- Wait until master recognizes a connection is awaiting semi-sync ACK
|
||||
connection server_3;
|
||||
set debug_sync= "now wait_for io_thd_at_slave_reply";
|
||||
connection server_1_con2;
|
||||
#-- Begin master shutdown
|
||||
SHUTDOWN WAIT FOR ALL SLAVES;
|
||||
connection server_2;
|
||||
# Waitng for shutdown to be delayed..
|
||||
FOUND 4 /Delaying shutdown to await semi-sync ACK/ in mysqld.1.err
|
||||
connection server_3;
|
||||
set debug_sync= "now signal io_thd_do_reply";
|
||||
# Reaping transaction..
|
||||
connection server_1;
|
||||
ERROR HY000: Lost connection to server during query
|
||||
# Check logs to ensure shutdown was delayed
|
||||
FOUND 4 /Delaying shutdown to await semi-sync ACK/ in mysqld.1.err
|
||||
connection server_2;
|
||||
# Reaping shutdown..
|
||||
connection server_1_con2;
|
||||
# Validate slave data is in correct state
|
||||
connection server_2;
|
||||
select count(*)=0 from t1;
|
||||
@@ -501,15 +541,20 @@ insert into t1 values (2);
|
||||
connection server_1;
|
||||
# Wait for thd to begin semi-sync wait..
|
||||
# ..done
|
||||
connection server_2;
|
||||
set debug_sync= "now wait_for io_thd_at_slave_reply";
|
||||
disconnect con1;
|
||||
connection default;
|
||||
connection con2;
|
||||
SHUTDOWN WAIT FOR ALL SLAVES;
|
||||
# Ensure the primary waited for the ACK of the killed thread
|
||||
# Waitng for shutdown to be delayed..
|
||||
connection server_2;
|
||||
FOUND 5 /Delaying shutdown to await semi-sync ACK/ in mysqld.1.err
|
||||
connection default;
|
||||
connection server_1;
|
||||
connection con2;
|
||||
connection server_2;
|
||||
set debug_sync= "now signal io_thd_do_reply";
|
||||
include/stop_slave.inc
|
||||
connection server_3;
|
||||
include/stop_slave.inc
|
||||
|
64
mysql-test/suite/rpl/t/parallel_backup_xa_debug.test
Normal file
64
mysql-test/suite/rpl/t/parallel_backup_xa_debug.test
Normal file
@@ -0,0 +1,64 @@
|
||||
# Verify deadlock between XA-PREPARE and BACKUP on the optimistic slave
|
||||
--source include/have_debug.inc
|
||||
--source include/have_debug_sync.inc
|
||||
--source include/have_innodb.inc
|
||||
# The test is not format specific, MIXED is required to optimize testing time
|
||||
--source include/have_binlog_format_mixed.inc
|
||||
--source include/master-slave.inc
|
||||
|
||||
--connection master
|
||||
CREATE TABLE t (a INT) ENGINE = innodb;
|
||||
|
||||
--sync_slave_with_master
|
||||
--source include/stop_slave.inc
|
||||
SET @old_parallel_threads= @@GLOBAL.slave_parallel_threads;
|
||||
SET @old_parallel_mode = @@GLOBAL.slave_parallel_mode;
|
||||
SET @@global.slave_parallel_threads= 2;
|
||||
SET @@global.slave_parallel_mode = 'optimistic';
|
||||
|
||||
--connection master
|
||||
--echo # MDEV-35110
|
||||
SET @@gtid_seq_no=100;
|
||||
insert into t set a=1;
|
||||
xa start 'x';
|
||||
insert into t set a=2;
|
||||
xa end 'x';
|
||||
xa prepare 'x';
|
||||
|
||||
--connection slave
|
||||
SET @@global.debug_dbug="+d,hold_worker_on_schedule";
|
||||
start slave;
|
||||
--let $wait_condition= SELECT count(*) = 1 FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to commit"
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--connection slave1
|
||||
backup stage start;
|
||||
--send backup stage block_commit
|
||||
|
||||
--connection slave
|
||||
--let $wait_condition= SELECT count(*) = 1 FROM information_schema.processlist WHERE state LIKE "Waiting for backup lock"
|
||||
SET debug_sync = 'now SIGNAL continue_worker';
|
||||
SET debug_sync = RESET;
|
||||
|
||||
--connection slave1
|
||||
reap;
|
||||
backup stage end;
|
||||
|
||||
--connection master
|
||||
xa rollback 'x';
|
||||
|
||||
--sync_slave_with_master
|
||||
|
||||
--echo # Clean up.
|
||||
--connection slave
|
||||
--source include/stop_slave.inc
|
||||
SET @@global.debug_dbug="";
|
||||
SET @@global.slave_parallel_threads= @old_parallel_threads;
|
||||
SET @@global.slave_parallel_mode = @old_parallel_mode;
|
||||
|
||||
--source include/start_slave.inc
|
||||
|
||||
--connection server_1
|
||||
DROP TABLE t;
|
||||
|
||||
--source include/rpl_end.inc
|
@@ -60,7 +60,8 @@ if(!$log_error_)
|
||||
--let SEARCH_FILE=$log_error_
|
||||
--let SEARCH_RANGE=-50000
|
||||
--let SEARCH_PATTERN=using_gtid\(1\), gtid\(\'\'\).*
|
||||
--source include/wait_for_pattern_in_file.inc
|
||||
--let SEARCH_WAIT=FOUND
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--connection slave
|
||||
--source include/stop_slave.inc
|
||||
@@ -72,7 +73,8 @@ CHANGE MASTER TO MASTER_USE_GTID=no;
|
||||
--let SEARCH_FILE=$log_error_
|
||||
--let SEARCH_RANGE=-50000
|
||||
--let SEARCH_PATTERN=using_gtid\(0\), gtid\(\'\'\).*
|
||||
--source include/wait_for_pattern_in_file.inc
|
||||
--let SEARCH_WAIT=FOUND
|
||||
--source include/search_pattern_in_file.inc
|
||||
CREATE TABLE t (f INT) ENGINE=INNODB;
|
||||
INSERT INTO t VALUES(10);
|
||||
save_master_pos;
|
||||
@@ -90,7 +92,8 @@ CHANGE MASTER TO MASTER_USE_GTID=slave_pos;
|
||||
--let SEARCH_FILE=$log_error_
|
||||
--let SEARCH_RANGE=-50000
|
||||
--let SEARCH_PATTERN=using_gtid\(1\), gtid\(\'0-1-2\'\).*
|
||||
--source include/wait_for_pattern_in_file.inc
|
||||
--let SEARCH_WAIT=FOUND
|
||||
--source include/search_pattern_in_file.inc
|
||||
SET @@SESSION.gtid_domain_id=10;
|
||||
INSERT INTO t VALUES(20);
|
||||
save_master_pos;
|
||||
@@ -108,7 +111,8 @@ CHANGE MASTER TO MASTER_USE_GTID=slave_pos;
|
||||
--let SEARCH_FILE=$log_error_
|
||||
--let SEARCH_RANGE=-50000
|
||||
--let SEARCH_PATTERN=using_gtid\(1\), gtid\(\'0-1-2,10-1-1\'\).*
|
||||
--source include/wait_for_pattern_in_file.inc
|
||||
--let SEARCH_WAIT=FOUND
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--echo "===== Clean up ====="
|
||||
SET GLOBAL LOG_WARNINGS=@org_log_warnings;
|
||||
|
@@ -0,0 +1,184 @@
|
||||
#
|
||||
# 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
|
||||
# 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,
|
||||
# this only resulted in delayed transactions, because all transactions shared
|
||||
# the same condition variable for ACK signaling. However, with the MDEV-33551
|
||||
# changes, each thread has its own condition variable to signal. So T1 could
|
||||
# wait indefinitely when either:
|
||||
# 1) T1's ACK is received but not T2's when T1 goes into wait_after_sync(),
|
||||
# because the ACK receiver thread has already notified about the T1 ACK,
|
||||
# but T1 was _actually_ waiting on T2's ACK, and therefore tries to wait
|
||||
# (in vain).
|
||||
#
|
||||
# 2) T1 goes to wait_after_sync() before any ACKs have arrived. When T1's ACK
|
||||
# comes in, T1 is woken up; however, sees it needs to wait more (because
|
||||
# it was actually waiting on T2's ACK), and goes to wait again (this time,
|
||||
# in vain).
|
||||
#
|
||||
# Note that the actual cause of T1 waiting on T2's binlog coordinates is when
|
||||
# MYSQL_BIN_LOG::write() would call Repl_semisync_master::wait_after_sync(),
|
||||
# the binlog offset parameter was read as the end of MYSQL_BIN_LOG::log_file,
|
||||
# which is shared among transactions. So if T2 had updated the binary log
|
||||
# _after_ T1 had released LOCK_log, but not yet invoked wait_after_sync(), it
|
||||
# would use the end of the binary log file as the binlog offset, which was that
|
||||
# of T2 (or any future transaction). The patch itself fixes this issue, and
|
||||
# ensures consistency between the binary log coordinates a transaction uses
|
||||
# between report_binlog_update() and wait_after_sync().
|
||||
#
|
||||
# This test reproduces the above race condition, to ensure that T1 can no
|
||||
# longer use T2's binlog coordinates when wait_point=AFTER_SYNC (AFTER_COMMIT
|
||||
# was never affected). That is, because T1 in the above scenario must binlog
|
||||
# through MYSQL_BIN_LOG::write(), it is a DDL. T2 is an MDL that commits
|
||||
# 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
|
||||
# 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.
|
||||
#
|
||||
# References:
|
||||
# MDEV-33551: Semi-sync Wait Point AFTER_COMMIT Slow on Workloads with Heavy
|
||||
# Concurrency
|
||||
# MDEV-35109: Semi-sync Replication stalling Primary using
|
||||
# wait_point=AFTER_SYNC
|
||||
#
|
||||
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_debug_sync.inc
|
||||
# Test is format independent
|
||||
--source include/have_binlog_format_row.inc
|
||||
--source include/master-slave.inc
|
||||
|
||||
--connection slave
|
||||
--source include/stop_slave.inc
|
||||
set @old_enabled= @@global.rpl_semi_sync_slave_enabled;
|
||||
set @old_dbug= @@global.debug_dbug;
|
||||
set global rpl_semi_sync_slave_enabled= 1;
|
||||
|
||||
--connection master
|
||||
set @old_enabled= @@global.rpl_semi_sync_master_enabled;
|
||||
set @old_timeout= @@global.rpl_semi_sync_master_timeout;
|
||||
set @old_wait_point= @@global.rpl_semi_sync_master_wait_point;
|
||||
set global rpl_semi_sync_master_enabled= 1;
|
||||
set global rpl_semi_sync_master_timeout= 2000; # 2s
|
||||
set global rpl_semi_sync_master_wait_point= AFTER_SYNC;
|
||||
|
||||
--connection slave
|
||||
--source include/start_slave.inc
|
||||
|
||||
--echo # Ensure slave connection is semi-simulate_delay_semisync_slave_reply
|
||||
--connection master
|
||||
--let $status_var_value= ON
|
||||
--let $status_var= Rpl_semi_sync_master_status
|
||||
--source include/wait_for_status_var.inc
|
||||
--connection slave
|
||||
--let $status_var_value= ON
|
||||
--let $status_var= Rpl_semi_sync_slave_status
|
||||
--source include/wait_for_status_var.inc
|
||||
|
||||
--echo #
|
||||
--echo # Initialize test data
|
||||
--connection master
|
||||
|
||||
# It is simpler to create t1 before using debug_sync on the slave_reply
|
||||
create table t1 (a int) engine=innodb;
|
||||
--source include/save_master_gtid.inc
|
||||
--connection slave
|
||||
--source include/sync_with_master_gtid.inc
|
||||
|
||||
--source include/stop_slave.inc
|
||||
set @@global.debug_dbug="+d,simulate_delay_semisync_slave_reply";
|
||||
--source include/start_slave.inc
|
||||
|
||||
--echo # Ensure connection is semi-sync
|
||||
--connection master
|
||||
--let $status_var_value= ON
|
||||
--let $status_var= Rpl_semi_sync_master_status
|
||||
--source include/wait_for_status_var.inc
|
||||
--connection slave
|
||||
--let $status_var_value= ON
|
||||
--let $status_var= Rpl_semi_sync_slave_status
|
||||
--source include/wait_for_status_var.inc
|
||||
|
||||
--connection master
|
||||
set @old_bgc_count= @@global.binlog_commit_wait_count;
|
||||
set @old_bgc_usec= @@global.binlog_commit_wait_usec;
|
||||
set @@global.binlog_commit_wait_count=1;
|
||||
set @@global.binlog_commit_wait_usec=100000;
|
||||
|
||||
--connection server_1
|
||||
set debug_sync= "commit_after_release_LOCK_log SIGNAL ddl_binlogged WAIT_FOR ddl_cont";
|
||||
--echo # T1 (DDL)
|
||||
--send create table t2 (a int)
|
||||
|
||||
--connect(server_1_sync, localhost, root,,)
|
||||
--connection server_1_sync
|
||||
set debug_sync= "now WAIT_FOR ddl_binlogged";
|
||||
--source include/save_master_gtid.inc
|
||||
|
||||
--connection server_2
|
||||
set debug_sync= "now WAIT_FOR io_thd_at_slave_reply";
|
||||
|
||||
--connection master
|
||||
set debug_sync= "commit_before_get_LOCK_after_binlog_sync SIGNAL mdl_binlogged WAIT_FOR mdl_cont";
|
||||
--echo # T2 (DML)
|
||||
--send insert into t1 values (100);
|
||||
|
||||
--connection server_1_sync
|
||||
set debug_sync= "now WAIT_FOR mdl_binlogged";
|
||||
|
||||
--echo # Both transactions binlogged and released LOCK_log, and are just before
|
||||
--echo # wait_after_sync()
|
||||
set debug_sync= "now SIGNAL ddl_cont";
|
||||
# Ensure ddl_cont is seen before next SIGNAL
|
||||
--let $wait_condition= SELECT count(*)=0 FROM information_schema.processlist WHERE state LIKE "%commit_after_release_LOCK_log%"
|
||||
--source include/wait_condition.inc
|
||||
|
||||
set debug_sync= "now SIGNAL mdl_cont";
|
||||
|
||||
--connection server_2
|
||||
--echo # slave_reply for DDL
|
||||
set debug_sync= "now SIGNAL io_thd_do_reply";
|
||||
--echo # slave_reply for MDL
|
||||
set debug_sync= "now WAIT_FOR io_thd_at_slave_reply";
|
||||
set debug_sync= "now SIGNAL io_thd_do_reply";
|
||||
|
||||
--echo # Reaping MDL..
|
||||
--connection master
|
||||
--reap
|
||||
--echo # ..done
|
||||
|
||||
--echo # Reaping DDL..
|
||||
--connection server_1
|
||||
--reap
|
||||
--echo # ..done
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Cleanup
|
||||
--connection slave
|
||||
--source include/stop_slave.inc
|
||||
set @@global.rpl_semi_sync_slave_enabled= @old_enabled;
|
||||
set @@global.debug_dbug= @old_dbug;
|
||||
--source include/start_slave.inc
|
||||
|
||||
--connection master
|
||||
set @@global.binlog_commit_wait_count= @old_bgc_count;
|
||||
set @@global.binlog_commit_wait_usec= @old_bgc_usec;
|
||||
set @@global.rpl_semi_sync_master_enabled= @old_enabled;
|
||||
set @@global.rpl_semi_sync_master_timeout= @old_timeout;
|
||||
set @@global.rpl_semi_sync_master_wait_point= @old_wait_point;
|
||||
drop table t1, t2;
|
||||
--source include/save_master_gtid.inc
|
||||
|
||||
--connection slave
|
||||
--source include/sync_with_master_gtid.inc
|
||||
|
||||
--source include/rpl_end.inc
|
||||
--echo # End of rpl_semi_sync_after_sync_coord_consistency.test
|
@@ -26,7 +26,7 @@
|
||||
set @old_enabled= @@global.rpl_semi_sync_master_enabled;
|
||||
set @old_timeout= @@global.rpl_semi_sync_master_timeout;
|
||||
set global rpl_semi_sync_master_enabled= 1;
|
||||
set global rpl_semi_sync_master_timeout= 500;
|
||||
set global rpl_semi_sync_master_timeout= 2000; # 2s
|
||||
|
||||
--connection server_2
|
||||
--source include/stop_slave.inc
|
||||
@@ -39,7 +39,9 @@ set global debug_dbug="+d,simulate_delay_semisync_slave_reply";
|
||||
--connection server_3
|
||||
--source include/stop_slave.inc
|
||||
set @old_enabled= @@global.rpl_semi_sync_slave_enabled;
|
||||
set @old_dbug= @@global.debug_dbug;
|
||||
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
|
||||
@@ -55,9 +57,23 @@ if (`SELECT strcmp("$master_ss_status", "ON") != 0`)
|
||||
--die rpl_semi_sync_master_status should be ON to start
|
||||
}
|
||||
|
||||
--connection server_1
|
||||
--connection default
|
||||
--let $init_master_yes_tx= query_get_value(SHOW STATUS LIKE 'rpl_semi_sync_master_yes_tx', Value, 1)
|
||||
create table t1 (a int);
|
||||
--send create table t1 (a int);
|
||||
|
||||
--echo # Ensure both slaves get the event with the need_ack flag set (i.e. one
|
||||
--echo # slave shouldn't be able to receive the event and send an ACK before
|
||||
--echo # the dump thread for the other server prepares the event to send).
|
||||
--connection server_3
|
||||
set debug_sync= "now wait_for io_thd_at_slave_reply";
|
||||
--connection server_2
|
||||
set debug_sync= "now wait_for io_thd_at_slave_reply";
|
||||
--connection server_3
|
||||
set debug_sync= "now signal io_thd_do_reply";
|
||||
|
||||
--connection default
|
||||
--reap
|
||||
|
||||
|
||||
--connection server_2
|
||||
--echo # Verifying server_2 did not send ACK
|
||||
@@ -70,10 +86,6 @@ if (`SELECT $slave1_sent_ack`)
|
||||
|
||||
--connection server_3
|
||||
--echo # Verifying server_3 did send ACK
|
||||
--let $status_var= Rpl_semi_sync_slave_send_ack
|
||||
--let $status_var_comparsion= >
|
||||
--let $status_var_value= 0
|
||||
--source include/wait_for_status_var.inc
|
||||
--let $slave2_sent_ack= query_get_value(SHOW STATUS LIKE 'rpl_semi_sync_slave_send_ack', Value, 1)
|
||||
if (`SELECT NOT $slave2_sent_ack`)
|
||||
{
|
||||
@@ -99,18 +111,22 @@ if (`SELECT $cur_master_yes_tx != ($init_master_yes_tx + 1)`)
|
||||
--die rpl_semi_sync_master_yes_tx should have been incremented by primary
|
||||
}
|
||||
|
||||
--connection server_2
|
||||
set debug_sync= "now signal io_thd_do_reply";
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Cleanup
|
||||
|
||||
--connection server_2
|
||||
--source include/stop_slave.inc
|
||||
set global rpl_semi_sync_slave_enabled= @old_enabled;
|
||||
set global debug_dbug= @old_dbug;
|
||||
--source include/stop_slave.inc
|
||||
|
||||
--connection server_3
|
||||
set global rpl_semi_sync_slave_enabled= @old_enabled;
|
||||
--source include/stop_slave.inc
|
||||
set global rpl_semi_sync_slave_enabled= @old_enabled;
|
||||
set global debug_dbug= @old_dbug;
|
||||
|
||||
--connection server_1
|
||||
set global rpl_semi_sync_master_enabled= @old_enabled;
|
||||
|
@@ -12,10 +12,20 @@
|
||||
# replica after the shutdown
|
||||
# server_3_expect_row_count (int) The number of rows expected on the second
|
||||
# replica 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)
|
||||
# server_3_sync_slave_reply (bool) True if server_3_dbug is configured to use
|
||||
# debug_sync to synchronize the slave reply
|
||||
# (i.e. to pause before the reply)
|
||||
#
|
||||
|
||||
--connection server_1
|
||||
let $log_error_file= `SELECT @@GLOBAL.log_error`;
|
||||
if (!$n_logged_delayed_shutdown_notes)
|
||||
{
|
||||
let $n_logged_delayed_shutdown_notes= 0;
|
||||
}
|
||||
|
||||
--echo #--
|
||||
--echo #-- Semi-sync Setup
|
||||
@@ -78,19 +88,66 @@ let $status_var= Rpl_semi_sync_master_wait_sessions;
|
||||
let $status_var_value= 1;
|
||||
source include/wait_for_status_var.inc;
|
||||
|
||||
if ($server_2_sync_slave_reply)
|
||||
{
|
||||
--connection server_2
|
||||
set debug_sync= "now wait_for io_thd_at_slave_reply";
|
||||
}
|
||||
if ($server_3_sync_slave_reply)
|
||||
{
|
||||
--connection server_3
|
||||
set debug_sync= "now wait_for io_thd_at_slave_reply";
|
||||
}
|
||||
|
||||
--connection server_1_con2
|
||||
--echo #-- Begin master shutdown
|
||||
SHUTDOWN WAIT FOR ALL SLAVES;
|
||||
--source include/wait_until_disconnected.inc
|
||||
|
||||
# Use server_2 to search error log because 1 is down
|
||||
--connection server_2
|
||||
|
||||
--echo # Waitng for shutdown to be delayed..
|
||||
# Increment the number of notes to find each test case to ensure the pattern is
|
||||
# ours
|
||||
--inc $n_logged_delayed_shutdown_notes
|
||||
let SEARCH_FILE= $log_error_file;
|
||||
let SEARCH_PATTERN=Delaying shutdown to await semi-sync ACK;
|
||||
let SEARCH_WAIT=FOUND $n_logged_delayed_shutdown_notes;
|
||||
source include/search_pattern_in_file.inc;
|
||||
|
||||
if (`SELECT $server_2_sync_slave_reply AND $server_2_expect_row_count`)
|
||||
{
|
||||
--connection server_2
|
||||
set debug_sync= "now signal io_thd_do_reply";
|
||||
}
|
||||
if (`SELECT $server_3_sync_slave_reply AND $server_3_expect_row_count`)
|
||||
{
|
||||
--connection server_3
|
||||
set debug_sync= "now signal io_thd_do_reply";
|
||||
}
|
||||
|
||||
--echo # Reaping transaction..
|
||||
--connection server_1
|
||||
--error 2013
|
||||
--reap
|
||||
--source include/wait_until_disconnected.inc
|
||||
|
||||
--echo # Check logs to ensure shutdown was delayed
|
||||
--let SEARCH_FILE=$log_error_file
|
||||
--let SEARCH_PATTERN=Delaying shutdown to await semi-sync ACK
|
||||
--source include/search_pattern_in_file.inc
|
||||
# Timeout should be hit from prior reap
|
||||
--connection server_2
|
||||
if (`SELECT $server_2_sync_slave_reply AND NOT $server_2_expect_row_count`)
|
||||
{
|
||||
--connection server_2
|
||||
set debug_sync= "now signal io_thd_do_reply";
|
||||
}
|
||||
if (`SELECT $server_3_sync_slave_reply AND NOT $server_3_expect_row_count`)
|
||||
{
|
||||
--connection server_3
|
||||
set debug_sync= "now signal io_thd_do_reply";
|
||||
}
|
||||
|
||||
--echo # Reaping shutdown..
|
||||
--connection server_1_con2
|
||||
--source include/wait_until_disconnected.inc
|
||||
|
||||
--echo # Validate slave data is in correct state
|
||||
--connection server_2
|
||||
|
@@ -113,7 +113,9 @@ while (`SELECT $i <= $slave_last`)
|
||||
--echo # allowed timeout, the primary should delay killing the Ack_thread
|
||||
--echo # until an ACK is received.
|
||||
--echo #
|
||||
--let server_2_sync_slave_reply=1
|
||||
--let server_2_dbug= "+d,simulate_delay_semisync_slave_reply"
|
||||
--let server_3_sync_slave_reply=1
|
||||
--let server_3_dbug= "+d,simulate_delay_semisync_slave_reply"
|
||||
--let semisync_timeout= 1600
|
||||
--let server_2_expect_row_count= 1
|
||||
@@ -125,7 +127,9 @@ while (`SELECT $i <= $slave_last`)
|
||||
--echo # the primary should delay killing the Ack_thread until the
|
||||
--echo # timeout is reached.
|
||||
--echo #
|
||||
--let server_2_sync_slave_reply=0
|
||||
--let server_2_dbug= "+d,corrupt_queue_event,delay_semisync_kill_connection_for_mdev_28141"
|
||||
--let server_3_sync_slave_reply=0
|
||||
--let server_3_dbug= "+d,corrupt_queue_event,delay_semisync_kill_connection_for_mdev_28141"
|
||||
--let semisync_timeout= 500
|
||||
--let server_2_expect_row_count= 0
|
||||
@@ -138,7 +142,9 @@ while (`SELECT $i <= $slave_last`)
|
||||
--echo # primary should delay killing the Ack_thread until it receives an
|
||||
--echo # ACK from the delayed slave.
|
||||
--echo #
|
||||
--let server_2_sync_slave_reply=0
|
||||
--let server_2_dbug= "+d,corrupt_queue_event,delay_semisync_kill_connection_for_mdev_28141"
|
||||
--let server_3_sync_slave_reply=1
|
||||
--let server_3_dbug= "+d,simulate_delay_semisync_slave_reply"
|
||||
--let semisync_timeout= 1600
|
||||
--let server_2_expect_row_count= 0
|
||||
@@ -156,7 +162,9 @@ while (`SELECT $i <= $slave_last`)
|
||||
--echo # sent to kill an active connection. This test case validates that the
|
||||
--echo # slave does not send a `QUIT` in this case.
|
||||
--echo #
|
||||
--let server_2_sync_slave_reply=0
|
||||
--let server_2_dbug= "+d,corrupt_queue_event,delay_semisync_kill_connection_for_mdev_28141"
|
||||
--let server_3_sync_slave_reply=1
|
||||
--let server_3_dbug= "+d,simulate_delay_semisync_slave_reply"
|
||||
--let semisync_timeout= 1600
|
||||
--let server_2_expect_row_count= 0
|
||||
@@ -208,6 +216,9 @@ SET GLOBAL debug_dbug="+d,simulate_delay_semisync_slave_reply";
|
||||
--source include/wait_condition.inc
|
||||
--echo # ..done
|
||||
|
||||
--connection server_2
|
||||
set debug_sync= "now wait_for io_thd_at_slave_reply";
|
||||
|
||||
--disconnect con1
|
||||
|
||||
--connection default
|
||||
@@ -217,12 +228,14 @@ EOF
|
||||
|
||||
--connection con2
|
||||
SHUTDOWN WAIT FOR ALL SLAVES;
|
||||
--source include/wait_until_disconnected.inc
|
||||
|
||||
--echo # Ensure the primary waited for the ACK of the killed thread
|
||||
--let $SEARCH_PATTERN= Delaying shutdown to await semi-sync ACK
|
||||
--let $SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err
|
||||
--source include/search_pattern_in_file.inc
|
||||
--echo # Waitng for shutdown to be delayed..
|
||||
--connection server_2
|
||||
--inc $n_logged_delayed_shutdown_notes
|
||||
let SEARCH_FILE= $log_error_file;
|
||||
let SEARCH_PATTERN=Delaying shutdown to await semi-sync ACK;
|
||||
let SEARCH_WAIT=FOUND $n_logged_delayed_shutdown_notes;
|
||||
source include/search_pattern_in_file.inc;
|
||||
|
||||
--connection default
|
||||
--source include/wait_until_disconnected.inc
|
||||
@@ -230,7 +243,11 @@ SHUTDOWN WAIT FOR ALL SLAVES;
|
||||
--connection server_1
|
||||
--source include/wait_until_disconnected.inc
|
||||
|
||||
--connection con2
|
||||
--source include/wait_until_disconnected.inc
|
||||
|
||||
--connection server_2
|
||||
set debug_sync= "now signal io_thd_do_reply";
|
||||
--let $rpl_allow_error= 1
|
||||
source include/stop_slave.inc;
|
||||
--connection server_3
|
||||
|
Reference in New Issue
Block a user