Skip to content

Commit 3d1ad2a

Browse files
author
Jan Lindström
committed
MDEV-13516: encryption.create_or_replace test fails in buildbot with InnoDB assertion failure
fil_crypt_rotate_pages If tablespace is marked as stopping stop also page rotation fil_crypt_flush_space If tablespace is marked as stopping do not try to read page 0 and write it back.
1 parent 3e12e39 commit 3d1ad2a

File tree

2 files changed

+32
-16
lines changed

2 files changed

+32
-16
lines changed

storage/innobase/fil/fil0crypt.cc

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2019,6 +2019,12 @@ fil_crypt_rotate_pages(
20192019
continue;
20202020
}
20212021

2022+
/* If space is marked as stopping, stop rotating
2023+
pages. */
2024+
if (state->space->is_stopping()) {
2025+
break;
2026+
}
2027+
20222028
fil_crypt_rotate_page(key_state, state);
20232029
}
20242030
}
@@ -2067,20 +2073,22 @@ fil_crypt_flush_space(
20672073
crypt_data->type = CRYPT_SCHEME_UNENCRYPTED;
20682074
}
20692075

2070-
/* update page 0 */
2071-
mtr_t mtr;
2072-
mtr_start(&mtr);
2076+
if (!space->is_stopping()) {
2077+
/* update page 0 */
2078+
mtr_t mtr;
2079+
mtr_start(&mtr);
20732080

2074-
const uint zip_size = fsp_flags_get_zip_size(state->space->flags);
2081+
const uint zip_size = fsp_flags_get_zip_size(state->space->flags);
20752082

2076-
buf_block_t* block = buf_page_get_gen(space->id, zip_size, 0,
2083+
buf_block_t* block = buf_page_get_gen(space->id, zip_size, 0,
20772084
RW_X_LATCH, NULL, BUF_GET,
20782085
__FILE__, __LINE__, &mtr);
2079-
byte* frame = buf_block_get_frame(block);
2086+
byte* frame = buf_block_get_frame(block);
20802087

2081-
crypt_data->write_page0(frame, &mtr);
2088+
crypt_data->write_page0(frame, &mtr);
20822089

2083-
mtr_commit(&mtr);
2090+
mtr_commit(&mtr);
2091+
}
20842092
}
20852093

20862094
/***********************************************************************

storage/xtradb/fil/fil0crypt.cc

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2019,6 +2019,12 @@ fil_crypt_rotate_pages(
20192019
continue;
20202020
}
20212021

2022+
/* If space is marked as stopping, stop rotating
2023+
pages. */
2024+
if (state->space->is_stopping()) {
2025+
break;
2026+
}
2027+
20222028
fil_crypt_rotate_page(key_state, state);
20232029
}
20242030
}
@@ -2067,20 +2073,22 @@ fil_crypt_flush_space(
20672073
crypt_data->type = CRYPT_SCHEME_UNENCRYPTED;
20682074
}
20692075

2070-
/* update page 0 */
2071-
mtr_t mtr;
2072-
mtr_start(&mtr);
2076+
if (!space->is_stopping()) {
2077+
/* update page 0 */
2078+
mtr_t mtr;
2079+
mtr_start(&mtr);
20732080

2074-
const uint zip_size = fsp_flags_get_zip_size(state->space->flags);
2081+
const uint zip_size = fsp_flags_get_zip_size(state->space->flags);
20752082

2076-
buf_block_t* block = buf_page_get_gen(space->id, zip_size, 0,
2083+
buf_block_t* block = buf_page_get_gen(space->id, zip_size, 0,
20772084
RW_X_LATCH, NULL, BUF_GET,
20782085
__FILE__, __LINE__, &mtr);
2079-
byte* frame = buf_block_get_frame(block);
2086+
byte* frame = buf_block_get_frame(block);
20802087

2081-
crypt_data->write_page0(frame, &mtr);
2088+
crypt_data->write_page0(frame, &mtr);
20822089

2083-
mtr_commit(&mtr);
2090+
mtr_commit(&mtr);
2091+
}
20842092
}
20852093

20862094
/***********************************************************************

0 commit comments

Comments
 (0)