mariadb/storage
Thirunarayanan Balathandayuthapani c0f47a4a58 MDEV-12026: Implement innodb_checksum_algorithm=full_crc32
MariaDB data-at-rest encryption (innodb_encrypt_tables)
had repurposed the same unused data field that was repurposed
in MySQL 5.7 (and MariaDB 10.2) for the Split Sequence Number (SSN)
field of SPATIAL INDEX. Because of this, MariaDB was unable to
support encryption on SPATIAL INDEX pages.

Furthermore, InnoDB page checksums skipped some bytes, and there
are multiple variations and checksum algorithms. By default,
InnoDB accepts all variations of all algorithms that ever existed.
This unnecessarily weakens the page checksums.

We hereby introduce two more innodb_checksum_algorithm variants
(full_crc32, strict_full_crc32) that are special in a way:
When either setting is active, newly created data files will
carry a flag (fil_space_t::full_crc32()) that indicates that
all pages of the file will use a full CRC-32C checksum over the
entire page contents (excluding the bytes where the checksum
is stored, at the very end of the page). Such files will always
use that checksum, no matter what the parameter
innodb_checksum_algorithm is assigned to.

For old files, the old checksum algorithms will continue to be
used. The value strict_full_crc32 will be equivalent to strict_crc32
and the value full_crc32 will be equivalent to crc32.

ROW_FORMAT=COMPRESSED tables will only use the old format.
These tables do not support new features, such as larger
innodb_page_size or instant ADD/DROP COLUMN. They may be
deprecated in the future. We do not want an unnecessary
file format change for them.

The new full_crc32() format also cleans up the MariaDB tablespace
flags. We will reserve flags to store the page_compressed
compression algorithm, and to store the compressed payload length,
so that checksum can be computed over the compressed (and
possibly encrypted) stream and can be validated without
decrypting or decompressing the page.

In the full_crc32 format, there no longer are separate before-encryption
and after-encryption checksums for pages. The single checksum is
computed on the page contents that is written to the file.

We do not make the new algorithm the default for two reasons.
First, MariaDB 10.4.2 was a beta release, and the default values
of parameters should not change after beta. Second, we did not
yet implement the full_crc32 format for page_compressed pages.
This will be fixed in MDEV-18644.

This is joint work with Marko Mäkelä.
2019-02-19 18:50:19 +02:00
..
archive Optimize flush tables with read lock (FTWRL) to not wait for select's 2018-12-09 22:12:25 +02:00
blackhole Added new MDL_BACKUP locks for all backup stages 2018-12-09 22:12:27 +02:00
cassandra remove obsolete checks for -fno-implicit-templates 2018-08-12 11:37:43 +02:00
connect Merge 10.3 into 10.4 2019-02-15 12:30:43 +02:00
csv Optimize flush tables with read lock (FTWRL) to not wait for select's 2018-12-09 22:12:25 +02:00
example
federated Added new MDL_BACKUP locks for all backup stages 2018-12-09 22:12:27 +02:00
federatedx MDEV-17096 Pushdown of simple derived tables to storage engines 2019-02-13 08:55:38 -08:00
heap Merge 10.3 into 10.4 2019-02-15 12:30:43 +02:00
innobase MDEV-12026: Implement innodb_checksum_algorithm=full_crc32 2019-02-19 18:50:19 +02:00
maria Fixed compiler warnings from optimized builds 2019-01-15 17:05:42 +02:00
mroonga Merge 10.3 into 10.4 2018-12-18 11:33:53 +02:00
myisam MDEV-16188 Post-merge corrections and adjustments 2019-02-04 22:44:33 -08:00
myisammrg Merge 10.2 into 10.3 2018-11-06 09:40:39 +02:00
oqgraph MDEV-16188 Post merge fixes: fixed an obvious bug in oqgraph code. 2019-02-06 11:29:02 -08:00
perfschema MDEV-18400 - Move shutdown handling to main thread 2019-01-29 11:56:35 +04:00
rocksdb Make sure MyRocks tables do not have stats.records=0 as that confuses the optimizer. 2019-02-06 02:39:25 +03:00
sequence MDEV-16188 Post merge fixes: more for TokuDB 2019-02-08 12:32:31 -08:00
sphinx Merge 10.3 into 10.4 2018-08-16 10:08:30 +03:00
spider Merge 10.3 into 10.4 2019-02-05 12:48:02 +02:00
test_sql_discovery
tokudb Merge branch '10.4' into bb-10.4-mdev7486 2019-02-19 03:18:17 -08:00