mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 00:52:02 +00:00
Merge pull request #41190 from kssenii/fix-clean-up-thread
Fix cleaning up broken detached part after timeout
This commit is contained in:
commit
df22e8d30c
@ -1990,10 +1990,11 @@ size_t MergeTreeData::clearOldBrokenPartsFromDetachedDirectory()
|
||||
|
||||
renamed_parts.tryRenameAll();
|
||||
|
||||
for (const auto & [old_name, new_name, disk] : renamed_parts.old_and_new_names)
|
||||
for (auto & [old_name, new_name, disk] : renamed_parts.old_and_new_names)
|
||||
{
|
||||
removeDetachedPart(disk, fs::path(relative_data_path) / "detached" / new_name / "", old_name, false);
|
||||
LOG_DEBUG(log, "Removed broken detached part {} due to a timeout for broken detached parts", old_name);
|
||||
old_name.clear();
|
||||
}
|
||||
|
||||
return renamed_parts.old_and_new_names.size();
|
||||
|
@ -96,6 +96,9 @@ def remove_broken_detached_part_impl(table, node, expect_broken_prefix):
|
||||
assert "unexpected_all_42_1337_5" in result
|
||||
|
||||
time.sleep(15)
|
||||
assert node.contains_in_log(
|
||||
"Removed broken detached part unexpected_all_42_1337_5 due to a timeout"
|
||||
)
|
||||
|
||||
result = node.exec_in_container(["ls", path_to_detached])
|
||||
print(result)
|
||||
|
Loading…
Reference in New Issue
Block a user