Merge pull request #73303 from ClickHouse/backport/24.10/73279

Backport #73279 to 24.10: fix missing finalize call
This commit is contained in:
robot-ch-test-poll4 2024-12-13 22:02:56 +01:00 committed by GitHub
commit 696e3d57b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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