-
Notifications
You must be signed in to change notification settings - Fork 602
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
cleanup tiered storage temporary cache file if exceptions are thrown during download #24000
Conversation
Noticed while manually reviewing code. No change in behavior expected.
src/v/cloud_storage/cache_service.cc
Outdated
co_await delete_file_and_empty_parents( | ||
(dir_path / tmp_filename).native()); | ||
} catch (...) { | ||
vlog( |
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.
We're still leaving a file here which is untracked but if this fails I believe the system has worse problems to deal with. We could commit the reservation but I don't think the code complexity is worth it.
|
||
throw disk_full_error; | ||
std::rethrow_exception(eptr); | ||
} | ||
|
||
// commit write transaction |
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.
We can still throw below and leave the file untracked on disk. I think it is fine though. If getting file size and renaming fails we have worse problems to deal with.
auto put_size = co_await ss::file_size(src);
co_await ss::rename_file(src, dest);
// We will now update
reservation.wrote_data(put_size, 1);
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.
Self review.
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.
Nice RCA, test, and fix!
d63c50c
to
c8e245b
Compare
Prepare for tmp cleanup on failure.
c8e245b
to
eb4108b
Compare
the below tests from https://buildkite.com/redpanda/redpanda/builds/57550#0192f8da-b7c5-4233-9e0a-631773ce65ea have failed and will be retried
|
ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/57550#0192fc38-263c-4190-9b05-a0fabfe137d5 |
/cdt |
/cdt |
eb4108b
to
013378e
Compare
/cdt |
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.
LGTM, though +1 to Evgeny's comment about shutdown errors
013378e
to
e90eafb
Compare
/backport v24.2.x |
/backport v24.1.x |
Failed to create a backport PR to v24.1.x branch. I tried:
|
Failed to create a backport PR to v24.2.x branch. I tried:
|
&& !ssx::is_shutdown_exception(delete_tmp_fut.get_exception())) { | ||
vlog( | ||
cst_log.error, | ||
"Failed to delete tmp file {}: {}", | ||
tmp_filepath.native(), | ||
delete_tmp_fut.get_exception()); |
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.
@nvartolomei I don't think it is safe to call get_exception
twice. from what i can tell it moves the _state
out of the future (see future::get_available_state_ref)
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.
Fix #24189
Found by @dotnwat redpanda-data#24000 (comment) (cherry picked from commit ec90163)
Found by @dotnwat redpanda-data#24000 (comment) (cherry picked from commit ec90163)
Found by @dotnwat redpanda-data#24000 (comment) (cherry picked from commit ec90163)
See CORE-8113
Backports Required
Release Notes
Bug Fixes