Skip to content

Commit

Permalink
PS-6789 (Merge MySQL 8.0.20): Re-implemented parallel doublewrite buf…
Browse files Browse the repository at this point in the history
…fer encryption

https://jira.percona.com/browse/PS-6789

Re-implemented parallel doublewrite  buffer encryption part of the PS-3822
"InnoDB system tablespace encryption"
(https://jira.percona.com/browse/PS-3822)
after 8.0.20 upstream merge.

Re-enabled the following MTR test cases:
- 'innodb.percona_parallel_dblwr_encrypt'
- 'sys_vars.innodb_parallel_dblwr_encrypt_basic'

Removed 'innodb.percona_doublewrite' MTR test case as there is no
Percona-specific doublewrite buffer implementation any more.
  • Loading branch information
satya-bodapati authored and percona-ysorokin committed Jun 17, 2020
1 parent 3161673 commit f6f0876
Show file tree
Hide file tree
Showing 18 changed files with 213 additions and 260 deletions.
7 changes: 0 additions & 7 deletions mysql-test/collections/disabled.def
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,3 @@ encryption.innodb-bad-key-change2 : BUG#5322 Keyring encrypted tablespace import
encryption.innodb-bad-key-change3 : BUG#5322 Keyring encrypted tablespace import/export is broken
encryption.innodb_encryption_discard_import : BUG#5322 Keyring encrypted tablespace import/export is broken
encryption.innodb-redo-wrongkey : BUG#5635 Intoduce crypt_schema 2 for better error checking in encryption threads

# temporary disabled until upstream 8.0.20 (with new parallel doublewrite) is merged
innodb.percona_parallel_dblwr_encrypt : BUG#0 Temporary disabled for 8.0.20 merge
sys_vars.innodb_parallel_dblwr_encrypt_basic : BUG#0 Temporary disabled for 8.0.20 merge

sys_vars.innodb_parallel_doublewrite_path_basic : BUG#0 Temporary disabled for 8.0.20 merge
innodb.percona_doublewrite : BUG#0 Temporary disabled for 8.0.20 merge
8 changes: 4 additions & 4 deletions mysql-test/r/all_persisted_variables.result
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ include/assert.inc [Expect 500+ variables in the table. Due to open Bugs, we are

# Test SET PERSIST

include/assert.inc [Expect 446 persisted variables in the table.]
include/assert.inc [Expect 447 persisted variables in the table.]

************************************************************
* 3. Restart server, it must preserve the persisted variable
* settings. Verify persisted configuration.
************************************************************
# restart

include/assert.inc [Expect 446 persisted variables in persisted_variables table.]
include/assert.inc [Expect 446 persisted variables shown as PERSISTED in variables_info table.]
include/assert.inc [Expect 446 persisted variables with matching peristed and global values.]
include/assert.inc [Expect 447 persisted variables in persisted_variables table.]
include/assert.inc [Expect 447 persisted variables shown as PERSISTED in variables_info table.]
include/assert.inc [Expect 447 persisted variables with matching peristed and global values.]

************************************************************
* 4. Test RESET PERSIST IF EXISTS. Verify persisted variable
Expand Down
52 changes: 0 additions & 52 deletions mysql-test/suite/innodb/r/percona_doublewrite.result

This file was deleted.

16 changes: 11 additions & 5 deletions mysql-test/suite/innodb/r/percona_parallel_dblwr_encrypt.result
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
CREATE TABLE t1(a TEXT) ENCRYPTION='Y';
CREATE TABLE t2(a TEXT) ENCRYPTION='Y';
CREATE TABLE t3(a TEXT) ENCRYPTION='Y';
SET GLOBAL innodb_buf_flush_list_now=ON;
SET GLOBAL innodb_checkpoint_disabled=ON;
SET GLOBAL innodb_limit_optimistic_insert_debug=2;
INSERT INTO t1 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t1 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t1 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t1 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t1 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t1 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
CREATE TABLE t2(a TEXT) ENCRYPTION='Y';
INSERT INTO t2 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t2 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t2 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t2 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t2 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t2 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
CREATE TABLE t3(a TEXT) ENCRYPTION='Y';
INSERT INTO t3 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t3 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t3 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
Expand All @@ -25,21 +28,24 @@ Pattern found.
# restart
DROP TABLE t1, t2, t3;
CREATE TABLE t1(a TEXT) ENCRYPTION='Y';
CREATE TABLE t2(a TEXT) ENCRYPTION='Y';
CREATE TABLE t3(a TEXT) ENCRYPTION='Y';
SET GLOBAL innodb_parallel_dblwr_encrypt=ON;
SET GLOBAL innodb_buf_flush_list_now=ON;
SET GLOBAL innodb_checkpoint_disabled=ON;
SET GLOBAL innodb_limit_optimistic_insert_debug=2;
INSERT INTO t1 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t1 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t1 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t1 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t1 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t1 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
CREATE TABLE t2(a TEXT) ENCRYPTION='Y';
INSERT INTO t2 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t2 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t2 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t2 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t2 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t2 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
CREATE TABLE t3(a TEXT) ENCRYPTION='Y';
INSERT INTO t3 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t3 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t3 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
Expand All @@ -49,5 +55,5 @@ INSERT INTO t3 (a) VALUES ('Abracadabra is of unknown origin, and its first occu
# Kill the server
# Writes to Parallel dblwr are encrypted, so it should be "Pattern not found"
Pattern not found.
# restart
# restart: --debug=d,force_dblwr_decryption
DROP TABLE t1, t2, t3;
145 changes: 0 additions & 145 deletions mysql-test/suite/innodb/t/percona_doublewrite.test

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
$KEYRING_PLUGIN_OPT
$KEYRING_PLUGIN_EARLY_LOAD
--keyring_file_data=$MYSQL_TMP_DIR/mysecret_keyring
--innodb_doublewrite_pages=20
24 changes: 15 additions & 9 deletions mysql-test/suite/innodb/t/percona_parallel_dblwr_encrypt.test
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# Test Parallel double write buffer encryption
--source include/have_debug.inc
--source include/have_innodb_16k.inc

--let $MYSQLD_DATADIR=`SELECT @@datadir`

CREATE TABLE t1(a TEXT) ENCRYPTION='Y';
CREATE TABLE t2(a TEXT) ENCRYPTION='Y';
CREATE TABLE t3(a TEXT) ENCRYPTION='Y';
SET GLOBAL innodb_buf_flush_list_now=ON;
SET GLOBAL innodb_checkpoint_disabled=ON;
SET GLOBAL innodb_limit_optimistic_insert_debug=2;

INSERT INTO t1 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t1 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
Expand All @@ -11,7 +18,6 @@ INSERT INTO t1 (a) VALUES ('Abracadabra is of unknown origin, and its first occu
INSERT INTO t1 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t1 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');

CREATE TABLE t2(a TEXT) ENCRYPTION='Y';

INSERT INTO t2 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t2 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
Expand All @@ -20,8 +26,6 @@ INSERT INTO t2 (a) VALUES ('Abracadabra is of unknown origin, and its first occu
INSERT INTO t2 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t2 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');

CREATE TABLE t3(a TEXT) ENCRYPTION='Y';

INSERT INTO t3 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t3 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t3 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
Expand All @@ -37,15 +41,20 @@ INSERT INTO t3 (a) VALUES ('Abracadabra is of unknown origin, and its first occu

--echo # Writes to Parallel dblwr are not encrypted, so it should be "Pattern found"
--let $grep_pattern= first occurrence
--let $grep_file= $MYSQLD_DATADIR/xb_doublewrite
--let $grep_file= $MYSQLD_DATADIR/#ib_16384_0.dblwr
--let $grep_output= boolean
--source include/grep_pattern.inc

--source include/start_mysqld.inc
DROP TABLE t1, t2, t3;
CREATE TABLE t1(a TEXT) ENCRYPTION='Y';
CREATE TABLE t2(a TEXT) ENCRYPTION='Y';
CREATE TABLE t3(a TEXT) ENCRYPTION='Y';

SET GLOBAL innodb_parallel_dblwr_encrypt=ON;
SET GLOBAL innodb_buf_flush_list_now=ON;
SET GLOBAL innodb_checkpoint_disabled=ON;
SET GLOBAL innodb_limit_optimistic_insert_debug=2;

INSERT INTO t1 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t1 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
Expand All @@ -54,17 +63,13 @@ INSERT INTO t1 (a) VALUES ('Abracadabra is of unknown origin, and its first occu
INSERT INTO t1 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t1 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');

CREATE TABLE t2(a TEXT) ENCRYPTION='Y';

INSERT INTO t2 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t2 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t2 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t2 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t2 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t2 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');

CREATE TABLE t3(a TEXT) ENCRYPTION='Y';

INSERT INTO t3 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t3 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
INSERT INTO t3 (a) VALUES ('Abracadabra is of unknown origin, and its first occurrence is');
Expand All @@ -77,10 +82,11 @@ INSERT INTO t3 (a) VALUES ('Abracadabra is of unknown origin, and its first occu
--source include/wait_condition.inc

--source include/kill_mysqld.inc
--let $restart_parameters = "restart: --debug=d,force_dblwr_decryption"

--echo # Writes to Parallel dblwr are encrypted, so it should be "Pattern not found"
--let $grep_pattern= first occurrence
--let $grep_file= $MYSQLD_DATADIR/xb_doublewrite
--let $grep_file= $MYSQLD_DATADIR/#ib_16384_0.dblwr
--let $grep_output= boolean
--source include/grep_pattern.inc

Expand Down

This file was deleted.

Loading

0 comments on commit f6f0876

Please sign in to comment.