diff --git a/src/Disks/ObjectStorages/DiskObjectStorageTransaction.cpp b/src/Disks/ObjectStorages/DiskObjectStorageTransaction.cpp index 19de2bb78af..0c9003360f6 100644 --- a/src/Disks/ObjectStorages/DiskObjectStorageTransaction.cpp +++ b/src/Disks/ObjectStorages/DiskObjectStorageTransaction.cpp @@ -770,7 +770,7 @@ std::unique_ptr DiskObjectStorageTransaction::writeFile { auto write_operation = std::make_unique(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 = std::move(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