Skip to content

Commit

Permalink
Merge 10.5 into 10.6
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Jan 11, 2021
2 parents 92abdcc + 8de233a commit 666565c
Show file tree
Hide file tree
Showing 72 changed files with 1,598 additions and 328 deletions.
2 changes: 1 addition & 1 deletion cmake/install_macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ IF(WIN32)
MARK_AS_ADVANCED(SIGNCODE)
IF(SIGNCODE)
SET(SIGNTOOL_PARAMETERS
/a /t http://timestamp.verisign.com/scripts/timstamp.dll
/a /t http://timestamp.globalsign.com/scripts/timstamp.dll
CACHE STRING "parameters for signtool (list)")
FIND_PROGRAM(SIGNTOOL_EXECUTABLE signtool
PATHS "$ENV{ProgramFiles}/Microsoft SDKs/Windows/v7.0A/bin"
Expand Down
4 changes: 2 additions & 2 deletions mysql-test/main/cte_recursive.result
Original file line number Diff line number Diff line change
Expand Up @@ -1301,7 +1301,7 @@ select ancestors.name, ancestors.dob from ancestors;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived4> ALL NULL NULL NULL NULL 24
4 DERIVED folks ALL NULL NULL NULL NULL 12 Using where
6 RECURSIVE UNION <derived3> ALL NULL NULL NULL NULL 12
6 UNION <derived3> ALL NULL NULL NULL NULL 12
5 RECURSIVE UNION <derived4> ALL NULL NULL NULL NULL 24
NULL UNION RESULT <union4,6,5> ALL NULL NULL NULL NULL NULL
3 DERIVED folks ALL NULL NULL NULL NULL 12 Using where
Expand Down Expand Up @@ -4019,7 +4019,7 @@ id select_type table type possible_keys key key_len ref rows Extra
3 RECURSIVE UNION t1 ALL NULL NULL NULL NULL 4 Using where
3 RECURSIVE UNION <derived2> ref key0 key0 9 test.t1.c 2
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
4 RECURSIVE UNION <derived2> ALL NULL NULL NULL NULL 4
4 UNION <derived2> ALL NULL NULL NULL NULL 4
with recursive r_cte as
( select * from t1 as s
union
Expand Down
2 changes: 0 additions & 2 deletions mysql-test/suite/galera/r/galera#500.result
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
connection node_1;
connection node_2;
connection node_2;
connection node_1;
connection node_1;
Expand Down
26 changes: 14 additions & 12 deletions mysql-test/suite/galera/r/galera_as_slave_replay.result
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
connection node_2a;
connection node_2;
connection node_1;
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
connection node_3;
RESET MASTER;
connection node_2a;
START SLAVE;
connection node_1;
connection node_3;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)) engine=innodb;
INSERT INTO t1 VALUES (1, 'a');
INSERT INTO t1 VALUES (3, 'a');
Expand All @@ -18,15 +21,14 @@ f1 f2
UPDATE t1 SET f2 = 'c' WHERE f1 > 1;
connection node_2a;
SET SESSION wsrep_sync_wait = 0;
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
connection node_3;
connection node_1;
SET SESSION wsrep_sync_wait = 0;
connection node_2a;
SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_enter_sync';
SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_master_enter_sync';
SET GLOBAL debug_dbug = "d,sync.wsrep_apply_cb";
connection node_3;
INSERT INTO test.t1 VALUES (2, 'b');
connection node_1;
INSERT INTO test.t1 VALUES (2, 'b');
connection node_3;
COMMIT;
connection node_2a;
SET SESSION wsrep_on = 0;
Expand All @@ -35,8 +37,8 @@ SET GLOBAL debug_dbug = "";
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
connection node_2a;
SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_enter_sync';
connection node_1;
SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_master_enter_sync';
connection node_3;
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'a';
COUNT(*) = 1
1
Expand All @@ -61,7 +63,7 @@ SET DEBUG_SYNC = "RESET";
#
# test phase with real abort
#
connection node_1;
connection node_3;
set binlog_format=ROW;
insert into t1 values (4, 'd');
SET AUTOCOMMIT=ON;
Expand All @@ -70,9 +72,9 @@ UPDATE t1 SET f2 = 'd' WHERE f1 = 3;
connection node_2a;
SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_enter_sync';
SET GLOBAL debug_dbug = "d,sync.wsrep_apply_cb";
connection node_3;
UPDATE test.t1 SET f2 = 'e' WHERE f1 = 3;
connection node_1;
UPDATE test.t1 SET f2 = 'e' WHERE f1 = 3;
connection node_3;
COMMIT;
connection node_2a;
SET GLOBAL debug_dbug = "";
Expand All @@ -90,6 +92,6 @@ set session wsrep_sync_wait=0;
STOP SLAVE;
RESET SLAVE;
DROP TABLE t1;
connection node_1;
connection node_3;
DROP TABLE t1;
RESET MASTER;
16 changes: 16 additions & 0 deletions mysql-test/suite/galera/r/galera_bf_abort_ps.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
connection node_2;
connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(6)) ENGINE=InnoDB;
connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
connection node_2;
START TRANSACTION;
INSERT INTO t1 VALUES (1,'node_2');
connection node_1;
INSERT INTO t1 VALUES (1,'node_1');
connection node_2a;
connection node_2;
INSERT INTO t1 VALUES (2, 'node_2');
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
wsrep_local_aborts_increment
1
DROP TABLE t1;
22 changes: 22 additions & 0 deletions mysql-test/suite/galera/r/galera_bf_abort_ps_threadpool.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
connection node_2;
connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(6)) ENGINE=InnoDB;
connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
connection node_2;
START TRANSACTION;
INSERT INTO t1 VALUES (1,'node_2');
connection node_2a;
SET GLOBAL debug_dbug = "+d,sync.wsrep_apply_cb";
connection node_1;
INSERT INTO t1 VALUES (1,'node_1');
connection node_2a;
SET DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached";
connection node_2;
SET DEBUG_SYNC = "wsrep_before_before_command SIGNAL signal.wsrep_apply_cb WAIT_FOR bf_abort";
INSERT INTO t1 VALUES (2, 'node_2');
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
wsrep_local_aborts_increment
1
SET DEBUG_SYNC = 'RESET';
SET GLOBAL debug_dbug = DEFAULT;
DROP TABLE t1;
1 change: 1 addition & 0 deletions mysql-test/suite/galera/t/MDEV-16509.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
--source include/galera_cluster.inc
--source include/have_debug.inc
--source include/have_debug_sync.inc
--source include/galera_have_debug_sync.inc


CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
Expand Down
30 changes: 15 additions & 15 deletions mysql-test/suite/galera/t/galera_as_slave_replay.test
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
#--source suite/galera/include/galera_have_debug_sync.inc

#
# node 1 is native MariaDB server operating as async replication master
# node 3 is native MariaDB server operating as async replication master
#
--connection node_1
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
--connection node_3
RESET MASTER;

--connection node_2a
Expand All @@ -31,14 +32,14 @@ RESET MASTER;


#
# nodes 2 and 3 form a galera cluster, node 2 operates as slave for native MariaDB naster in node 1
# nodes 1 and 2 form a galera cluster, node 2 operates as slave for native MariaDB naster in node 3
#
--disable_query_log
--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_1;
--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_3;
--enable_query_log
START SLAVE;

--connection node_1
--connection node_3
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)) engine=innodb;
INSERT INTO t1 VALUES (1, 'a');
INSERT INTO t1 VALUES (3, 'a');
Expand All @@ -63,15 +64,14 @@ SET SESSION wsrep_sync_wait = 0;
--source include/wait_condition.inc

# wait for create table and inserts to be replicated in cluster
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
--connection node_3
--connection node_1
SET SESSION wsrep_sync_wait = 0;
--let $wait_condition = SELECT COUNT(*) = 2 FROM test.t1;
--source include/wait_condition.inc

--connection node_2a
# Block the future commit of async replication
--let $galera_sync_point = commit_monitor_enter_sync
--let $galera_sync_point = commit_monitor_master_enter_sync
--source include/galera_set_sync_point.inc

# block also the applier before applying begins
Expand All @@ -81,13 +81,13 @@ SET GLOBAL debug_dbug = "d,sync.wsrep_apply_cb";
# now inject a conflicting insert from node 3, it will replicate with
# earlier seqno (than async transaction) and pause before applying in node 2
#
--connection node_3
--connection node_1
INSERT INTO test.t1 VALUES (2, 'b');

#
# send the update from master, this will succeed here, beceuase of async replication.
# async replication will apply this in node 2 and pause before commit phase,
--connection node_1
--connection node_3
--error 0
COMMIT;

Expand All @@ -108,7 +108,7 @@ SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
--source include/galera_clear_sync_point.inc
--source include/galera_signal_sync_point.inc

--connection node_1
--connection node_3

SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'a';
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c';
Expand Down Expand Up @@ -139,7 +139,7 @@ SET DEBUG_SYNC = "RESET";
--echo # test phase with real abort
--echo #

--connection node_1
--connection node_3

set binlog_format=ROW;

Expand All @@ -163,11 +163,11 @@ UPDATE t1 SET f2 = 'd' WHERE f1 = 3;
SET GLOBAL debug_dbug = "d,sync.wsrep_apply_cb";

