diff options
author | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2020-07-30 22:51:52 +0530 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-07-31 08:33:05 +0300 |
commit | 1c3297e17e1068b7370129fcd0f6dbb73aa01619 (patch) | |
tree | de5f5175a031acf6b0b6afd289ce9c70d01ce421 | |
parent | 3ced3a10eb1be24aa84b774d824dc8d5b2d2d5e6 (diff) | |
download | mariadb-git-10.2-MDEV-11799.tar.gz |
MDEV-11799 InnoDB can abort if the doublewrite buffer contains a bad and good copy10.2-MDEV-11799
- Addressed marko's review comments.
-rw-r--r-- | storage/innobase/buf/buf0dblwr.cc | 6 | ||||
-rw-r--r-- | storage/innobase/log/log0recv.cc | 15 |
2 files changed, 12 insertions, 9 deletions
diff --git a/storage/innobase/buf/buf0dblwr.cc b/storage/innobase/buf/buf0dblwr.cc index 5b9c4563161..17185eab650 100644 --- a/storage/innobase/buf/buf0dblwr.cc +++ b/storage/innobase/buf/buf0dblwr.cc @@ -549,7 +549,7 @@ buf_dblwr_process() for (recv_dblwr_t::list::iterator i = recv_dblwr.pages.begin(); i != recv_dblwr.pages.end(); ++i, ++page_no_dblwr) { - byte* page = *i; + byte* page = *i; const ulint page_no = page_get_page_no(page); if (!page_no) { @@ -570,7 +570,7 @@ buf_dblwr_process() const page_id_t page_id(space_id, page_no); if (recv_sys->scanned_lsn < lsn) { - ib::warn() << "Ignoring doublewrite copy of " + ib::warn() << "Ignoring a doublewrite copy of page " << page_id << " with future log sequence number " << lsn; @@ -579,7 +579,7 @@ buf_dblwr_process() fil_space_t* space = fil_space_acquire_for_io(space_id); - if (space == NULL) { + if (!space) { /* Maybe we have dropped the tablespace and this page once belonged to it: do nothing */ continue; diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc index 281ac10c5e9..b170055daa4 100644 --- a/storage/innobase/log/log0recv.cc +++ b/storage/innobase/log/log0recv.cc @@ -4098,8 +4098,7 @@ bool recv_dblwr_t::validate_page(const page_id_t page_id, if (!fsp_flags_is_valid(flags, page_id.space()) && fsp_flags_convert_from_101(flags) == ULINT_UNDEFINED) { - ib::warn() << "Ignoring a doublewrite copy of page " - << page_id + ib::warn() << "Ignoring a doublewrite copy of page " << page_id << "due to invalid flags " << ib::hex(flags); return false; } @@ -4109,7 +4108,6 @@ bool recv_dblwr_t::validate_page(const page_id_t page_id, } ut_ad(tmp_buf); - ut_ad(space); byte *tmp_frame= tmp_buf; byte *tmp_page= tmp_buf + srv_page_size; const uint16_t page_type= mach_read_from_2(page + FIL_PAGE_TYPE); @@ -4136,9 +4134,14 @@ bool recv_dblwr_t::validate_page(const page_id_t page_id, memcpy(tmp_page, page, page_size.physical()); /* fall through */ case FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED: - return !page_size.is_compressed() && - fil_page_decompress(tmp_frame, tmp_page) == srv_page_size && - !buf_page_is_corrupted(true, tmp_page, page_size, space); + if (page_size.is_compressed()) + return false; /* ROW_FORMAT=COMPRESSED cannot be page_compressed */ + ulint decomp= fil_page_decompress(tmp_frame, tmp_page); + if (!decomp) + return false; /* decompression failed */ + if (decomp == srv_page_size) + return false; /* the page was not compressed (invalid page type) */ + return !buf_page_is_corrupted(true, tmp_page, page_size, space); } return !buf_page_is_corrupted(true, page, page_size, space); |