MDEV-6590: InnoDB recover ends in signal 11
Analysis: When database is migrated from 5.5 or earlier and database needs crash recovery, there is possibility that SYS_DATAFILES system table does not exists, but crash recovery in function dict_check_tablespaces_and_store_max_id() assumes that SYS_DATAFILES exists. Fix: If SYS_DATAFILES does not exists, create it before we end up to function dict_check_tablespaces_and_store_max_id() on crash recovery.
This commit is contained in:
parent
57a43b8435
commit
18b307a7d2
@ -1522,6 +1522,7 @@ innobase_start_or_create_for_mysql(void)
|
||||
char logfilename[10000];
|
||||
char* logfile0 = NULL;
|
||||
size_t dirnamelen;
|
||||
bool sys_datafiles_created = false;
|
||||
|
||||
if (srv_force_recovery > SRV_FORCE_NO_TRX_UNDO) {
|
||||
srv_read_only_mode = true;
|
||||
@ -2448,6 +2449,15 @@ files_checked:
|
||||
dict_check = DICT_CHECK_NONE_LOADED;
|
||||
}
|
||||
|
||||
/* Create the SYS_TABLESPACES and SYS_DATAFILES system table */
|
||||
err = dict_create_or_check_sys_tablespace();
|
||||
if (err != DB_SUCCESS) {
|
||||
return(err);
|
||||
}
|
||||
|
||||
sys_datafiles_created = true;
|
||||
|
||||
/* This function assumes that SYS_DATAFILES exists */
|
||||
dict_check_tablespaces_and_store_max_id(dict_check);
|
||||
}
|
||||
|
||||
@ -2652,10 +2662,13 @@ files_checked:
|
||||
return(err);
|
||||
}
|
||||
|
||||
/* Create the SYS_TABLESPACES system table */
|
||||
err = dict_create_or_check_sys_tablespace();
|
||||
if (err != DB_SUCCESS) {
|
||||
return(err);
|
||||
/* Create the SYS_TABLESPACES and SYS_DATAFILES system tables if we
|
||||
have not done that already on crash recovery. */
|
||||
if (sys_datafiles_created == false) {
|
||||
err = dict_create_or_check_sys_tablespace();
|
||||
if (err != DB_SUCCESS) {
|
||||
return(err);
|
||||
}
|
||||
}
|
||||
|
||||
srv_is_being_started = FALSE;
|
||||
|
@ -1566,6 +1566,7 @@ innobase_start_or_create_for_mysql(void)
|
||||
char logfilename[10000];
|
||||
char* logfile0 = NULL;
|
||||
size_t dirnamelen;
|
||||
bool sys_datafiles_created = false;
|
||||
|
||||
if (srv_force_recovery > SRV_FORCE_NO_TRX_UNDO) {
|
||||
srv_read_only_mode = true;
|
||||
@ -2515,6 +2516,15 @@ files_checked:
|
||||
dict_check = DICT_CHECK_NONE_LOADED;
|
||||
}
|
||||
|
||||
/* Create the SYS_TABLESPACES and SYS_DATAFILES system table */
|
||||
err = dict_create_or_check_sys_tablespace();
|
||||
if (err != DB_SUCCESS) {
|
||||
return(err);
|
||||
}
|
||||
|
||||
sys_datafiles_created = true;
|
||||
|
||||
/* This function assumes that SYS_DATAFILES exists */
|
||||
dict_check_tablespaces_and_store_max_id(dict_check);
|
||||
}
|
||||
|
||||
@ -2727,10 +2737,13 @@ files_checked:
|
||||
return(err);
|
||||
}
|
||||
|
||||
/* Create the SYS_TABLESPACES system table */
|
||||
err = dict_create_or_check_sys_tablespace();
|
||||
if (err != DB_SUCCESS) {
|
||||
return(err);
|
||||
/* Create the SYS_TABLESPACES and SYS_DATAFILES system tables if we
|
||||
have not done that already on crash recovery. */
|
||||
if (sys_datafiles_created == false) {
|
||||
err = dict_create_or_check_sys_tablespace();
|
||||
if (err != DB_SUCCESS) {
|
||||
return(err);
|
||||
}
|
||||
}
|
||||
|
||||
srv_is_being_started = FALSE;
|
||||
|
Loading…
x
Reference in New Issue
Block a user