Skip to content

Commit

Permalink
Merge 10.2 into 10.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Sep 21, 2020
2 parents fba6ffe + e05650e commit 2cf489d
Show file tree
Hide file tree
Showing 16 changed files with 339 additions and 110 deletions.
19 changes: 16 additions & 3 deletions extra/mariabackup/xtrabackup.cc
Expand Up @@ -2770,6 +2770,7 @@ static bool xtrabackup_copy_logfile(bool last = false)
ut_a(dst_log_file != NULL);
ut_ad(recv_sys != NULL);

bool overwritten_block = false;
lsn_t start_lsn;
lsn_t end_lsn;

Expand All @@ -2795,6 +2796,12 @@ static bool xtrabackup_copy_logfile(bool last = false)
}

if (lsn == start_lsn) {
overwritten_block= !recv_sys->found_corrupt_log
&& (innodb_log_checksums || log_sys.log.is_encrypted())
&& log_block_calc_checksum_crc32(log_sys.buf) ==
log_block_get_checksum(log_sys.buf)
&& log_block_get_hdr_no(log_sys.buf) >
log_block_convert_lsn_to_no(start_lsn);
start_lsn = 0;
} else {
mutex_enter(&recv_sys->mutex);
Expand All @@ -2805,9 +2812,15 @@ static bool xtrabackup_copy_logfile(bool last = false)
log_mutex_exit();

if (!start_lsn) {
die(recv_sys->found_corrupt_log
? "xtrabackup_copy_logfile() failed: corrupt log."
: "xtrabackup_copy_logfile() failed.");
const char *reason = recv_sys->found_corrupt_log
? "corrupt log."
: (overwritten_block
? "redo log block is overwritten, please increase redo log size with innodb_log_file_size parameter."
: ((innodb_log_checksums || log_sys.log.is_encrypted())
? "redo log block checksum does not match."
: "unknown reason as innodb_log_checksums is switched off and redo"
" log is not encrypted."));
die("xtrabackup_copy_logfile() failed: %s", reason);
return true;
}
} while (start_lsn == end_lsn);
Expand Down
19 changes: 7 additions & 12 deletions mysql-test/suite/encryption/r/create_or_replace.result
@@ -1,8 +1,6 @@
SET @save_threads = @@GLOBAL.innodb_encryption_threads;
SET @save_tables = @@GLOBAL.innodb_encrypt_tables;
SET default_storage_engine = InnoDB;
CREATE TABLE t1 (pk INT PRIMARY KEY, c VARCHAR(256));
CREATE TABLE t2 AS SELECT * FROM t1;
drop table t1,t2;
SET GLOBAL innodb_encryption_threads = 0;
SET GLOBAL innodb_encryption_threads = 4;
CREATE TABLE `table10_int_autoinc` (`col_int_key` int, pk int auto_increment, `col_int` int, key (`col_int_key` ),primary key (pk)) engine=innodb;
INSERT /*! IGNORE */ INTO table10_int_autoinc VALUES (NULL, NULL, -474021888) , (1, NULL, NULL) , (1141047296, NULL, NULL) , (NULL, NULL, NULL) , (NULL, NULL, 1) , (NULL, NULL, 9) , (0, NULL, 1225785344) , (NULL, NULL, 1574174720) , (2, NULL, NULL) , (6, NULL, 3);
Expand All @@ -14,13 +12,10 @@ INSERT IGNORE INTO `table1_int_autoinc` ( `col_int` ) VALUES ( 1 ), ( 0 ), ( 7 )
INSERT IGNORE INTO `table10_int_autoinc` ( `col_int` ) VALUES ( 6 ), ( 2 ), ( 3 ), ( 6 );
connect con1,localhost,root,,test;
connect con2,localhost,root,,test;
connection default;
drop table if exists create_or_replace_t, table1_int_autoinc, table0_int_autoinc, table10_int_autoinc;
disconnect con1;
disconnect con2;
SET GLOBAL innodb_encrypt_tables = OFF;
SET GLOBAL innodb_encryption_threads = 4;
# Wait max 10 min for key encryption threads to decrypt all spaces
# Success!
SET GLOBAL innodb_encryption_threads = 0;
SET GLOBAL innodb_encrypt_tables = OFF;
connection default;
drop table create_or_replace_t, table1_int_autoinc, table0_int_autoinc,
table10_int_autoinc;
SET GLOBAL innodb_encryption_threads = @save_threads;
SET GLOBAL innodb_encrypt_tables = @save_tables;
19 changes: 19 additions & 0 deletions mysql-test/suite/encryption/r/create_or_replace_big.result
@@ -0,0 +1,19 @@
SET default_storage_engine = InnoDB;
CREATE TABLE t1 (pk INT PRIMARY KEY, c VARCHAR(256));
CREATE TABLE t2 AS SELECT * FROM t1;
drop table t1,t2;
SET GLOBAL innodb_encryption_threads = 0;
SET GLOBAL innodb_encryption_threads = 4;
CREATE TABLE `table10_int_autoinc` (`col_int_key` int, pk int auto_increment, `col_int` int, key (`col_int_key` ),primary key (pk)) engine=innodb;
INSERT /*! IGNORE */ INTO table10_int_autoinc VALUES (NULL, NULL, -474021888) , (1, NULL, NULL) , (1141047296, NULL, NULL) , (NULL, NULL, NULL) , (NULL, NULL, 1) , (NULL, NULL, 9) , (0, NULL, 1225785344) , (NULL, NULL, 1574174720) , (2, NULL, NULL) , (6, NULL, 3);
CREATE TABLE `table1_int_autoinc` (`col_int_key` int, pk int auto_increment, `col_int` int,key (`col_int_key` ), primary key (pk)) engine=innodb;
CREATE TABLE `table0_int_autoinc` (`col_int_key` int, pk int auto_increment, `col_int` int, key (`col_int_key` ),primary key (pk)) engine=innodb;
INSERT /*! IGNORE */ INTO table1_int_autoinc VALUES (4, NULL, NULL);
INSERT IGNORE INTO `table0_int_autoinc` ( `col_int_key` ) VALUES ( 1 ), ( 3 ), ( 4 ), ( 1 );
INSERT IGNORE INTO `table1_int_autoinc` ( `col_int` ) VALUES ( 1 ), ( 0 ), ( 7 ), ( 9 );
INSERT IGNORE INTO `table10_int_autoinc` ( `col_int` ) VALUES ( 6 ), ( 2 ), ( 3 ), ( 6 );
# Wait max 10 min for key encryption threads to decrypt all spaces
# Success!
SET GLOBAL innodb_encryption_threads = 0;
SET GLOBAL innodb_encrypt_tables = OFF;
DROP TABLE table0_int_autoinc, table1_int_autoinc, table10_int_autoinc;
86 changes: 12 additions & 74 deletions mysql-test/suite/encryption/t/create_or_replace.test
@@ -1,41 +1,11 @@
--source include/have_innodb.inc
--source include/have_file_key_management_plugin.inc
--source include/not_embedded.inc
# This is needed for longer testcase timeout at least P7/P8
--source include/big_test.inc
--source include/count_sessions.inc

