mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-24 18:40:38 +00:00
before this change, we only record the exception returned by `upload_file()`, and rethrow the exception. but the exception thrown by `update_file()` not populated to its caller. instead, the exceptional future is ignored on pupose -- we need to perform the uploads in parallel. this is why the task is not marked fail even if some of the uploads performed by it fail. in this change, we - coroutinize `backup_task_impl::do_backup()`. strictly speaking, this is not necessary to populate the exception. but, in order to ensure that the possible exception is captured before the gate is closed, and to reduce the intentation, the teardown steps are performed explicitly. - in addition to note down the exception in the logging message, we also store it in a local variable, which it rethrown before this function returns. Fixes scylladb/scylladb#21248 Signed-off-by: Kefu Chai <kefu.chai@scylladb.com> Closes scylladb/scylladb#21254
49 lines
1.1 KiB
C++
49 lines
1.1 KiB
C++
/*
|
|
* Copyright (C) 2024-present ScyllaDB
|
|
*
|
|
*/
|
|
|
|
/*
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <filesystem>
|
|
#include "tasks/task_manager.hh"
|
|
|
|
namespace s3 { class client; }
|
|
|
|
namespace db {
|
|
class snapshot_ctl;
|
|
|
|
namespace snapshot {
|
|
|
|
class backup_task_impl : public tasks::task_manager::task::impl {
|
|
snapshot_ctl& _snap_ctl;
|
|
shared_ptr<s3::client> _client;
|
|
sstring _bucket;
|
|
sstring _prefix;
|
|
std::filesystem::path _snapshot_dir;
|
|
future<> do_backup();
|
|
|
|
protected:
|
|
virtual future<> run() override;
|
|
|
|
public:
|
|
backup_task_impl(tasks::task_manager::module_ptr module,
|
|
snapshot_ctl& ctl,
|
|
shared_ptr<s3::client> cln,
|
|
sstring bucket,
|
|
sstring prefix,
|
|
sstring ks,
|
|
std::filesystem::path snapshot_dir) noexcept;
|
|
|
|
virtual std::string type() const override;
|
|
virtual tasks::is_internal is_internal() const noexcept override;
|
|
virtual tasks::is_abortable is_abortable() const noexcept override;
|
|
};
|
|
|
|
} // snapshot namespace
|
|
} // db namespace
|