Skip to content
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

[v24.2.x] archival: fix purger::collect_manifest_paths() #22542

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion src/v/archival/purger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,23 @@ purger::collect_manifest_paths(
continue;
}

collected.spillover.push_back(std::move(item.key));
// The spillover manifest path is of the form
// "{prefix}/{manifest.bin().x.x.x.x.x.x}" Find the index of the last
// '/' in the path, so we can check just the filename (starting from the
// first character after '/').
const size_t filename_idx = path.rfind('/');
if (filename_idx == std::string_view::npos) {
continue;
}

// File should start with "manifest.bin()", but it should have
// additional spillover components as well.
std::string_view file = path.substr(filename_idx + 1);
if (
file.starts_with(cloud_storage::partition_manifest::filename())
&& !file.ends_with(cloud_storage::partition_manifest::filename())) {
collected.spillover.push_back(std::move(item.key));
}
}

co_return collected;
Expand Down
Loading