diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2017-02-01 15:47:33 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2017-02-02 10:20:22 +0200 |
commit | 650ffcd3a081f0bf4e3b7de93fac72c1b67284e1 (patch) | |
tree | b26ac484a4328c7353127b7e412e75c074928f4a /storage/innobase/log/log0recv.cc | |
parent | 8481c70ede067b576d5b1576a9b68042e84368fb (diff) | |
download | mariadb-git-650ffcd3a081f0bf4e3b7de93fac72c1b67284e1.tar.gz |
Extend the innodb.log_corruption test.
Remove the dependency on unzip. Instead, generate the InnoDB files
with perl.
log_block_checksum_is_ok(): Correct the error message.
recv_scan_log_recs(): Remove the duplicated error message for
log block checksum mismatch.
innobase_start_or_create_for_mysql(): If the server is in read-only
mode or if innodb_force_recovery>=3, do not try to modify the system
tablespace. (If the doublewrite buffer or the non-core system tables
do not exist, do not try to create them.)
innodb_shutdown(): Relax a debug assertion. If the system tablespace
did not contain a doublewrite buffer and if we started up in
innodb_read_only mode or with innodb_force_recovery>=3, it will not
be created.
dict_create_or_check_sys_tablespace(): Set the flag
srv_sys_tablespaces_open when the tables exist.
Diffstat (limited to 'storage/innobase/log/log0recv.cc')
-rw-r--r-- | storage/innobase/log/log0recv.cc | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc index 78566d060cb..bc8b8ffd1dd 100644 --- a/storage/innobase/log/log0recv.cc +++ b/storage/innobase/log/log0recv.cc @@ -1023,25 +1023,24 @@ recv_find_max_checkpoint( /** Check the 4-byte checksum to the trailer checksum field of a log block. -@param[in] log block +@param[in] block log block +@param[in] print_err whether to report checksum mismatch @return whether the checksum matches */ bool -log_block_checksum_is_ok( - const byte* block, /*!< in: pointer to a log block */ - bool print_err) /*!< in print error ? */ +log_block_checksum_is_ok(const byte* block, bool print_err) { - if (log_block_get_checksum(block) != log_block_calc_checksum(block) && - print_err) { - ib::error() << " Log block checkpoint not correct." + bool valid + = log_block_get_checksum(block) == log_block_calc_checksum(block); + + if (!valid && print_err) { + ib::error() << "Invalid log block checksum." << " block: " << log_block_get_hdr_no(block) << " checkpoint no: " << log_block_get_checkpoint_no(block) - << " calc checkpoint: " << log_block_calc_checksum(block) - << " stored checkpoint: " << log_block_get_checksum(block); + << " expected: " << log_block_calc_checksum(block) + << " found: " << log_block_get_checksum(block); } - return(!innodb_log_checksums - || log_block_get_checksum(block) - == log_block_calc_checksum(block)); + return(valid || !innodb_log_checksums); } /** Try to parse a single log record body and also applies it if @@ -2778,12 +2777,6 @@ recv_scan_log_recs( return (TRUE); } - ib::error() << "Log block " << no << - " at lsn " << scanned_lsn << " has valid" - " header, but checksum field contains " - << log_block_get_checksum(log_block) - << ", should be " - << log_block_calc_checksum(log_block); /* Garbage or an incompletely written log block. This could be the result of killing the server |