-
Notifications
You must be signed in to change notification settings - Fork 557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cloud_storage: add partition manifest downloader #20314
cloud_storage: add partition manifest downloader #20314
Conversation
The merge-base changed after approval.
There are various calls to download partition manifests (e.g. read replicas, partition recovery, Raft snapshot recovery) where the application doesn't necessarily care about the format or path of the manifest. These callers typically use remote::try_download_partition_manifest(), which checks for both the binary and JSON manifest. Since the naming scheme of objects is changing, this introduces a downloader that performs this same operation, but also takes into account the naming scheme. A later commit will plug this into the various users to replace try_download_partition_manifest(). I considered moving this logic into the remote, but generally the remote seems to have grown crowded with business logic. Naming scheme seems like it should fall outside of the remote's concern, considering most other methods in remote rely on callers to pass a path.
Topic recovery validation checks if partition manifests exist, and use a method that's built into the cloud_storage::remote. In the effort to change our object naming scheme, this means this needs to be updated to support the new naming. Rather than adding more business logic into the remote, this adds a method to the new partition_manifest_downloader to check if a given partition's manifest exists. A later commit will plumb this into topic recovery validation.
aa96693
to
c5f5f80
Compare
Latest push is just a rebase |
const cloud_storage_clients::bucket_name bucket_; | ||
const remote_path_provider& remote_path_provider_; | ||
const model::ntp ntp_; | ||
const model::initial_revision_id rev_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: does clang-tidy not complain about these const members in a movable class? https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/avoid-const-or-ref-data-members.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah it does. Movability aside I generally prefer to make things const when they can be though, for readability.
Interestingly though it still complains if I make it non-movable non-copyable. I'll leave this as is for now, unless you feel strongly about it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nah its fine leave it
There are various calls to download partition manifests (e.g. read replicas,
partition recovery, Raft snapshot recovery) where the application
doesn't necessarily care about the format or path of the manifest. These
callers typically use remote::try_download_partition_manifest(), which
checks for both the binary and JSON manifest.
Since the naming scheme of objects is changing, this introduces a
downloader that performs this same operation, but also takes into
account the naming scheme.
A later commit will plug this into the various users to replace
try_download_partition_manifest().
I considered moving this logic into the remote, but generally the remote
seems to have grown crowded with business logic. Naming scheme seems
like it should fall outside of the remote's concern, considering most
other methods in remote rely on callers to pass a path.
A similar method is added for checking if manifests exist, to eventually
subsume
remote::partition_manifest_exists()
for the same reason.Backports Required
Release Notes