From cd8dcdc5c50f509aeee06d3adbeed28d634130b4 Mon Sep 17 00:00:00 2001 From: robot-clickhouse Date: Fri, 13 Dec 2024 19:08:45 +0000 Subject: [PATCH] Backport #73279 to 24.10: fix missing finalize call --- src/Storages/StorageKeeperMap.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Storages/StorageKeeperMap.cpp b/src/Storages/StorageKeeperMap.cpp index 316eced1ed6..70e20eba431 100644 --- a/src/Storages/StorageKeeperMap.cpp +++ b/src/Storages/StorageKeeperMap.cpp @@ -1028,9 +1028,9 @@ void StorageKeeperMap::restoreDataImpl( if (!dynamic_cast(in.get())) { temp_data_file.emplace(temporary_disk); - auto out = std::make_unique(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 in_from_file{static_cast(in.release())};