Commit 3d1ad2a5 authored by Jan Lindström's avatar Jan Lindström

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.
parent 3e12e39f
...@@ -2019,6 +2019,12 @@ fil_crypt_rotate_pages( ...@@ -2019,6 +2019,12 @@ fil_crypt_rotate_pages(
continue; continue;
} }
/* If space is marked as stopping, stop rotating
pages. */
if (state->space->is_stopping()) {
break;
}
fil_crypt_rotate_page(key_state, state); fil_crypt_rotate_page(key_state, state);
} }
} }
...@@ -2067,20 +2073,22 @@ fil_crypt_flush_space( ...@@ -2067,20 +2073,22 @@ fil_crypt_flush_space(
crypt_data->type = CRYPT_SCHEME_UNENCRYPTED; crypt_data->type = CRYPT_SCHEME_UNENCRYPTED;
} }
/* update page 0 */ if (!space->is_stopping()) {
mtr_t mtr; /* update page 0 */
mtr_start(&mtr); mtr_t mtr;
mtr_start(&mtr);
const uint zip_size = fsp_flags_get_zip_size(state->space->flags); const uint zip_size = fsp_flags_get_zip_size(state->space->flags);
buf_block_t* block = buf_page_get_gen(space->id, zip_size, 0, buf_block_t* block = buf_page_get_gen(space->id, zip_size, 0,
RW_X_LATCH, NULL, BUF_GET, RW_X_LATCH, NULL, BUF_GET,
__FILE__, __LINE__, &mtr); __FILE__, __LINE__, &mtr);
byte* frame = buf_block_get_frame(block); byte* frame = buf_block_get_frame(block);
crypt_data->write_page0(frame, &mtr); crypt_data->write_page0(frame, &mtr);
mtr_commit(&mtr); mtr_commit(&mtr);
}
} }
/*********************************************************************** /***********************************************************************
......
...@@ -2019,6 +2019,12 @@ fil_crypt_rotate_pages( ...@@ -2019,6 +2019,12 @@ fil_crypt_rotate_pages(
continue; continue;
} }
/* If space is marked as stopping, stop rotating
pages. */
if (state->space->is_stopping()) {
break;
}
fil_crypt_rotate_page(key_state, state); fil_crypt_rotate_page(key_state, state);
} }
} }
...@@ -2067,20 +2073,22 @@ fil_crypt_flush_space( ...@@ -2067,20 +2073,22 @@ fil_crypt_flush_space(
crypt_data->type = CRYPT_SCHEME_UNENCRYPTED; crypt_data->type = CRYPT_SCHEME_UNENCRYPTED;
} }
/* update page 0 */ if (!space->is_stopping()) {
mtr_t mtr; /* update page 0 */
mtr_start(&mtr); mtr_t mtr;
mtr_start(&mtr);
const uint zip_size = fsp_flags_get_zip_size(state->space->flags); const uint zip_size = fsp_flags_get_zip_size(state->space->flags);
buf_block_t* block = buf_page_get_gen(space->id, zip_size, 0, buf_block_t* block = buf_page_get_gen(space->id, zip_size, 0,
RW_X_LATCH, NULL, BUF_GET, RW_X_LATCH, NULL, BUF_GET,
__FILE__, __LINE__, &mtr); __FILE__, __LINE__, &mtr);
byte* frame = buf_block_get_frame(block); byte* frame = buf_block_get_frame(block);
crypt_data->write_page0(frame, &mtr); crypt_data->write_page0(frame, &mtr);
mtr_commit(&mtr); mtr_commit(&mtr);
}
} }
/*********************************************************************** /***********************************************************************
......
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