-
Notifications
You must be signed in to change notification settings - Fork 604
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
CORE-8695 crash_tracker: implement crash report upload markers #25130
base: dev
Are you sure you want to change the base?
Conversation
Implement marking crash reports as uploaded and checking if a crash report has been uploaded. This is implemented using empty files created on disk with the same name as the crash report + a ".uploaded" suffix.
Clean up any upload markers on disk that do not have an associated crash report. This cleanup is done after the count-based removal of crash reports (see remove_old_crashfiles()).
return crash_report_path.parent_path() | ||
/ (crash_report_path.filename().string() + recorder::upload_marker_suffix); |
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.
is this different than return path + suffix
?
|
||
// Create an empty upload marker | ||
const auto marker_path = to_upload_marker_path(file_path).string(); | ||
auto f = co_await ss::open_file_dma(marker_path, ss::open_flags::create); |
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: without O_EXCL
i'd expect this to succeed even if the file exists. So you could probably drop the is_uploaded()
checked, unless there is something i'm missing.
} | ||
|
||
for (const auto& entry : | ||
std::filesystem::directory_iterator(crash_report_dir)) { |
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.
use utils/directory_walker.h
?
We will use empty files to track if a certain crash file has been uploaded through our metrics reporter telemetry mechanism.
To mark a crash file as uploaded, we touch a new file with the same name + the ".uploaded" suffix. To check if a crash file has been uploaded, we check if a file with the same name + the ".uploaded" suffix exists. We also implement the clean up of any upload markers on disk that do not have an associated crash report.
Fixes https://redpandadata.atlassian.net/browse/CORE-8695
Backports Required
Release Notes