Commit e4cff9a8 authored by Eugene Kosov's avatar Eugene Kosov

MDEV-19298 Assertion `space->id != 0xFFFFFFFEU || space ==...

MDEV-19298 Assertion `space->id != 0xFFFFFFFEU || space == fil_system.temp_space' failed in Check::validate upon crash upgrade from 10.2.22

This issue is pretty much the same as MDEV-20213.
The fix is similar to:
3c238ac5
52c4abbf

Check::validate(): fix a debug assertion

SysTablespace::open_or_create(): protect assigning to a shared
variable with a mutex
parent 52c4abbf
......@@ -4641,11 +4641,20 @@ struct Check {
Check check;
ut_list_validate(space->chain, check);
ut_a(space->size == check.size);
ut_ad(space->id != TRX_SYS_SPACE
|| space == fil_system.sys_space
|| fil_system.sys_space == NULL);
ut_ad(space->id != SRV_TMP_SPACE_ID
|| space == fil_system.temp_space);
switch (space->id) {
case TRX_SYS_SPACE:
ut_ad(fil_system.sys_space == NULL
|| fil_system.sys_space == space);
break;
case SRV_TMP_SPACE_ID:
ut_ad(fil_system.temp_space == NULL
|| fil_system.temp_space == space);
break;
default:
break;
}
return(check.n_open);
}
};
......
......@@ -904,9 +904,13 @@ SysTablespace::open_or_create(
} else if (is_temp) {
ut_ad(!fil_system.temp_space);
ut_ad(space_id() == SRV_TMP_SPACE_ID);
space = fil_system.temp_space = fil_space_create(
space = fil_space_create(
name(), SRV_TMP_SPACE_ID, flags(),
FIL_TYPE_TEMPORARY, NULL);
mutex_enter(&fil_system.mutex);
fil_system.temp_space = space;
mutex_exit(&fil_system.mutex);
if (!space) {
return DB_ERROR;
}
......
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