summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2020-06-01 14:34:16 +0530
committerThirunarayanan Balathandayuthapani <thiru@mariadb.com>2020-06-01 14:34:16 +0530
commit02f68552a4b77042edf1848ce0ce33070ab8389b (patch)
treeee0b65d734c8eb31eb887302b3c8278296f40760
parent83d0e72b34154dd24bb5b66f1732fb7753665d09 (diff)
downloadmariadb-git-02f68552a4b77042edf1848ce0ce33070ab8389b.tar.gz
MDEV-22650 Dirty compressed page checksum validation fails
Problem: ======= While evicting the uncompressed page from buffer pool, InnoDB writes the checksum for the compressed page in buf_LRU_free_page(). So while flushing the compressed page, checksum validation fails when innodb_checksum_algorithm variable changed to strict_none. Solution: ======== - Calculate the checksum only during flushing of page. Removed the checksum write in buf_LRU_free_page().
-rw-r--r--storage/innobase/buf/buf0buf.cc2
-rw-r--r--storage/innobase/buf/buf0flu.cc6
-rw-r--r--storage/innobase/buf/buf0lru.cc21
3 files changed, 3 insertions, 26 deletions
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index 3beae8982b6..5cecb9581bd 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -4625,7 +4625,7 @@ evict_from_pool:
buf_pool->mutex or block->mutex. */
{
- bool success = buf_zip_decompress(block, TRUE);
+ bool success = buf_zip_decompress(block, false);
if (!success) {
buf_pool_mutex_enter(buf_pool);
diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc
index 3c3cc99de72..3c91c9595c4 100644
--- a/storage/innobase/buf/buf0flu.cc
+++ b/storage/innobase/buf/buf0flu.cc
@@ -1069,10 +1069,8 @@ buf_flush_write_block_low(
case BUF_BLOCK_ZIP_DIRTY:
frame = bpage->zip.data;
- mach_write_to_8(frame + FIL_PAGE_LSN,
- bpage->newest_modification);
-
- ut_a(page_zip_verify_checksum(frame, bpage->size.physical()));
+ buf_flush_update_zip_checksum(frame, bpage->size.physical(),
+ bpage->newest_modification);
break;
case BUF_BLOCK_FILE_PAGE:
frame = bpage->zip.data;
diff --git a/storage/innobase/buf/buf0lru.cc b/storage/innobase/buf/buf0lru.cc
index 6e2dba77513..107d0628400 100644
--- a/storage/innobase/buf/buf0lru.cc
+++ b/storage/innobase/buf/buf0lru.cc
@@ -1617,27 +1617,6 @@ func_exit:
UNIV_MEM_INVALID(((buf_block_t*) bpage)->frame,
UNIV_PAGE_SIZE);
- if (b != NULL) {
-
- /* Compute and stamp the compressed page
- checksum while not holding any mutex. The
- block is already half-freed
- (BUF_BLOCK_REMOVE_HASH) and removed from
- buf_pool->page_hash, thus inaccessible by any
- other thread. */
-
- ut_ad(b->size.is_compressed());
-
- const uint32_t checksum = page_zip_calc_checksum(
- b->zip.data,
- b->size.physical(),
- static_cast<srv_checksum_algorithm_t>(
- srv_checksum_algorithm));
-
- mach_write_to_4(b->zip.data + FIL_PAGE_SPACE_OR_CHKSUM,
- checksum);
- }
-
buf_pool_mutex_enter(buf_pool);
if (b != NULL) {