Fix data race between reading/writing is_force_prepare_tables

This commit is contained in:
Azat Khuzhin 2020-06-16 21:08:44 +03:00
parent 103eb17107
commit 8fbf93012d

View File

@ -369,7 +369,13 @@ void SystemLog<LogElement>::savingThreadFunction()
if (to_flush.empty())
{
if (is_force_prepare_tables)
bool force;
{
std::lock_guard lock(mutex);
force = is_force_prepare_tables;
}
if (force)
{
prepareTable();
LOG_TRACE(log, "Table created (force)");