Backport #73279 to 24.10: fix missing finalize call

This commit is contained in:
robot-clickhouse 2024-12-13 19:08:45 +00:00
parent e0b3d4c122
commit cd8dcdc5c5

View File

@ -1028,9 +1028,9 @@ void StorageKeeperMap::restoreDataImpl(
if (!dynamic_cast<ReadBufferFromFileBase *>(in.get())) if (!dynamic_cast<ReadBufferFromFileBase *>(in.get()))
{ {
temp_data_file.emplace(temporary_disk); temp_data_file.emplace(temporary_disk);
auto out = std::make_unique<WriteBufferFromFile>(temp_data_file->getAbsolutePath()); auto out = WriteBufferFromFile(temp_data_file->getAbsolutePath());
copyData(*in, *out); copyData(*in, out);
out.reset(); out.finalize();
in = createReadBufferFromFileBase(temp_data_file->getAbsolutePath(), {}); in = createReadBufferFromFileBase(temp_data_file->getAbsolutePath(), {});
} }
std::unique_ptr<ReadBufferFromFileBase> in_from_file{static_cast<ReadBufferFromFileBase *>(in.release())}; std::unique_ptr<ReadBufferFromFileBase> in_from_file{static_cast<ReadBufferFromFileBase *>(in.release())};