summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2017-01-22 08:44:04 +0200
committerJan Lindström <jan.lindstrom@mariadb.com>2017-01-22 08:46:15 +0200
commitb7b4c332c0869676ef69276ddaef4ac4521cb04f (patch)
tree5528fc542ecbbfc54ab6c9b544bc943d9b8563ca
parent213fc700b64a38d64efceef2a2ef8de9748a8ce5 (diff)
downloadmariadb-git-b7b4c332c0869676ef69276ddaef4ac4521cb04f.tar.gz
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.
-rw-r--r--storage/innobase/buf/buf0buf.cc21
-rw-r--r--storage/xtradb/buf/buf0buf.cc21
2 files changed, 26 insertions, 16 deletions
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index 7a8bcd1b9d0..ef120b8409f 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 e859301a38f..65c4e734968 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);