summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--storage/innobase/log/log0recv.cc38
-rw-r--r--storage/xtradb/log/log0recv.cc37
2 files changed, 38 insertions, 37 deletions
diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc
index a8a5f7b79e3..a86fd9fd8fd 100644
--- a/storage/innobase/log/log0recv.cc
+++ b/storage/innobase/log/log0recv.cc
@@ -2631,30 +2631,30 @@ recv_scan_log_recs(
fprintf(stderr, "Scanned lsn no %lu\n",
log_block_convert_lsn_to_no(scanned_lsn));
*/
- if (no != log_block_convert_lsn_to_no(scanned_lsn)
- || !log_block_checksum_is_ok_or_old_format(log_block, true)) {
+ if (no != log_block_convert_lsn_to_no(scanned_lsn)) {
+ /* Garbage or an incompletely written log block.
+ We will not report any error; because this can happen
+ when InnoDB was killed while it was writing
+ redo log. We simply treat this as an abrupt end of the
+ redo log. */
+ finished = true;
+ break;
+ } else if (!log_block_checksum_is_ok_or_old_format(
+ log_block, true)) {
- if (no == log_block_convert_lsn_to_no(scanned_lsn)
- && !log_block_checksum_is_ok_or_old_format(
- log_block, true)) {
- fprintf(stderr,
- "InnoDB: Log block no %lu at"
- " lsn " LSN_PF " has\n"
- "InnoDB: ok header, but checksum field"
- " contains %lu, should be %lu\n",
- (ulong) no,
- scanned_lsn,
- (ulong) log_block_get_checksum(
- log_block),
- (ulong) log_block_calc_checksum(
- log_block));
- }
+ fprintf(stderr,
+ "InnoDB: Log block no %lu at"
+ " lsn " LSN_PF " has\n"
+ "InnoDB: ok header, but checksum field"
+ " contains %lu, should be %lu\n",
+ (ulong) no,
+ scanned_lsn,
+ (ulong) log_block_get_checksum(log_block),
+ (ulong) log_block_calc_checksum(log_block));
maybe_encrypted = log_crypt_block_maybe_encrypted(log_block,
&log_crypt_err);
- /* Garbage or an incompletely written log block */
-
/* Print checkpoint encryption keys if present */
log_crypt_print_checkpoint_keys(log_block);
finished = TRUE;
diff --git a/storage/xtradb/log/log0recv.cc b/storage/xtradb/log/log0recv.cc
index 2f43a1a42a8..127df00eedf 100644
--- a/storage/xtradb/log/log0recv.cc
+++ b/storage/xtradb/log/log0recv.cc
@@ -2720,24 +2720,26 @@ recv_scan_log_recs(
log_block_convert_lsn_to_no(scanned_lsn));
*/
- if (no != log_block_convert_lsn_to_no(scanned_lsn)
- || !log_block_checksum_is_ok_or_old_format(log_block, true)) {
+ if (no != log_block_convert_lsn_to_no(scanned_lsn)) {
+ /* Garbage or an incompletely written log block.
+ We will not report any error; because this can happen
+ when InnoDB was killed while it was writing
+ redo log. We simply treat this as an abrupt end of the
+ redo log. */
+ finished = true;
+ break;
+ } else if (!log_block_checksum_is_ok_or_old_format(
+ log_block, true)) {
- if (no == log_block_convert_lsn_to_no(scanned_lsn)
- && !log_block_checksum_is_ok_or_old_format(
- log_block, true)) {
- fprintf(stderr,
- "InnoDB: Log block no %lu at"
- " lsn " LSN_PF " has\n"
- "InnoDB: ok header, but checksum field"
- " contains %lu, should be %lu\n",
- (ulong) no,
- scanned_lsn,
- (ulong) log_block_get_checksum(
- log_block),
- (ulong) log_block_calc_checksum(
- log_block));
- }
+ fprintf(stderr,
+ "InnoDB: Log block no %lu at"
+ " lsn " LSN_PF " has\n"
+ "InnoDB: ok header, but checksum field"
+ " contains %lu, should be %lu\n",
+ (ulong) no,
+ scanned_lsn,
+ (ulong) log_block_get_checksum(log_block),
+ (ulong) log_block_calc_checksum(log_block));
maybe_encrypted = log_crypt_block_maybe_encrypted(log_block,
&log_crypt_err);
@@ -2764,7 +2766,6 @@ recv_scan_log_recs(
}
break;
-
}
if (log_block_get_flush_bit(log_block)) {