fix style check

This commit is contained in:
Sema Checherinda 2022-09-23 01:46:18 +02:00
parent db86cd0f0a
commit 597421014e
4 changed files with 3 additions and 7 deletions

View File

@ -7310,13 +7310,14 @@ MergeTreeData::MutableDataPartPtr MergeTreeData::createEmptyPart(
SyncGuardPtr sync_guard;
if (new_data_part->isStoredOnDisk())
{
/// The name could be non-unique in case of stale files from previous runs.
String full_path = new_data_part->getFullRelativePath();
if (new_data_part->volume->getDisk()->exists(full_path))
{
LOG_WARNING(log, "Removing old temporary directory {}", fullPath(new_data_part->volume->getDisk(), full_path));
/// The path has to be unique, all tmp directories are deleted at startup in case of stale files from previous runs.
/// New part have to capture its name, therefore there is no concurrentcy in directory creation
throw Exception(ErrorCodes::LOGICAL_ERROR,
"New empty part is about to matirialize but the dirrectory already exist"
", new part {}"

View File

@ -28,4 +28,3 @@ def wait_for_delete_empty_parts(node, table, database=None, timeout=60):
f"WHERE active AND rows = 0 AND table = '{table}' AND database = '{database}'"
)
assert_eq_with_retry(node, empty_parts_query, "0\n")

View File

@ -1255,7 +1255,6 @@ def test_concurrent_alter_move_and_drop(start_cluster, name, engine):
else:
raise e
insert(100)
p = Pool(15)
tasks = []

View File

@ -457,10 +457,7 @@ def test_system_detached_parts(drop_detached_parts_table):
def test_detached_part_dir_exists(started_cluster):
q(
"create table detached_part_dir_exists (n int) "
"engine=MergeTree order by n"
)
q("create table detached_part_dir_exists (n int) engine=MergeTree order by n")
q("insert into detached_part_dir_exists select 1") # will create all_1_1_0
q(
"alter table detached_part_dir_exists detach partition id 'all'"