MDEV-13591: InnoDB: Database page corruption on disk or a failed file read and assertion failure

Problem is that page 0 and its possible enrryption information
is not read for undo tablespaces.

fil_crypt_get_latest_key_version(): Do not send event to
encryption threads if event does not yet exists. Seen
on regression testing.

fil_read_first_page: Add new parameter does page belong to
undo tablespace and if it does, we do not read FSP_HEADER.

srv_undo_tablespace_open : Read first page of the tablespace
to get crypt_data if it exists and pass it to fil_space_create.

Tested using innodb_encryption with combinations with
innodb-undo-tablespaces.
This commit is contained in:
Jan Lindström 2017-08-28 09:45:54 +03:00
commit 61096ff214
10 changed files with 130 additions and 60 deletions

View file

@ -804,8 +804,10 @@ the first page of a first data file at database startup.
@param[out] space_id tablepspace ID
@param[out] flushed_lsn flushed lsn value
@param[out] crypt_data encryption crypt data
@retval NULL on success, or if innodb_force_recovery is set
@return pointer to an error message string */
@param[in] check_first_page true if first page contents
should be checked
@return NULL on success, or if innodb_force_recovery is set
@retval pointer to an error message string */
UNIV_INTERN
const char*
fil_read_first_page(
@ -814,7 +816,8 @@ fil_read_first_page(
ulint* flags,
ulint* space_id,
lsn_t* flushed_lsn,
fil_space_crypt_t** crypt_data)
fil_space_crypt_t** crypt_data,
bool check_first_page=true)
MY_ATTRIBUTE((warn_unused_result));
#endif /* !UNIV_HOTBACKUP */