MDEV-25975: Merge 10.4 into 10.5

This commit is contained in:
Marko Mäkelä 2022-04-06 10:30:49 +03:00
commit 5d8dcfd86c
34 changed files with 161 additions and 472 deletions

View file

@ -1,25 +0,0 @@
connection node_2;
connection node_1;
CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB;
INSERT INTO t1 (f1) VALUES (1);
CREATE TABLE t2 (f1 CHAR(20)) ENGINE=InnoDB;
CREATE PROCEDURE proc_update ()
BEGIN
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
SET SESSION wsrep_sync_wait = 0;
WHILE 1 DO
UPDATE t1 SET f2 = LEFT(MD5(RAND()), 4);
END WHILE;
END|
connect node_1X, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connection node_1X;
CALL proc_update();;
connection node_2;
SET SESSION wsrep_retry_autocommit = 10000;
connection node_1;
connection node_1X;
Got one of the listed errors
connection node_1;
DROP PROCEDURE proc_update;
DROP TABLE t1, t2;
CALL mtr.add_suppression("conflict state ABORTED after post commit");

View file

@ -5,6 +5,7 @@ connection node_2;
connection node_1;
CREATE TABLE t1 (f1 INT PRIMARY KEY);
connection node_2;
call mtr.add_suppression("WSREP: Failed to scan the last segment to the end. Last events may be missing. Last recovered event:.*");
SET DEBUG_SYNC = 'wsrep_before_certification WAIT_FOR continue';
INSERT INTO t1 VALUES (1);
connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;

View file

@ -48,3 +48,6 @@ SHOW TABLES;
Tables_in_fts
DROP DATABASE fts;
connection node_2;
call mtr.add_suppression("WSREP: Failed to scan the last segment to the end. Last events may be missing. Last recovered event:");
Warnings:
Note 1049 Unknown database 'fts'

View file

@ -111,6 +111,7 @@ f1 f2
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='one_event';
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
def test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND SLAVESIDE_DISABLED NOT PRESERVE
call mtr.add_suppression("WSREP: Failed to scan the last segment to the end. Last events may be missing. Last recovered event:.*");
connection node_1;
SELECT * FROM t1;
f1 f2

View file

@ -41,6 +41,7 @@ f1 f2
connection node_2;
Starting server ...
Starting server ...
call mtr.add_suppression("WSREP: Failed to scan the last segment to the end. Last events may be missing. Last recovered event:");
SELECT * FROM t1;
f1 f2
1 a

View file

@ -1,30 +0,0 @@
connection node_2;
connection node_1;
connection node_1a;
SET SESSION wsrep_sync_wait = 0;
connection node_1;
CREATE TABLE t1 (f1 INTEGER, f2 varchar(1024)) Engine=InnoDB;
CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
SET GLOBAL innodb_disallow_writes=ON;
INSERT INTO t1 (f2) SELECT 'abcde ' FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;;
connection node_2;
INSERT INTO t1 (f2) SELECT 'fghij ' FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
SELECT COUNT(*) AS EXPECT_10000 FROM t1;
EXPECT_10000
10000
connection node_1a;
SET GLOBAL innodb_disallow_writes=OFF;
connection node_1;
SELECT COUNT(*) AS EXPECT_20000 FROM t1;
EXPECT_20000
20000
connection node_2;
SELECT COUNT(*) AS EXPECT_20000 FROM t1;
EXPECT_20000
20000
connection node_1;
connection node_2;
DROP TABLE t1;
DROP TABLE ten;
disconnect node_1a;

View file

@ -1,7 +0,0 @@
!include ../galera_2nodes.cnf
[mysqld.1]
wsrep-debug=SERVER
[mysqld.2]
wsrep-debug=SERVER

View file

@ -1,36 +0,0 @@
#
# MW-328 Fix unnecessary/silent BF aborts
#
#
# Make sure that a high value of wsrep_retry_autocommit
# masks all deadlock errors
#
--source include/no_protocol.inc
--source include/galera_cluster.inc
--source suite/galera/t/MW-328-header.inc
--connection node_2
--let $count = 100
SET SESSION wsrep_retry_autocommit = 10000;
--disable_query_log
while ($count)
{
--error 0
INSERT IGNORE INTO t2 SELECT f2 FROM t1;
--disable_result_log
--error 0
SELECT 1 FROM DUAL;
--enable_result_log
--dec $count
}
--enable_query_log
--source suite/galera/t/MW-328-footer.inc

