revision-id: ab398a3b8aba965bf22517eb9cd7d12383d080f4 (mariadb-10.2.19-24-gab398a3b8ab) parent(s): d0bf132a6ace31c29813b4004fab2a8af780deaa author: Jan Lindström committer: Jan Lindström timestamp: 2018-11-27 13:16:19 +0200 message: MDEV-17810: Improve error printout when decryption fails or we identify page as both encrypted and unencrypted fil_space_verify_crypt_checksum Print out both stored checksum and calculated checksums for encrypted page and unencrypted page asumptions. --- storage/innobase/fil/fil0crypt.cc | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc index 77760d7159a..d3a7c531d4f 100644 --- a/storage/innobase/fil/fil0crypt.cc +++ b/storage/innobase/fil/fil0crypt.cc @@ -2569,7 +2569,7 @@ fil_space_verify_crypt_checksum( return (true); } - uint32 cchecksum1, cchecksum2; + uint32_t cchecksum1, cchecksum2; /* Calculate checksums */ if (page_size.is_compressed()) { @@ -2652,10 +2652,19 @@ fil_space_verify_crypt_checksum( #else /* UNIV_INNOCHECKSUM */ ib::error() << " Page " << space << ":" << offset - << " may be corrupted." - " Post encryption checksum " << checksum - << " stored [" << checksum1 << ":" << checksum2 + << " may be corrupted."; + ib::info() + << "If encrypted: stored checksum" << checksum + << " calculated checksum [" << cchecksum1 << ":" << cchecksum2 << "] key_version " << key_version; + ib::info() + << "If unencrypted: stored checksum [" << checksum1 + << ":" << checksum2 << "] calculated crc32 [" + << buf_calc_page_crc32(page, false) << ":" + << buf_calc_page_crc32(page, true) << "] innodb [" + << buf_calc_page_old_checksum(page) << ":" + << buf_calc_page_new_checksum(page) << "] LSN " + << mach_read_from_4(page + FIL_PAGE_LSN); #endif encrypted = false; }