未验证 提交 10e5d63d 编写于 作者: A alexey-milovidov 提交者: GitHub

Merge pull request #2131 from ClickHouse-Ninja/system-log-prepare-table-on-each-flush

SystemLog: проверка структуры и существования таблицы при каждом flush 
...@@ -233,7 +233,9 @@ void SystemLog<LogElement>::flush() ...@@ -233,7 +233,9 @@ void SystemLog<LogElement>::flush()
{ {
LOG_TRACE(log, "Flushing system log"); 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(); prepareTable();
Block block = LogElement::createBlock(); Block block = LogElement::createBlock();
...@@ -311,7 +313,7 @@ void SystemLog<LogElement>::prepareTable() ...@@ -311,7 +313,7 @@ void SystemLog<LogElement>::prepareTable()
/// The required table will be created. /// The required table will be created.
table = nullptr; table = nullptr;
} }
else else if (!is_prepared)
LOG_DEBUG(log, "Will use existing table " << description << " for " + LogElement::name()); LOG_DEBUG(log, "Will use existing table " << description << " for " + LogElement::name());
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册