View file

@ -18,6 +18,7 @@
CREATE TABLE t1 (f1 INT PRIMARY KEY);
--connection node_2
call mtr.add_suppression("WSREP: Failed to scan the last segment to the end. Last events may be missing. Last recovered event:.*");
SET DEBUG_SYNC = 'wsrep_before_certification WAIT_FOR continue';
--send INSERT INTO t1 VALUES (1)

View file

@ -56,6 +56,7 @@ SHOW TABLES;
DROP DATABASE fts;
--connection node_2
call mtr.add_suppression("WSREP: Failed to scan the last segment to the end. Last events may be missing. Last recovered event:");
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'fts_t1';
--source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'fts_t2';

View file

@ -137,6 +137,8 @@ SELECT * FROM t1;
--echo # node_2 Event should be SERVERSIDE_DISABLED
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='one_event';
call mtr.add_suppression("WSREP: Failed to scan the last segment to the end. Last events may be missing. Last recovered event:.*");
--connection node_1
SELECT * FROM t1;
--echo # node_1 Event should be ENABLED

View file

@ -125,6 +125,7 @@ SELECT * FROM t1;
# Sanity check (node 2 is running now and can perform SQL operators):
call mtr.add_suppression("WSREP: Failed to scan the last segment to the end. Last events may be missing. Last recovered event:");
SELECT * FROM t1;
--connection node_1

View file

@ -1,72 +0,0 @@
#
# This test checks that innodb_disallow_writes works as expected
#
# Note that we need to enable binlog for this test: If the commit
# to InnoDB is done in one phase, the transaction is committed in
# memory before it is persisted to disk. This means that the
# innodb_disallow_writes=ON may not prevent transaction to
# become visible to other readers. On the other hand, if the
# commit is two phase (as it is with binlog), the transaction
# will be blocked in prepare phase.
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_log_bin.inc
--let $datadir= `SELECT @@datadir`
# Open a separate connection to be used to run SHOW PROCESSLIST
--let $galera_connection_name = node_1a
--let $galera_server_number = 1
--source include/galera_connect.inc
--connection node_1a
SET SESSION wsrep_sync_wait = 0;
--connection node_1
CREATE TABLE t1 (f1 INTEGER, f2 varchar(1024)) Engine=InnoDB;
CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
SET GLOBAL innodb_disallow_writes=ON;
--exec find $datadir -type f-exec md5sum {} \; | md5sum >$MYSQLTEST_VARDIR/tmp/innodb_before
#
# This insert has no effect before innodb_disallow_writes is OFF
#
--send INSERT INTO t1 (f2) SELECT 'abcde ' FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
--connection node_2
INSERT INTO t1 (f2) SELECT 'fghij ' FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
SELECT COUNT(*) AS EXPECT_10000 FROM t1;
--connection node_1a
--sleep 5
--exec find $datadir -type f-exec md5sum {} \; | md5sum >$MYSQLTEST_VARDIR/tmp/innodb_after
SET GLOBAL innodb_disallow_writes=OFF;
--connection node_1
--reap
--let $wait_condition = SELECT COUNT(*) = 20000 FROM t1;
--source include/wait_condition.inc
SELECT COUNT(*) AS EXPECT_20000 FROM t1;
--connection node_2
--let $wait_condition = SELECT COUNT(*) = 20000 FROM t1;
--source include/wait_condition.inc
SELECT COUNT(*) AS EXPECT_20000 FROM t1;
--connection node_1
--diff_files $MYSQLTEST_VARDIR/tmp/innodb_before $MYSQLTEST_VARDIR/tmp/innodb_after
--connection node_2
DROP TABLE t1;
DROP TABLE ten;
--disconnect node_1a

View file

@ -1,45 +0,0 @@
#
# innodb_disallow_writes
#
# save the initial value
SET @innodb_disallow_writes_global_saved = @@global.innodb_disallow_writes;
# default
SELECT @@global.innodb_disallow_writes;
@@global.innodb_disallow_writes
0
# scope
SELECT @@session.innodb_disallow_writes;
ERROR HY000: Variable 'innodb_disallow_writes' is a GLOBAL variable
SET @@global.innodb_disallow_writes=OFF;
SELECT @@global.innodb_disallow_writes;
@@global.innodb_disallow_writes
0
SET @@global.innodb_disallow_writes=ON;
SELECT @@global.innodb_disallow_writes;
@@global.innodb_disallow_writes
1
# valid values
SET @@global.innodb_disallow_writes='OFF';
SELECT @@global.innodb_disallow_writes;
@@global.innodb_disallow_writes
0
SET @@global.innodb_disallow_writes=ON;
SELECT @@global.innodb_disallow_writes;
@@global.innodb_disallow_writes
1
SET @@global.innodb_disallow_writes=default;
SELECT @@global.innodb_disallow_writes;
@@global.innodb_disallow_writes
0
# invalid values
SET @@global.innodb_disallow_writes=NULL;
ERROR 42000: Variable 'innodb_disallow_writes' can't be set to the value of 'NULL'
SET @@global.innodb_disallow_writes='junk';
ERROR 42000: Variable 'innodb_disallow_writes' can't be set to the value of 'junk'
# restore the initial value
SET @@global.innodb_disallow_writes = @innodb_disallow_writes_global_saved;
# End of test

View file

@ -2,9 +2,7 @@ select VARIABLE_NAME, SESSION_VALUE, DEFAULT_VALUE, VARIABLE_SCOPE, VARIABLE_TYP
where variable_name like 'innodb%' and
variable_name not in (
'innodb_version', # always the same as the server version
'innodb_disallow_writes', # only available WITH_WSREP
'innodb_numa_interleave', # only available WITH_NUMA
'innodb_sched_priority_cleaner', # linux only
'innodb_evict_tables_on_commit_debug', # one may want to override this
'innodb_use_native_aio', # default value depends on OS
'innodb_buffer_pool_load_pages_abort') # debug build only, and is only for testing

View file

@ -1,42 +0,0 @@
--source include/have_innodb_disallow_writes.inc
--echo #
--echo # innodb_disallow_writes
--echo #
--echo # save the initial value
SET @innodb_disallow_writes_global_saved = @@global.innodb_disallow_writes;
--echo # default
SELECT @@global.innodb_disallow_writes;
--echo
--echo # scope
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.innodb_disallow_writes;
SET @@global.innodb_disallow_writes=OFF;
SELECT @@global.innodb_disallow_writes;
SET @@global.innodb_disallow_writes=ON;
SELECT @@global.innodb_disallow_writes;
--echo
--echo # valid values
SET @@global.innodb_disallow_writes='OFF';
SELECT @@global.innodb_disallow_writes;
SET @@global.innodb_disallow_writes=ON;
SELECT @@global.innodb_disallow_writes;
SET @@global.innodb_disallow_writes=default;
SELECT @@global.innodb_disallow_writes;
--echo
--echo # invalid values
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.innodb_disallow_writes=NULL;
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.innodb_disallow_writes='junk';
--echo
--echo # restore the initial value
SET @@global.innodb_disallow_writes = @innodb_disallow_writes_global_saved;
--echo # End of test

View file

@ -9,9 +9,7 @@ select VARIABLE_NAME, SESSION_VALUE, DEFAULT_VALUE, VARIABLE_SCOPE, VARIABLE_TYP
where variable_name like 'innodb%' and
variable_name not in (
'innodb_version', # always the same as the server version
'innodb_disallow_writes', # only available WITH_WSREP
'innodb_numa_interleave', # only available WITH_NUMA
'innodb_sched_priority_cleaner', # linux only
'innodb_evict_tables_on_commit_debug', # one may want to override this
'innodb_use_native_aio', # default value depends on OS
'innodb_buffer_pool_load_pages_abort') # debug build only, and is only for testing