mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-17 20:02:05 +00:00
caffc144b5
In #33291 final part commit had been defered, and now it can take significantly more time, that may lead to "Part directory doesn't exist" error during INSERT: 2022.02.21 18:18:06.979881 [ 11329 ] {insert} <Debug> executeQuery: (from 127.1:24572, user: default) INSERT INTO db.table (...) VALUES 2022.02.21 20:58:03.933593 [ 11329 ] {insert} <Trace> db.table: Renaming temporary part tmp_insert_20220214_18044_18044_0 to 20220214_270654_270654_0. 2022.02.21 21:16:50.961917 [ 11329 ] {insert} <Trace> db.table: Renaming temporary part tmp_insert_20220214_18197_18197_0 to 20220214_270689_270689_0. ... 2022.02.22 21:16:57.632221 [ 64878 ] {} <Warning> db.table: Removing temporary directory /clickhouse/data/db/table/tmp_insert_20220214_18232_18232_0/ ... 2022.02.23 12:23:56.277480 [ 11329 ] {insert} <Trace> db.table: Renaming temporary part tmp_insert_20220214_18232_18232_0 to 20220214_273459_273459_0. 2022.02.23 12:23:56.299218 [ 11329 ] {insert} <Error> executeQuery: Code: 107. DB::Exception: Part directory /clickhouse/data/db/table/tmp_insert_20220214_18232_18232_0/ doesn't exist. Most likely it is a logical error. (FILE_DOESNT_EXIST) (version 22.2.1.1) (from 127.1:24572) (in query: INSERT INTO db.table (...) VALUES), Stack trace (when copying this message, always include the lines below): Follow-up for: #28760 Refs: #33291 Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
25 lines
455 B
C++
25 lines
455 B
C++
#include <Storages/MergeTree/TemporaryParts.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
bool TemporaryParts::contains(const std::string & basename) const
|
|
{
|
|
std::lock_guard lock(mutex);
|
|
return parts.contains(basename);
|
|
}
|
|
|
|
void TemporaryParts::add(std::string basename)
|
|
{
|
|
std::lock_guard lock(mutex);
|
|
parts.emplace(std::move(basename));
|
|
}
|
|
|
|
void TemporaryParts::remove(const std::string & basename)
|
|
{
|
|
std::lock_guard lock(mutex);
|
|
parts.erase(basename);
|
|
}
|
|
|
|
}
|