mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
Correctly stop copy tasks when exception thrown
This commit is contained in:
parent
090ef99339
commit
16eb12a321
@ -151,17 +151,19 @@ void IDisk::copyThroughBuffers(
|
|||||||
{
|
{
|
||||||
ResultsCollector results;
|
ResultsCollector results;
|
||||||
|
|
||||||
|
SCOPE_EXIT_SAFE(
|
||||||
|
for (auto & result : results)
|
||||||
|
result.wait();
|
||||||
|
for (auto & result : results)
|
||||||
|
result.get(); /// May rethrow an exception
|
||||||
|
);
|
||||||
|
|
||||||
/// Disable parallel write. We already copy in parallel.
|
/// Disable parallel write. We already copy in parallel.
|
||||||
/// Avoid high memory usage. See test_s3_zero_copy_ttl/test.py::test_move_and_s3_memory_usage
|
/// Avoid high memory usage. See test_s3_zero_copy_ttl/test.py::test_move_and_s3_memory_usage
|
||||||
write_settings.s3_allow_parallel_part_upload = false;
|
write_settings.s3_allow_parallel_part_upload = false;
|
||||||
write_settings.azure_allow_parallel_part_upload = false;
|
write_settings.azure_allow_parallel_part_upload = false;
|
||||||
|
|
||||||
asyncCopy(*this, from_path, *to_disk, to_path, copying_thread_pool, results, copy_root_dir, read_settings, write_settings, cancellation_hook);
|
asyncCopy(*this, from_path, *to_disk, to_path, copying_thread_pool, results, copy_root_dir, read_settings, write_settings, cancellation_hook);
|
||||||
|
|
||||||
for (auto & result : results)
|
|
||||||
result.wait();
|
|
||||||
for (auto & result : results)
|
|
||||||
result.get(); /// May rethrow an exception
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user