mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
Report InnoDB redo log corruption better
recv_parse_log_recs(): Check for corruption before checking for end-of-log-buffer. mlog_parse_initial_log_record(), page_cur_parse_delete_rec(): Flag corruption for out-of-bounds values, and let the caller dump the corrupted redo log extract.
This commit is contained in:
parent
0e15ae1602
commit
b853b4fd88
3 changed files with 18 additions and 13 deletions
|
@ -2251,7 +2251,6 @@ recv_parse_log_rec(
|
|||
*type, new_ptr, end_ptr, *space, *page_no, apply, NULL, NULL);
|
||||
|
||||
if (UNIV_UNLIKELY(new_ptr == NULL)) {
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
@ -2402,13 +2401,8 @@ 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);
|
||||
recv_report_corrupt_log(ptr, type, space, page_no);
|
||||
return(true);
|
||||
}
|
||||
|
||||
|
@ -2416,6 +2410,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) {
|
||||
|
@ -2542,10 +2540,6 @@ 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)) {
|
||||
|
@ -2559,6 +2553,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;
|
||||
|
|
|
@ -98,7 +98,11 @@ mlog_parse_initial_log_record(
|
|||
}
|
||||
|
||||
*type = mlog_id_t(*ptr & ~MLOG_SINGLE_REC_FLAG);
|
||||
ut_ad(*type <= MLOG_BIGGEST_TYPE || EXTRA_CHECK_MLOG_NUMBER(*type));
|
||||
if (UNIV_UNLIKELY(*type > MLOG_BIGGEST_TYPE
|
||||
&& !EXTRA_CHECK_MLOG_NUMBER(*type))) {
|
||||
recv_sys->found_corrupt_log = true;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ptr++;
|
||||
|
||||
|
|
|
@ -2250,7 +2250,10 @@ page_cur_parse_delete_rec(
|
|||
offset = mach_read_from_2(ptr);
|
||||
ptr += 2;
|
||||
|
||||
ut_a(offset <= UNIV_PAGE_SIZE);
|
||||
if (UNIV_UNLIKELY(offset >= srv_page_size)) {
|
||||
recv_sys->found_corrupt_log = true;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (block) {
|
||||
page_t* page = buf_block_get_frame(block);
|
||||
|
|
Loading…
Reference in a new issue