diff --git a/src/Disks/ObjectStorages/DiskObjectStorageTransaction.cpp b/src/Disks/ObjectStorages/DiskObjectStorageTransaction.cpp index 880911b9958..522761aba4d 100644 --- a/src/Disks/ObjectStorages/DiskObjectStorageTransaction.cpp +++ b/src/Disks/ObjectStorages/DiskObjectStorageTransaction.cpp @@ -782,9 +782,9 @@ std::unique_ptr DiskObjectStorageTransaction::writeFile } else { - auto write_operation = std::make_unique(object_storage, metadata_storage, object); + auto write_operation = std::make_shared(object_storage, metadata_storage, object); - create_metadata_callback = [object_storage_tx = shared_from_this(), write_op = write_operation.get(), mode, path, key_ = std::move(object_key)](size_t count) + create_metadata_callback = [object_storage_tx = shared_from_this(), write_op = write_operation, mode, path, key_ = std::move(object_key)](size_t count) { /// This callback called in WriteBuffer finalize method -- only there we actually know /// how many bytes were written. We don't control when this finalize method will be called diff --git a/src/Disks/ObjectStorages/DiskObjectStorageTransaction.h b/src/Disks/ObjectStorages/DiskObjectStorageTransaction.h index 23f66990d54..d69378b8cba 100644 --- a/src/Disks/ObjectStorages/DiskObjectStorageTransaction.h +++ b/src/Disks/ObjectStorages/DiskObjectStorageTransaction.h @@ -1,5 +1,6 @@ #pragma once +#include #include #include #include @@ -34,7 +35,7 @@ public: virtual std::string getInfoForLog() const = 0; }; -using DiskObjectStorageOperation = std::unique_ptr; +using DiskObjectStorageOperation = std::shared_ptr; using DiskObjectStorageOperations = std::vector;