Skip to content

Commit

Permalink
storage: remove assertion on is_cloud_retention_active
Browse files Browse the repository at this point in the history
This assertion can be triggered if a the configuration for a topic is
changed between when space management sets the `_cloud_gc_offset` to
when gc actually runs on the log. So to avoid crashing in this case the
assertion is changed to an early return and a warning is logged instead.

(cherry picked from commit 137951e)
  • Loading branch information
ballard26 authored and vbotbuildovich committed Nov 11, 2024
1 parent 6764fd6 commit abe92c3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/v/storage/disk_log_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1284,8 +1284,13 @@ ss::future<std::optional<model::offset>> disk_log_impl::do_gc(gc_config cfg) {
const auto offset = _cloud_gc_offset.value();
_cloud_gc_offset.reset();

vassert(
is_cloud_retention_active(), "Expected remote retention active");
if (!is_cloud_retention_active()) {
vlog(
gclog.warn,
"[{}] expected remote retention to be active",
config().ntp());
co_return std::nullopt;
}

vlog(
gclog.info,
Expand Down

0 comments on commit abe92c3

Please sign in to comment.