#
# MDEV-8164: Server crashes in pfs_mutex_enter_func after fil_crypt_is_closing or alike
#
SET default_storage_engine = InnoDB;

CREATE TABLE t1 (pk INT PRIMARY KEY, c VARCHAR(256));
CREATE TABLE t2 AS SELECT * FROM t1;

--disable_abort_on_error
--disable_warnings
--disable_query_log
SET @save_threads = @@GLOBAL.innodb_encryption_threads;
SET @save_tables = @@GLOBAL.innodb_encrypt_tables;

let $i = 40;
while ($i)
{
SET GLOBAL innodb_encrypt_tables = ON;
SET GLOBAL innodb_encryption_threads = 1;
CREATE OR REPLACE TABLE t1 AS SELECT * FROM t2;
CREATE OR REPLACE TABLE t2 AS SELECT * FROM t1;
SET GLOBAL innodb_encryption_rotation_iops = 100;
SET GLOBAL innodb_encrypt_tables = OFF;
CREATE OR REPLACE TABLE t2 AS SELECT * FROM t1;
CREATE OR REPLACE TABLE t1 AS SELECT * FROM t2;
dec $i;
}

--enable_abort_on_error
--enable_warnings
--enable_query_log

drop table t1,t2;
SET GLOBAL innodb_encryption_threads = 0;
SET default_storage_engine = InnoDB;

#
# MDEV-8173: InnoDB; Failing assertion: crypt_data->type == 1
Expand All @@ -58,11 +28,9 @@ INSERT IGNORE INTO `table10_int_autoinc` ( `col_int` ) VALUES ( 6 ), ( 2 ), ( 3
--connect (con1,localhost,root,,test)
--connect (con2,localhost,root,,test)

--disable_abort_on_error
--disable_warnings
--disable_query_log

let $i = 500;
let $i = 100;
while ($i)
{
connection con1;
Expand Down Expand Up @@ -101,42 +69,12 @@ dec $i;
}

--enable_query_log
disconnect con1;
disconnect con2;
connection default;
drop table if exists create_or_replace_t, table1_int_autoinc, table0_int_autoinc, table10_int_autoinc;
--disconnect con1
--disconnect con2
--enable_abort_on_error
--enable_warnings

SET GLOBAL innodb_encrypt_tables = OFF;
SET GLOBAL innodb_encryption_threads = 4;

--echo # Wait max 10 min for key encryption threads to decrypt all spaces
let $cnt=600;
while ($cnt)
{
let $success=`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0`;
if ($success)
{
let $cnt=0;
}
if (!$success)
{
real_sleep 1;
dec $cnt;
}
}
if (!$success)
{
SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION;
SHOW STATUS LIKE 'innodb_encryption%';
-- die Timeout waiting for encryption threads
}
--echo # Success!

SET GLOBAL innodb_encryption_threads = 0;
SET GLOBAL innodb_encrypt_tables = OFF;

# Make sure that all dirty pages are flushed
drop table create_or_replace_t, table1_int_autoinc, table0_int_autoinc,
table10_int_autoinc;

-- source include/restart_mysqld.inc
SET GLOBAL innodb_encryption_threads = @save_threads;
SET GLOBAL innodb_encrypt_tables = @save_tables;
--source include/wait_until_count_sessions.inc
86 changes: 86 additions & 0 deletions mysql-test/suite/encryption/t/create_or_replace_big.test
@@ -0,0 +1,86 @@
--source include/have_innodb.inc
--source include/have_file_key_management_plugin.inc
--source include/not_embedded.inc
# This is needed for longer testcase timeout at least P7/P8
--source include/big_test.inc

#
# MDEV-8164: Server crashes in pfs_mutex_enter_func after fil_crypt_is_closing or alike
#
SET default_storage_engine = InnoDB;

CREATE TABLE t1 (pk INT PRIMARY KEY, c VARCHAR(256));
CREATE TABLE t2 AS SELECT * FROM t1;

--disable_abort_on_error
--disable_warnings
--disable_query_log

let $i = 40;
while ($i)
{
SET GLOBAL innodb_encrypt_tables = ON;
SET GLOBAL innodb_encryption_threads = 1;
CREATE OR REPLACE TABLE t1 AS SELECT * FROM t2;
CREATE OR REPLACE TABLE t2 AS SELECT * FROM t1;
SET GLOBAL innodb_encryption_rotation_iops = 100;
SET GLOBAL innodb_encrypt_tables = OFF;
CREATE OR REPLACE TABLE t2 AS SELECT * FROM t1;
CREATE OR REPLACE TABLE t1 AS SELECT * FROM t2;
dec $i;
}

--enable_abort_on_error
--enable_warnings
--enable_query_log

drop table t1,t2;
SET GLOBAL innodb_encryption_threads = 0;

#
# MDEV-8173: InnoDB; Failing assertion: crypt_data->type == 1
#

SET GLOBAL innodb_encryption_threads = 4;

CREATE TABLE `table10_int_autoinc` (`col_int_key` int, pk int auto_increment, `col_int` int, key (`col_int_key` ),primary key (pk)) engine=innodb;
INSERT /*! IGNORE */ INTO table10_int_autoinc VALUES (NULL, NULL, -474021888) , (1, NULL, NULL) , (1141047296, NULL, NULL) , (NULL, NULL, NULL) , (NULL, NULL, 1) , (NULL, NULL, 9) , (0, NULL, 1225785344) , (NULL, NULL, 1574174720) , (2, NULL, NULL) , (6, NULL, 3);

CREATE TABLE `table1_int_autoinc` (`col_int_key` int, pk int auto_increment, `col_int` int,key (`col_int_key` ), primary key (pk)) engine=innodb;

CREATE TABLE `table0_int_autoinc` (`col_int_key` int, pk int auto_increment, `col_int` int, key (`col_int_key` ),primary key (pk)) engine=innodb;

INSERT /*! IGNORE */ INTO table1_int_autoinc VALUES (4, NULL, NULL);
INSERT IGNORE INTO `table0_int_autoinc` ( `col_int_key` ) VALUES ( 1 ), ( 3 ), ( 4 ), ( 1 );
INSERT IGNORE INTO `table1_int_autoinc` ( `col_int` ) VALUES ( 1 ), ( 0 ), ( 7 ), ( 9 );
INSERT IGNORE INTO `table10_int_autoinc` ( `col_int` ) VALUES ( 6 ), ( 2 ), ( 3 ), ( 6 );

--echo # Wait max 10 min for key encryption threads to decrypt all spaces
let $cnt=600;
while ($cnt)
{
let $success=`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0`;
if ($success)
{
let $cnt=0;
}
if (!$success)
{
real_sleep 1;
dec $cnt;
}
}
if (!$success)
{
SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION;
SHOW STATUS LIKE 'innodb_encryption%';
-- die Timeout waiting for encryption threads
}
--echo # Success!

SET GLOBAL innodb_encryption_threads = 0;
SET GLOBAL innodb_encrypt_tables = OFF;

DROP TABLE table0_int_autoinc, table1_int_autoinc, table10_int_autoinc;

-- source include/restart_mysqld.inc
1 change: 1 addition & 0 deletions mysql-test/suite/galera_3nodes/disabled.def
Expand Up @@ -10,6 +10,7 @@
#
##############################################################################

galera_gtid_2_cluster : MDEV-23775 Galera test failure on galera_3nodes.galera_gtid_2_cluster
galera_ist_gcache_rollover : MDEV-23578 WSREP: exception caused by message: {v=0,t=1,ut=255,o=4,s=0,sr=0,as=1,f=6,src=50524cfe,srcvid=view_id(REG,50524cfe,4),insvid=view_id(UNKNOWN,00000000,0),ru=00000000,r=[-1,-1],fs=75,nl=(}
galera_slave_options_do :MDEV-8798
galera_slave_options_ignore : MDEV-8798
6 changes: 6 additions & 0 deletions mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf
Expand Up @@ -28,6 +28,7 @@ wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#gale
wsrep_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
wsrep-on=1

[mysqld.2]
#galera_port=@OPT.port
Expand All @@ -39,6 +40,7 @@ wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#gale
wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
wsrep-on=1

[mysqld.3]
#galera_port=@OPT.port
Expand All @@ -50,6 +52,7 @@ wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.3.#gale
wsrep_sst_receive_address=127.0.0.2:@mysqld.3.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.3.#sst_port'
wsrep-on=1


[mysqld.4]
Expand All @@ -64,6 +67,7 @@ wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.4.#gale
wsrep_sst_receive_address=127.0.0.2:@mysqld.4.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.4.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.4.#sst_port'
wsrep-on=1

[mysqld.5]
wsrep_cluster_name=cluster2
Expand All @@ -76,6 +80,7 @@ wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.5.#gale
wsrep_sst_receive_address=127.0.0.2:@mysqld.5.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.5.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.5.#sst_port'
wsrep-on=1

[mysqld.6]
wsrep_cluster_name=cluster2
Expand All @@ -88,6 +93,7 @@ wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.6.#gale
wsrep_sst_receive_address=127.0.0.2:@mysqld.6.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.6.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.6.#sst_port'
wsrep-on=1

[ENV]
NODE_MYPORT_1= @mysqld.1.port
Expand Down

0 comments on commit 2cf489d

Please sign in to comment.