mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 20:07:13 +02:00
MDEV-12750 Fix crash recovery of key rotation
When MySQL 5.7.9 was merged to MariaDB 10.2.2, an important debug assertion was omitted from mlog_write_initial_log_record_low(). mlog_write_initial_log_record_low(): Put back the assertion mtr_t::is_named_space(). fil_crypt_start_encrypting_space(), fil_crypt_rotate_page(): Call mtr_t::set_named_space() before modifying any pages. fsp_flags_try_adjust(): Call mtr_t::set_named_space(). This additional breakage was introduced in the merge of MDEV-11623 from 10.1. It was not caught because of the missing debug assertion in mlog_write_initial_log_record_low(). Remove some suppressions from the encryption.innodb-redo-badkey test.
This commit is contained in:
parent
6322913339
commit
588a6a186a
5 changed files with 35 additions and 42 deletions
|
|
@ -1004,7 +1004,8 @@ fil_crypt_start_encrypting_space(
|
|||
do
|
||||
{
|
||||
mtr_t mtr;
|
||||
mtr_start(&mtr);
|
||||
mtr.start();
|
||||
mtr.set_named_space(space);
|
||||
|
||||
/* 2 - get page 0 */
|
||||
dberr_t err = DB_SUCCESS;
|
||||
|
|
@ -1020,7 +1021,7 @@ fil_crypt_start_encrypting_space(
|
|||
crypt_data->type = CRYPT_SCHEME_1;
|
||||
crypt_data->write_page0(space, frame, &mtr);
|
||||
|
||||
mtr_commit(&mtr);
|
||||
mtr.commit();
|
||||
|
||||
/* record lsn of update */
|
||||
lsn_t end_lsn = mtr.commit_lsn();
|
||||
|
|
@ -1758,12 +1759,11 @@ fil_crypt_rotate_page(
|
|||
}
|
||||
|
||||
mtr_t mtr;
|
||||
mtr_start(&mtr);
|
||||
buf_block_t* block = fil_crypt_get_page_throttle(state,
|
||||
offset, &mtr,
|
||||
&sleeptime_ms);
|
||||
|
||||
if (block) {
|
||||
mtr.start();
|
||||
if (buf_block_t* block = fil_crypt_get_page_throttle(state,
|
||||
offset, &mtr,
|
||||
&sleeptime_ms)) {
|
||||
mtr.set_named_space(space);
|
||||
|
||||
bool modified = false;
|
||||
int needs_scrubbing = BTR_SCRUB_SKIP_PAGE;
|
||||
|
|
@ -1804,11 +1804,11 @@ fil_crypt_rotate_page(
|
|||
BTR_SCRUB_PAGE_ALLOCATION_UNKNOWN);
|
||||
}
|
||||
|
||||
mtr_commit(&mtr);
|
||||
mtr.commit();
|
||||
lsn_t end_lsn = mtr.commit_lsn();
|
||||
|
||||
if (needs_scrubbing == BTR_SCRUB_PAGE) {
|
||||
mtr_start(&mtr);
|
||||
mtr.start();
|
||||
/*
|
||||
* refetch page and allocation status
|
||||
*/
|
||||
|
|
@ -1820,6 +1820,7 @@ fil_crypt_rotate_page(
|
|||
&sleeptime_ms);
|
||||
|
||||
if (block) {
|
||||
mtr.set_named_space(space);
|
||||
|
||||
/* get required table/index and index-locks */
|
||||
needs_scrubbing = btr_scrub_recheck_page(
|
||||
|
|
@ -1981,6 +1982,7 @@ fil_crypt_flush_space(
|
|||
page_id_t(space->id, 0), page_size_t(space->flags),
|
||||
RW_X_LATCH, NULL, BUF_GET,
|
||||
__FILE__, __LINE__, &mtr, &err)) {
|
||||
mtr.set_named_space(space);
|
||||
crypt_data->write_page0(space, block->frame, &mtr);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue