diff --git a/src/Storages/ObjectStorage/StorageObjectStorageSink.cpp b/src/Storages/ObjectStorage/StorageObjectStorageSink.cpp index 7d9b69dfc09..bd7cee407e6 100644 --- a/src/Storages/ObjectStorage/StorageObjectStorageSink.cpp +++ b/src/Storages/ObjectStorage/StorageObjectStorageSink.cpp @@ -74,6 +74,7 @@ void StorageObjectStorageSink::finalizeBuffers() catch (...) { /// Stop ParallelFormattingOutputFormat correctly. + cancelBuffers(); releaseBuffers(); throw; } diff --git a/src/Storages/StorageMemory.cpp b/src/Storages/StorageMemory.cpp index 71447889d86..d798e1b4fb5 100644 --- a/src/Storages/StorageMemory.cpp +++ b/src/Storages/StorageMemory.cpp @@ -561,7 +561,7 @@ void StorageMemory::restoreDataImpl(const BackupPtr & backup, const String & dat temp_data_file.emplace(temporary_disk); auto out = std::make_unique(temp_data_file->getAbsolutePath()); copyData(*in, *out); - out.reset(); + out->finalize(); in = createReadBufferFromFileBase(temp_data_file->getAbsolutePath(), {}); } std::unique_ptr in_from_file{static_cast(in.release())};