Commit 63b3f789 authored by Marko Mäkelä's avatar Marko Mäkelä Committed by Sergei Golubchik

MDEV-22970: Disable MDEV-8139 due to corruption concerns

Contrary to our exceptations, it seems that a mini-transaction can
allocate a page that it had freed earlier. The function mtr_t::init()
is not prepared to deal with this, and it could happen that a
newly initialized page will be scrubbed instead. This can affect
the operation on page_compressed tables, or any InnoDB data files when
innodb_background_scrub_data_uncompressed=ON.

Also, buf_read_recv_pages() can interfere with the MDEV-8139 logic
during crash recovery.

Let us temporarily disable MDEV-8139 due to such concerns.

Note: Scrubbing will partially work thanks to MDEV-15528. Only in
cases where the page does not exist in the buffer pool at the time
of the page flush, we would skip the scrubbing action.
parent cdbbc693
...@@ -12,3 +12,4 @@ ...@@ -12,3 +12,4 @@
create-index-debug : MDEV-13680 InnoDB may crash when btr_page_alloc() fails create-index-debug : MDEV-13680 InnoDB may crash when btr_page_alloc() fails
innodb_force_recovery_rollback : MDEV-22889 InnoDB occasionally breaks ACID innodb_force_recovery_rollback : MDEV-22889 InnoDB occasionally breaks ACID
innodb_scrub : MDEV-8139/MDEV-22970 Fix scrubbing
...@@ -2632,8 +2632,14 @@ void buf_page_free(const page_id_t page_id, ...@@ -2632,8 +2632,14 @@ void buf_page_free(const page_id_t page_id,
buf_block_t *block= reinterpret_cast<buf_block_t*> buf_block_t *block= reinterpret_cast<buf_block_t*>
(buf_pool.page_hash_get_low(page_id, fold)); (buf_pool.page_hash_get_low(page_id, fold));
#if 0 /* FIXME: MDEV-22970 Potential corruption */
/* TODO: Find out how and when a freed page can be marked
allocated in the same mini-transaction. At least it seems to
happen during a pessimistic insert operation. */
/* TODO: try to all this part of mtr_t::free() */
if (srv_immediate_scrub_data_uncompressed || mtr->is_page_compressed()) if (srv_immediate_scrub_data_uncompressed || mtr->is_page_compressed())
mtr->add_freed_offset(page_id); mtr->add_freed_offset(page_id);
#endif
if (!block || block->page.state() != BUF_BLOCK_FILE_PAGE) if (!block || block->page.state() != BUF_BLOCK_FILE_PAGE)
{ {
......
...@@ -1777,6 +1777,7 @@ inline void recv_sys_t::add(const page_id_t page_id, ...@@ -1777,6 +1777,7 @@ inline void recv_sys_t::add(const page_id_t page_id,
log_phys_t(start_lsn, lsn, l, len)); log_phys_t(start_lsn, lsn, l, len));
} }
#if 0 /* FIXME: MDEV-22970 Potential corruption */
/** Store/remove the freed pages in fil_name_t of recv_spaces. /** Store/remove the freed pages in fil_name_t of recv_spaces.
@param[in] page_id freed or init page_id @param[in] page_id freed or init page_id
@param[in] freed TRUE if page is freed */ @param[in] freed TRUE if page is freed */
...@@ -1805,6 +1806,7 @@ static void store_freed_or_init_rec(page_id_t page_id, bool freed) ...@@ -1805,6 +1806,7 @@ static void store_freed_or_init_rec(page_id_t page_id, bool freed)
i->second.remove_freed_page(page_no); i->second.remove_freed_page(page_no);
} }
} }
#endif
/** Parse and register one mini-transaction in log_t::FORMAT_10_5. /** Parse and register one mini-transaction in log_t::FORMAT_10_5.
@param checkpoint_lsn the log sequence number of the latest checkpoint @param checkpoint_lsn the log sequence number of the latest checkpoint
...@@ -2004,7 +2006,9 @@ bool recv_sys_t::parse(lsn_t checkpoint_lsn, store_t *store, bool apply) ...@@ -2004,7 +2006,9 @@ bool recv_sys_t::parse(lsn_t checkpoint_lsn, store_t *store, bool apply)
case INIT_PAGE: case INIT_PAGE:
last_offset= FIL_PAGE_TYPE; last_offset= FIL_PAGE_TYPE;
free_or_init_page: free_or_init_page:
#if 0 /* FIXME: MDEV-22970 Potential corruption */
store_freed_or_init_rec(id, (b & 0x70) == FREE_PAGE); store_freed_or_init_rec(id, (b & 0x70) == FREE_PAGE);
#endif
if (UNIV_UNLIKELY(rlen != 0)) if (UNIV_UNLIKELY(rlen != 0))
goto record_corrupted; goto record_corrupted;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment