Remove temporary directories on replicated table start

This commit is contained in:
alesapin 2022-06-07 16:32:29 +02:00
parent ef6f5a6500
commit e7b76f5dee

View File

@ -4212,6 +4212,10 @@ void StorageReplicatedMergeTree::startup()
try
{
/// Temporary directories contain incomplete results of merges (after forced restart)
/// and don't allow to reinitialize them, so delete each of them immediately
clearOldTemporaryDirectories(0);
InterserverIOEndpointPtr data_parts_exchange_ptr = std::make_shared<DataPartsExchange::Service>(*this);
[[maybe_unused]] auto prev_ptr = std::atomic_exchange(&data_parts_exchange_endpoint, data_parts_exchange_ptr);
assert(prev_ptr == nullptr);