summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2018-04-16 15:06:41 +0300
committerJan Lindström <jan.lindstrom@mariadb.com>2018-04-16 15:06:41 +0300
commit3d1ad2a5e85284b5ec4bb28f744b93b0b73e3934 (patch)
treeb2b9246e82142fdef9117954b1762632544bb4b1
parent3e12e39fb3dd0346578d50fe98215f1c6bce354c (diff)
downloadmariadb-git-bb-10.1-MDEV-13516.tar.gz
MDEV-13516: encryption.create_or_replace test fails in buildbot with InnoDB assertion failurebb-10.1-MDEV-13516
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.
-rw-r--r--storage/innobase/fil/fil0crypt.cc24
-rw-r--r--storage/xtradb/fil/fil0crypt.cc24
2 files changed, 32 insertions, 16 deletions
diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc
index cb499121c86..2d149f07433 100644
--- a/storage/innobase/fil/fil0crypt.cc
+++ b/storage/innobase/fil/fil0crypt.cc
@@ -2019,6 +2019,12 @@ fil_crypt_rotate_pages(
continue;
}
+ /* If space is marked as stopping, stop rotating
+ pages. */
+ if (state->space->is_stopping()) {
+ break;
+ }
+
fil_crypt_rotate_page(key_state, state);
}
}
@@ -2067,20 +2073,22 @@ fil_crypt_flush_space(
crypt_data->type = CRYPT_SCHEME_UNENCRYPTED;
}
- /* update page 0 */
- mtr_t mtr;
- mtr_start(&mtr);
+ if (!space->is_stopping()) {
+ /* update page 0 */
+ 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,
__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);
+ }
}
/***********************************************************************
diff --git a/storage/xtradb/fil/fil0crypt.cc b/storage/xtradb/fil/fil0crypt.cc
index cb499121c86..2d149f07433 100644
--- a/storage/xtradb/fil/fil0crypt.cc
+++ b/storage/xtradb/fil/fil0crypt.cc
@@ -2019,6 +2019,12 @@ fil_crypt_rotate_pages(
continue;
}
+ /* If space is marked as stopping, stop rotating
+ pages. */
+ if (state->space->is_stopping()) {
+ break;
+ }
+
fil_crypt_rotate_page(key_state, state);
}
}
@@ -2067,20 +2073,22 @@ fil_crypt_flush_space(
crypt_data->type = CRYPT_SCHEME_UNENCRYPTED;
}
- /* update page 0 */
- mtr_t mtr;
- mtr_start(&mtr);
+ if (!space->is_stopping()) {
+ /* update page 0 */
+ 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,
__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);
+ }
}
/***********************************************************************