Skip to content

Commit

Permalink
Remove MYSQL_COMPRESSION.
Browse files Browse the repository at this point in the history
The MariaDB 10.1 page_compression is incompatible with the Oracle
implementation that was introduced in MySQL 5.7 later.

Remove the Oracle implementation. Also remove the remaining traces of
MYSQL_ENCRYPTION.

This will also remove traces of PUNCH_HOLE until it is implemented
better. The only effective call to os_file_punch_hole() was in
fil_node_create_low() to test if the operation is supported for the file.

In other words, it looks like page_compression is not working in
MariaDB 10.2, because no code equivalent to the 10.1 os_file_trim()
is enabled.
  • Loading branch information
dr-m committed Jan 18, 2017
1 parent 70c1148 commit 1eabad5
Show file tree
Hide file tree
Showing 28 changed files with 113 additions and 2,382 deletions.
53 changes: 11 additions & 42 deletions storage/innobase/buf/buf0buf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5943,7 +5943,6 @@ buf_page_io_complete(
ulint read_page_no;
ulint read_space_id;
byte* frame = NULL;
bool compressed_page=false;

ut_ad(bpage->zip.data != NULL || ((buf_block_t*)bpage)->frame != NULL);

Expand All @@ -5957,8 +5956,6 @@ buf_page_io_complete(

ib::info() << "Page "
<< bpage->id
<< " in tablespace "
<< bpage->space
<< " encryption error key_version "
<< bpage->key_version;

Expand All @@ -5974,12 +5971,9 @@ buf_page_io_complete(
FALSE)) {

buf_pool->n_pend_unzip--;
compressed_page = false;

ib::info() << "Page "
<< bpage->id
<< " in tablespace "
<< bpage->space
<< " zip_decompress failure.";

goto database_corrupted;
Expand All @@ -6005,51 +5999,30 @@ buf_page_io_complete(

} else if (read_space_id == 0 && read_page_no == 0) {
/* This is likely an uninitialized page. */
} else if ((bpage->id.space() != 0
} else if ((bpage->id.space() != TRX_SYS_SPACE
&& bpage->id.space() != read_space_id)
|| bpage->id.page_no() != read_page_no) {
/* We did not compare space_id to read_space_id
if bpage->space == 0, because the field on the
page may contain garbage in MySQL < 4.1.1,
which only supported bpage->space == 0. */
in the system tablespace, because the field
was written as garbage before MySQL 4.1.1,
which did not support innodb_file_per_table. */

ib::error() << "Space id and page no stored in "
"the page, read in are "
<< page_id_t(read_space_id, read_page_no)
<< ", should be " << bpage->id;
}

#ifdef MYSQL_COMPRESSION
compressed_page = Compression::is_compressed_page(frame);

/* If the decompress failed then the most likely case is
that we are reading in a page for which this instance doesn't
support the compression algorithm. */
if (compressed_page) {

Compression::meta_t meta;

Compression::deserialize_header(frame, &meta);

ib::error()
<< "Page " << bpage->id << " "
<< "compressed with "
<< Compression::to_string(meta) << " "
<< "that is not supported by this instance";
}
#endif /* MYSQL_COMPRESSION */

/* From version 3.23.38 up we store the page checksum
to the 4 first bytes of the page end lsn field */
if (compressed_page
|| buf_page_is_corrupted(
if (buf_page_is_corrupted(
true, frame, bpage->size,
fsp_is_checksum_disabled(bpage->id.space()))) {

/* Not a real corruption if it was triggered by
error injection */
DBUG_EXECUTE_IF("buf_page_is_corrupt_failure",
if (bpage->space > TRX_SYS_SPACE
if (bpage->id.space() != TRX_SYS_SPACE
&& buf_mark_space_corrupt(bpage)) {
ib::info() <<
"Simulated page corruption";
Expand All @@ -6076,7 +6049,7 @@ buf_page_io_complete(

/* Compressed and encrypted pages are basically gibberish avoid
printing the contents. */
if (corrupted && !compressed_page) {
if (corrupted) {

ib::error()
<< "Database page corruption on disk"
Expand Down Expand Up @@ -6124,11 +6097,11 @@ buf_page_io_complete(
}

ib_push_warning((void *)NULL, DB_DECRYPTION_FAILED,
"Table in tablespace %lu encrypted."
"Table in tablespace %u encrypted."
"However key management plugin or used key_id %u is not found or"
" used encryption algorithm or method does not match."
" Can't continue opening the table.",
(ulint)bpage->space, key_version);
bpage->id.space(), key_version);

buf_page_print(frame, bpage->size, BUF_PAGE_PRINT_NO_CRASH);

Expand All @@ -6152,9 +6125,6 @@ buf_page_io_complete(
/* If space is being truncated then avoid ibuf operation.
During re-init we have already freed ibuf entries. */
if (uncompressed
#ifdef MYSQL_COMPRESSION
&& !Compression::is_compressed_page(frame)
#endif /* MYSQL_COMPRESSION */
&& !recv_no_ibuf_operations
&& !Tablespace::is_undo_tablespace(bpage->id.space())
&& bpage->id.space() != SRV_TMP_SPACE_ID
Expand All @@ -6164,11 +6134,11 @@ buf_page_io_complete(

if (bpage && bpage->encrypted) {
fprintf(stderr,
"InnoDB: Warning: Table in tablespace %lu encrypted."
"InnoDB: Warning: Table in tablespace %u encrypted."
"However key management plugin or used key_id %u is not found or"
" used encryption algorithm or method does not match."
" Can't continue opening the table.\n",
(ulint)bpage->space, bpage->key_version);
bpage->id.space(), bpage->key_version);
} else {
ibuf_merge_or_delete_for_page(
(buf_block_t*) bpage, bpage->id,
Expand Down Expand Up @@ -7604,7 +7574,6 @@ buf_page_decrypt_after_read(
bpage->key_version = key_version;
bpage->page_encrypted = page_compressed_encrypted;
bpage->page_compressed = page_compressed;
bpage->space = bpage->id.space();

if (page_compressed) {
/* the page we read is unencrypted */
Expand Down
14 changes: 1 addition & 13 deletions storage/innobase/buf/buf0dblwr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,6 @@ buf_dblwr_init_or_load_pages(

IORequest read_request(IORequest::READ);

read_request.disable_compression();

err = os_file_read(
read_request,
file, read_buf, TRX_SYS_PAGE_NO * UNIV_PAGE_SIZE,
Expand Down Expand Up @@ -496,11 +494,6 @@ buf_dblwr_init_or_load_pages(

IORequest write_request(IORequest::WRITE);

/* Recovered data file pages are written out
as uncompressed. */

write_request.disable_compression();

err = os_file_write(
write_request, path, file, page,
source_page_no * UNIV_PAGE_SIZE,
Expand Down Expand Up @@ -704,20 +697,15 @@ buf_dblwr_process(void)
}
}

/* Recovered data file pages are written out
as uncompressed. */

IORequest write_request(IORequest::WRITE);

write_request.disable_compression();

/* Write the good page from the doublewrite
buffer to the intended position. */

fil_io(write_request, true,
page_id, page_size,
0, page_size.physical(),
const_cast<byte*>(page), NULL, NULL);
const_cast<byte*>(page), NULL, NULL);

ib::info()
<< "Recovered page "
Expand Down
Loading

0 comments on commit 1eabad5

Please sign in to comment.