-
Notifications
You must be signed in to change notification settings - Fork 741
[CORE-13370] archival: Fix retention fallthrough behavior #27913
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,11 +14,11 @@ | |
|
|
||
| namespace cloud_storage { | ||
|
|
||
| const char* recovery_error_category::name() const noexcept { | ||
| const char* recovery_error_category_type::name() const noexcept { | ||
| return "recovery_error_code"; | ||
| } | ||
|
|
||
| std::string recovery_error_category::message(int c) const { | ||
| std::string recovery_error_category_type::message(int c) const { | ||
| switch (static_cast<recovery_error_code>(c)) { | ||
| case recovery_error_code::success: | ||
| return "recovery successful"; | ||
|
|
@@ -37,13 +37,13 @@ std::string recovery_error_category::message(int c) const { | |
| } | ||
| } | ||
|
|
||
| const std::error_category& error_category() noexcept { | ||
| static const recovery_error_category e; | ||
| const std::error_category& recovery_error_category() noexcept { | ||
| static const recovery_error_category_type e; | ||
|
Comment on lines
-40
to
+41
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Lazin maybe we can do something like this in cloud topics? |
||
| return e; | ||
| } | ||
|
|
||
| std::error_code make_error_code(recovery_error_code e) noexcept { | ||
| return {static_cast<int>(e), error_category()}; | ||
| return {static_cast<int>(e), recovery_error_category()}; | ||
| } | ||
|
|
||
| recovery_error_ctx | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3018,6 +3018,23 @@ ss::future<> ntp_archiver::apply_spillover() { | |
| const auto manifest_upload_timeout = _conf->manifest_upload_timeout(); | ||
| const auto manifest_upload_backoff = _conf->cloud_storage_initial_backoff(); | ||
|
|
||
| // Check the spillover invariant. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why isn't the fix to demote the archival_metadata_stm error to a warning? The issue is benign at this point, and expected due to races, right?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't it better to eliminate the race? |
||
| // The start_offset of the manifest must be equal to the begin_offset of | ||
| // the first segment in the manifest. | ||
| if (auto so = manifest().get_start_offset(); | ||
| so.has_value() && !manifest().empty()) { | ||
| auto fo = manifest().begin()->base_offset; | ||
| if (fo != so.value()) { | ||
| vlog( | ||
| _rtclog.error, | ||
|
oleiman marked this conversation as resolved.
|
||
| "Spillover invariant violated: manifest start_offset {}, first " | ||
| "segment base_offset {}", | ||
| so.value(), | ||
| fo); | ||
| co_return; | ||
| } | ||
| } | ||
|
|
||
| if (manifest_size_limit.has_value()) { | ||
| vlog( | ||
| _rtclog.debug, | ||
|
|
@@ -3314,9 +3331,11 @@ ss::future<> ntp_archiver::apply_retention() { | |
| if (error != cluster::errc::success) { | ||
| vlog( | ||
| _rtclog.warn, | ||
| "Failed to update archival metadata STM start offest according " | ||
| "Failed to update archival metadata STM start offset according " | ||
| "to retention policy: {}", | ||
| error); | ||
| throw std::runtime_error(fmt_with_ctx( | ||
| fmt::format, "Failed to update start offset: {}", error)); | ||
| } | ||
| } else { | ||
| vlog( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.