mariadb/storage/innobase
Marko Mäkelä 36a971724e MDEV-13167 InnoDB key rotation is not skipping unused pages
In key rotation, we must initialize unallocated but previously
initialized pages, so that if encryption is enabled on a table,
all clear-text data for the page will eventually be overwritten.
But we should not rotate keys on pages that were never allocated
after the data file was created.

According to the latching order rules, after acquiring the
tablespace latch, no page latches of previously allocated user pages
may be acquired. So, key rotation should check the page allocation
status after acquiring the page latch, not before. But, the latching
order rules also prohibit accessing pages that were not allocated first,
and then acquiring the tablespace latch. Such behaviour would indeed
result in a deadlock when running the following tests:
encryption.innodb_encryption-page-compression
encryption.innodb-checksum-algorithm

Because the key rotation is accessing potentially unallocated pages, it
cannot reliably check if these pages were allocated. It can only check
the page header. If the page number is zero, we can assume that the
page is unallocated.

fil_crypt_rotate_pages(): Skip pages that are known to be uninitialized.

fil_crypt_rotate_page(): Detect uninitialized pages by FIL_PAGE_OFFSET.
Page 0 is never encrypted, and on other pages that are initialized,
FIL_PAGE_OFFSET must contain the page number.

fil_crypt_is_page_uninitialized(): Remove. It suffices to check the
page number field in fil_crypt_rotate_page().
2017-08-23 10:14:28 +03:00
..
btr Code clean-up related to MDEV-13167 2017-08-23 09:47:50 +03:00
buf MDEV-13485 MTR tests fail massively with --innodb-sync-debug 2017-08-23 08:44:11 +03:00
data InnoDB: Remove dead code for DATA_POINT and DATA_VAR_POINT 2017-07-03 12:17:10 +03:00
dict MDEV-13485 MTR tests fail massively with --innodb-sync-debug 2017-08-23 08:44:11 +03:00
eval MDEV-12271 Port MySQL 8.0 Bug#23150562 REMOVE UNIV_MUST_NOT_INLINE AND UNIV_NONINL 2017-03-17 12:42:07 +02:00
fil MDEV-13167 InnoDB key rotation is not skipping unused pages 2017-08-23 10:14:28 +03:00
fsp Code clean-up related to MDEV-13167 2017-08-23 09:47:50 +03:00
fts MDEV-13084 MariaDB 10.2 crashes on corrupted SYS_TABLES.MIX_LEN field 2017-06-14 09:08:04 +03:00
fut MDEV-12270 Port MySQL 8.0 Bug#21141390 REMOVE UNUSED FUNCTIONS AND CONVERT GLOBAL SYMBOLS TO STATIC 2017-03-17 12:48:50 +02:00
gis Minor code cleanup. 2017-04-17 03:20:34 +03:00
ha Bug#24346574 PAGE CLEANER THREAD, ASSERT BLOCK->N_POINTERS == 0 2017-04-26 23:03:27 +03:00
handler MDEV-13485 MTR tests fail massively with --innodb-sync-debug 2017-08-23 08:44:11 +03:00
ibuf MDEV-13451 Assertion `!recv_no_ibuf_operations' failed in ibuf_page_low() 2017-08-07 13:50:31 +03:00
include Code clean-up related to MDEV-13167 2017-08-23 09:47:50 +03:00
lock Fix some GCC 7 warnings for InnoDB 2017-08-10 14:00:51 +03:00
log Remove the unused redo log record type MLOG_INIT_FILE_PAGE 2017-08-23 08:13:56 +03:00
mach Fix Bug#24707869 GCC 5 AND 6 MISCOMPILE MACH_PARSE_COMPRESSED 2017-04-26 23:03:29 +03:00
mem MDEV-12271 Port MySQL 8.0 Bug#23150562 REMOVE UNIV_MUST_NOT_INLINE AND UNIV_NONINL 2017-03-17 12:42:07 +02:00
mtr MDEV-13452 Assertion `!recv_no_log_write' failed in log_reserve_and_open() 2017-08-07 13:54:37 +03:00
mysql-test/storage_engine Merge branch '10.0' into 10.1 2017-08-08 10:18:43 +02:00
os MDEV-12948 : do not spam error log, if DeviceIoControl(IOCTL_STORAGE_QUERY_PROPERTY) 2017-08-17 17:36:39 +00:00
page MDEV-11939: innochecksum mistakes a file for an encrypted one (page 0 invalid) 2017-08-08 09:41:09 +03:00
pars Remove unused tokens from the InnoDB SQL parser. 2017-04-17 03:20:34 +03:00
que Fix some printf format type mismatch 2017-06-06 12:04:29 +03:00
read Merge InnoDB 5.7 from mysql-5.7.9. 2016-09-02 13:22:28 +03:00
rem InnoDB: Remove dead code for DATA_POINT and DATA_VAR_POINT 2017-07-03 12:17:10 +03:00
row MDEV-13485 MTR tests fail massively with --innodb-sync-debug 2017-08-23 08:44:11 +03:00
srv MDEV-13485 MTR tests fail massively with --innodb-sync-debug 2017-08-23 08:44:11 +03:00
sync MDEV-13485 MTR tests fail massively with --innodb-sync-debug 2017-08-23 08:44:11 +03:00
trx MDEV-13520 InnoDB attempts UPDATE with DB_TRX_ID=0 if innodb_force_recovery=3 2017-08-15 10:51:42 +03:00
usr Merge 10.1 into 10.2 2017-05-22 09:46:51 +03:00
ut Fix some GCC 7 warnings for InnoDB 2017-08-10 14:00:51 +03:00
bzip2.cmake cleanup: innodb files in cmake/ 2017-03-29 00:40:22 +02:00
CMakeLists.txt cleanup: remove ha_innopart.cc 2017-08-16 18:14:26 +02:00
compile-innodb
COPYING.Google
COPYING.Percona
innodb.cmake Merge branch '10.1' into 10.2 2017-08-17 11:38:34 +02:00
lz4.cmake cleanup: innodb files in cmake/ 2017-03-29 00:40:22 +02:00
lzma.cmake cleanup: innodb files in cmake/ 2017-03-29 00:40:22 +02:00
lzo.cmake cleanup: innodb files in cmake/ 2017-03-29 00:40:22 +02:00
plugin_exports
snappy.cmake cleanup: innodb files in cmake/ 2017-03-29 00:40:22 +02:00