mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-22 01:30:51 +00:00
Merge pull request #2131 from ClickHouse-Ninja/system-log-prepare-table-on-each-flush
SystemLog: проверка структуры и существования таблицы при каждом flush
This commit is contained in:
commit
10e5d63d76
@ -233,7 +233,9 @@ void SystemLog<LogElement>::flush()
|
||||
{
|
||||
LOG_TRACE(log, "Flushing system log");
|
||||
|
||||
if (!is_prepared) /// BTW, flush method is called from single thread.
|
||||
/// We check for existence of the table and create it as needed at every flush.
|
||||
/// This is done to allow user to drop the table at any moment (new empty table will be created automatically).
|
||||
/// BTW, flush method is called from single thread.
|
||||
prepareTable();
|
||||
|
||||
Block block = LogElement::createBlock();
|
||||
@ -311,7 +313,7 @@ void SystemLog<LogElement>::prepareTable()
|
||||
/// The required table will be created.
|
||||
table = nullptr;
|
||||
}
|
||||
else
|
||||
else if (!is_prepared)
|
||||
LOG_DEBUG(log, "Will use existing table " << description << " for " + LogElement::name());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user