# Inject a conflicting update from node 3
--connection node_3
--connection node_1
UPDATE test.t1 SET f2 = 'e' WHERE f1 = 3;

# send the update from master
--connection node_1
--connection node_3
--error 0
COMMIT;

Expand Down Expand Up @@ -195,6 +195,6 @@ RESET SLAVE;

DROP TABLE t1;

--connection node_1
--connection node_3
DROP TABLE t1;
RESET MASTER;
3 changes: 3 additions & 0 deletions mysql-test/suite/galera/t/galera_bf_abort_ps.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
!include ../galera_2nodes.cnf
[mysqltest]
ps-protocol
34 changes: 34 additions & 0 deletions mysql-test/suite/galera/t/galera_bf_abort_ps.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#
# MDEV-24255
# Test BF abort of a transaction that has ps-protocol enabled
#

--source include/galera_cluster.inc

CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(6)) ENGINE=InnoDB;
--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2

--connection node_2
--let $wsrep_local_bf_aborts_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`

START TRANSACTION;
INSERT INTO t1 VALUES (1,'node_2');

--connection node_1
INSERT INTO t1 VALUES (1,'node_1');

--connection node_2a
--let $wait_condition = SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'node_1'
--source include/wait_condition.inc

--connection node_2
--error ER_LOCK_DEADLOCK
INSERT INTO t1 VALUES (2, 'node_2');

--let $wsrep_local_bf_aborts_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`

--disable_query_log
--eval SELECT $wsrep_local_bf_aborts_after - $wsrep_local_bf_aborts_before = 1 AS wsrep_local_aborts_increment;
--enable_query_log

DROP TABLE t1;
7 changes: 7 additions & 0 deletions mysql-test/suite/galera/t/galera_bf_abort_ps_threadpool.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
!include ../galera_2nodes.cnf

[mysqld]
thread-handling=pool-of-threads

[mysqltest]
ps-protocol
54 changes: 54 additions & 0 deletions mysql-test/suite/galera/t/galera_bf_abort_ps_threadpool.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#
# MDEV-24255
# Test BF abort of a transaction that has ps-protocol enabled
# This test stresses the case where wsrep_before_command()
# finds the transaction in state s_must_abort. This only
# possible when the server is using the thread pool.
#

--source include/galera_cluster.inc
--source include/have_debug_sync.inc

CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(6)) ENGINE=InnoDB;

--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2

--connection node_2
--let $wsrep_local_bf_aborts_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`

START TRANSACTION;
INSERT INTO t1 VALUES (1,'node_2');

--connection node_2a
SET GLOBAL debug_dbug = "+d,sync.wsrep_apply_cb";

--connection node_1
INSERT INTO t1 VALUES (1,'node_1');

--connection node_2a
SET DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached";

--connection node_2
SET DEBUG_SYNC = "wsrep_before_before_command SIGNAL signal.wsrep_apply_cb WAIT_FOR bf_abort";

#
# The following INSERT is expected to enter
# wsrep_before_command() and find its transaction
# in state s_must_abort.
# Notice that the test appears more complicated
# than it needs to... however we cannot use
# --send for this INSERT, otherwise mysqltest
# will not use ps-protocol
#
--error ER_LOCK_DEADLOCK
INSERT INTO t1 VALUES (2, 'node_2');

--let $wsrep_local_bf_aborts_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`

--disable_query_log
--eval SELECT $wsrep_local_bf_aborts_after - $wsrep_local_bf_aborts_before = 1 AS wsrep_local_aborts_increment;
--enable_query_log

SET DEBUG_SYNC = 'RESET';
SET GLOBAL debug_dbug = DEFAULT;
DROP TABLE t1;
3 changes: 3 additions & 0 deletions mysql-test/suite/galera/t/galera_rsu_error.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
INSERT INTO t1 VALUES (1), (1);

--connection node_2
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t1';
--source include/wait_condition.inc

SET SESSION wsrep_OSU_method = "RSU";
--error ER_DUP_ENTRY
ALTER TABLE t1 ADD PRIMARY KEY (f1);
Expand Down
3 changes: 3 additions & 0 deletions mysql-test/suite/galera/t/galera_toi_ddl_sequential.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);

--connection node_2
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t1';
--source include/wait_condition.inc

ALTER TABLE t1 ADD COLUMN f2 INTEGER;
INSERT INTO t1 VALUES (2, 3);

Expand Down
3 changes: 3 additions & 0 deletions mysql-test/suite/galera/t/galera_toi_lock_shared.test
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);

--connection node_2
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t1';
--source include/wait_condition.inc

ALTER TABLE t1 ADD COLUMN f2 INTEGER, LOCK=SHARED;

--connection node_1
Expand Down
Loading

0 comments on commit 666565c

Please sign in to comment.