Skip to content

Commit

Permalink
MDEV-13516: encryption.create_or_replace test fails in buildbot with …
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
Jan Lindström committed Apr 16, 2018
1 parent 3e12e39 commit 3d1ad2a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 16 deletions.
24 changes: 16 additions & 8 deletions storage/innobase/fil/fil0crypt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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);
}
}

/***********************************************************************
Expand Down
24 changes: 16 additions & 8 deletions storage/xtradb/fil/fil0crypt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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);
}
}

/***********************************************************************
Expand Down

0 comments on commit 3d1ad2a

Please sign in to comment.