From b7b4c332c0869676ef69276ddaef4ac4521cb04f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Sun, 22 Jan 2017 08:44:04 +0200 Subject: [PATCH] MDEV-11614: Syslog messages: "InnoDB: Log sequence number at the start 759654123 and the end 0 do not match." For page compressed and encrypted tables log sequence number at end is not stored, thus disable this message for them. --- storage/innobase/buf/buf0buf.cc | 21 +++++++++++++-------- storage/xtradb/buf/buf0buf.cc | 21 +++++++++++++-------- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index 7a8bcd1b9d06f..ef120b8409f06 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -2,7 +2,7 @@ Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. -Copyright (c) 2013, 2016, MariaDB Corporation. All Rights Reserved. +Copyright (c) 2013, 2017, MariaDB Corporation. All Rights Reserved. Portions of this file contain modifications contributed and copyrighted by Google, Inc. Those modifications are gratefully acknowledged and are described @@ -642,8 +642,12 @@ buf_page_is_corrupted( ulint checksum_field2; ulint space_id = mach_read_from_4( read_buf + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID); + ulint page_type = mach_read_from_4( + read_buf + FIL_PAGE_TYPE); + bool no_checksum = (page_type == FIL_PAGE_PAGE_COMPRESSED || + page_type == FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED); fil_space_crypt_t* crypt_data = fil_space_get_crypt_data(space_id); - bool page_encrypted = false; + /* Page is encrypted if encryption information is found from tablespace and page contains used key_version. This is true @@ -651,10 +655,15 @@ buf_page_is_corrupted( if (crypt_data && crypt_data->type != CRYPT_SCHEME_UNENCRYPTED && fil_page_is_encrypted(read_buf)) { - page_encrypted = true; + no_checksum = true; + } + + /* Return early if there is no checksum or END_LSN */ + if (no_checksum) { + return (FALSE); } - if (!page_encrypted && !zip_size + if (!no_checksum && !zip_size && memcmp(read_buf + FIL_PAGE_LSN + 4, read_buf + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM + 4, 4)) { @@ -713,10 +722,6 @@ buf_page_is_corrupted( return(!page_zip_verify_checksum(read_buf, zip_size)); } - if (page_encrypted) { - return (FALSE); - } - checksum_field1 = mach_read_from_4( read_buf + FIL_PAGE_SPACE_OR_CHKSUM); diff --git a/storage/xtradb/buf/buf0buf.cc b/storage/xtradb/buf/buf0buf.cc index e859301a38fbb..65c4e734968b9 100644 --- a/storage/xtradb/buf/buf0buf.cc +++ b/storage/xtradb/buf/buf0buf.cc @@ -2,7 +2,7 @@ Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. -Copyright (c) 2013, 2016, MariaDB Corporation. All Rights Reserved. +Copyright (c) 2013, 2017, MariaDB Corporation. All Rights Reserved. Portions of this file contain modifications contributed and copyrighted by Google, Inc. Those modifications are gratefully acknowledged and are described @@ -707,8 +707,12 @@ buf_page_is_corrupted( ulint checksum_field2; ulint space_id = mach_read_from_4( read_buf + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID); + ulint page_type = mach_read_from_4( + read_buf + FIL_PAGE_TYPE); + bool no_checksum = (page_type == FIL_PAGE_PAGE_COMPRESSED || + page_type == FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED); fil_space_crypt_t* crypt_data = fil_space_get_crypt_data(space_id); - bool page_encrypted = false; + /* Page is encrypted if encryption information is found from tablespace and page contains used key_version. This is true @@ -716,10 +720,15 @@ buf_page_is_corrupted( if (crypt_data && crypt_data->type != CRYPT_SCHEME_UNENCRYPTED && fil_page_is_encrypted(read_buf)) { - page_encrypted = true; + no_checksum = true; + } + + /* Return early if there is no checksum or END_LSN */ + if (no_checksum) { + return (FALSE); } - if (!page_encrypted && !zip_size + if (!no_checksum && !zip_size && memcmp(read_buf + FIL_PAGE_LSN + 4, read_buf + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM + 4, 4)) { @@ -778,10 +787,6 @@ buf_page_is_corrupted( return(!page_zip_verify_checksum(read_buf, zip_size)); } - if (page_encrypted) { - return (FALSE); - } - checksum_field1 = mach_read_from_4( read_buf + FIL_PAGE_SPACE_OR_CHKSUM);