Skip to content

Commit

Permalink
MDEV-11614: Syslog messages: "InnoDB: Log sequence number
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Jan Lindström committed Jan 22, 2017
1 parent 213fc70 commit b7b4c33
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 deletions.
21 changes: 13 additions & 8 deletions storage/innobase/buf/buf0buf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -642,19 +642,28 @@ 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
also for pages first compressed and then encrypted. */
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)) {
Expand Down Expand Up @@ -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);

Expand Down
21 changes: 13 additions & 8 deletions storage/xtradb/buf/buf0buf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -707,19 +707,28 @@ 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
also for pages first compressed and then encrypted. */
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)) {
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit b7b4c33

Please sign in to comment.