Skip to content

Commit

Permalink
cloud_storage: add upload_manifest with path arg
Browse files Browse the repository at this point in the history
I have some upcoming changes that move ownership of deciding a path to a
centralized location. To that end, the cloud_storage::remote will have
less ssay in the path names of manifests.

This commit is a small foundational change to expose an upload_manifest
call in which callers can determine the path. Later changes will begin
using this more extensively, and eventually the call where remote picks
a name will be removed.
  • Loading branch information
andrwng committed Jun 25, 2024
1 parent 6d390d3 commit 62224d6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/v/cloud_storage/remote.cc
Original file line number Diff line number Diff line change
Expand Up @@ -365,11 +365,19 @@ ss::future<download_result> remote::do_download_manifest(
ss::future<upload_result> remote::upload_manifest(
const cloud_storage_clients::bucket_name& bucket,
const base_manifest& manifest,
retry_chain_node& parent) {
auto key = manifest.get_manifest_path();
co_return co_await upload_manifest(bucket, manifest, key, parent);
}

ss::future<upload_result> remote::upload_manifest(
const cloud_storage_clients::bucket_name& bucket,
const base_manifest& manifest,
const remote_manifest_path& key,
retry_chain_node& parent) {
auto guard = _gate.hold();
retry_chain_node fib(&parent);
retry_chain_logger ctxlog(cst_log, fib);
auto key = manifest.get_manifest_path();
auto path = cloud_storage_clients::object_key(key());
auto lease = co_await _pool.local().acquire(fib.root_abort_source());
auto permit = fib.retry();
Expand Down
6 changes: 6 additions & 0 deletions src/v/cloud_storage/remote.h
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,12 @@ class remote
const base_manifest& manifest,
retry_chain_node& parent);

ss::future<upload_result> upload_manifest(
const cloud_storage_clients::bucket_name& bucket,
const base_manifest& manifest,
const remote_manifest_path& key,
retry_chain_node& parent);

/// \brief Upload segment to S3
///
/// The method uploads the segment while tolerating some errors. It can
Expand Down

0 comments on commit 62224d6

Please sign in to comment.