diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-08-16 06:35:28 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-08-16 06:37:52 +0300 |
commit | 05153a670de6eee0959ce564e11bb2f7ca820d42 (patch) | |
tree | e755cf6016b34c67ac305532c538ccfe344b8dea | |
parent | a0ce321627a13658d5e8a37d7c3dfb0ef26ae0ed (diff) | |
download | mariadb-git-05153a670de6eee0959ce564e11bb2f7ca820d42.tar.gz |
Report all redo log corruption
Amend commit b853b4fd88b441f36eeb7eabdce79918ef10538a
that was reverted in commit 29150e23912ef6e1fe386f53b778c9a5551c4790.
recv_parse_log_recs(): Do check for corrupted redo log or file
system before checking for len==0, but only read *ptr if
it is not past the end of the buffer (end_ptr).
recv_parse_log_rec(): Report incorrect redo log type
in a consistent way with recv_parse_or_apply_log_rec_body().
This is a follow-up to commit f30c5af42e4e72a3a0d8d5fb7b9fc884a249f292.
-rw-r--r-- | storage/innobase/log/log0recv.cc | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc index 77e61606c1e..ee4d627261a 100644 --- a/storage/innobase/log/log0recv.cc +++ b/storage/innobase/log/log0recv.cc @@ -2253,7 +2253,8 @@ recv_parse_log_rec( case MLOG_MULTI_REC_END | MLOG_SINGLE_REC_FLAG: case MLOG_DUMMY_RECORD | MLOG_SINGLE_REC_FLAG: case MLOG_CHECKPOINT | MLOG_SINGLE_REC_FLAG: - ib::error() << "Incorrect log record type:" << *ptr; + ib::error() << "Incorrect log record type " + << ib::hex(unsigned(*ptr)); recv_sys->found_corrupt_log = true; return(0); } @@ -2422,10 +2423,6 @@ loop: len = recv_parse_log_rec(&type, ptr, end_ptr, &space, &page_no, apply, &body); - if (len == 0) { - return(false); - } - if (recv_sys->found_corrupt_log) { recv_report_corrupt_log(ptr, type, space, page_no); return(true); @@ -2435,6 +2432,10 @@ loop: return(true); } + if (len == 0) { + return(false); + } + new_recovered_lsn = recv_calc_lsn_on_data_add(old_lsn, len); if (new_recovered_lsn > recv_sys->scanned_lsn) { @@ -2558,13 +2559,10 @@ loop: &type, ptr, end_ptr, &space, &page_no, false, &body); - if (len == 0) { - return(false); - } - if (recv_sys->found_corrupt_log || type == MLOG_CHECKPOINT - || (*ptr & MLOG_SINGLE_REC_FLAG)) { + || (ptr != end_ptr + && (*ptr & MLOG_SINGLE_REC_FLAG))) { recv_sys->found_corrupt_log = true; recv_report_corrupt_log( ptr, type, space, page_no); @@ -2575,6 +2573,10 @@ loop: return(true); } + if (len == 0) { + return(false); + } + recv_previous_parsed_rec_type = type; recv_previous_parsed_rec_offset = recv_sys->recovered_offset + total_len; |