Commit 52c4abbf authored by Eugene Kosov's avatar Eugene Kosov

MDEV-20213 binlog_encryption.binlog_incident failed in buildbot, server crashed in Check::validate

follow up

fil_system.sys_space is a shared variable between the thread
which assigns a value to it, and the thread which does Check::validate()

SysTablespace::open_or_create(): protect a shared variable with
a mutex to avoid any data race surprises.
parent 3c238ac5
......@@ -913,9 +913,13 @@ SysTablespace::open_or_create(
} else {
ut_ad(!fil_system.sys_space);
ut_ad(space_id() == TRX_SYS_SPACE);
space = fil_system.sys_space = fil_space_create(
space = fil_space_create(
name(), TRX_SYS_SPACE, flags(),
FIL_TYPE_TABLESPACE, NULL);
mutex_enter(&fil_system.mutex);
fil_system.sys_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