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

S3 local delete failure raising meaningful error #1329

Merged
merged 2 commits into from
Feb 15, 2024

Conversation

IvoDD
Copy link
Collaborator

@IvoDD IvoDD commented Feb 15, 2024

  • Previously on a local delete failure we would have raised a KeyNotFoundException which is quite misleading
  • Now we raise a E_UNEXCPETED_S3_ERROR with additional error messages

Reference Issues/PRs

What does this implement or fix?

Any other comments?

Checklist

Checklist for code changes...
  • Have you updated the relevant docstrings, documentation and copyright notice?
  • Is this contribution tested against all ArcticDB's features?
  • Do all exceptions introduced raise appropriate error messages?
  • Are API changes highlighted in the PR description?
  • Is the PR labelled as enhancement or bug so it appears in autogenerated release notes?

- Previously on a local delete failure we would have raised a
  KeyNotFoundException which is quite misleading
- Now we raise a E_UNEXCPETED_S3_ERROR with additional error
  messages
@IvoDD IvoDD self-assigned this Feb 15, 2024
@IvoDD IvoDD force-pushed the meaningful-s3-local-delete-error branch 2 times, most recently from eb0ad90 to 65b2305 Compare February 15, 2024 13:29
@IvoDD IvoDD marked this pull request as ready for review February 15, 2024 14:19
@@ -202,7 +202,7 @@ namespace s3 {
ARCTICDB_SUBSAMPLE(S3StorageDeleteBatch, 0)
auto fmt_db = [](auto &&k) { return variant_key_type(k); };
std::vector<std::string> to_delete;
std::vector<VariantKey> failed_deletes;
std::vector<std::pair<VariantKey, std::string>> failed_deletes;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor but a struct rather than the pair might be more readable?

if (!failed_deletes.empty()){
auto failed_deletes_message = std::ostringstream();
for (auto i=0u; i<failed_deletes.size(); ++i){
auto& failed = failed_deletes[i];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we keep the pair then consider expanding it with a structured binding here rather than .first and .second

@@ -240,8 +241,19 @@ namespace s3 {

util::check(to_delete.empty(), "Have {} segment that have not been removed",
to_delete.size());
if (!failed_deletes.empty())
throw KeyNotFoundException(Composite<VariantKey>(std::move(failed_deletes)));
if (!failed_deletes.empty()){
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space before { please 🙏

cpp/arcticdb/storage/s3/detail-inl.hpp Show resolved Hide resolved
@IvoDD IvoDD merged commit 0301767 into master Feb 15, 2024
110 checks passed
@IvoDD IvoDD deleted the meaningful-s3-local-delete-error branch February 15, 2024 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants