Skip to content

Commit 3810690

Browse files
committed
storage: skip local housekeeping and gc for cloud topics
disk_log_impl gc() and housekeeping() are no-ops for cloud topics: is_locally_collectable() and is_locally_compacted() are both false, so do_gc returns nullopt and local compaction is skipped. The local log is trimmed by ctp_stm and compaction happens at L1. do_gc asserts it is not reached for tiered_cloud, so returning early for cloud topics also keeps that invariant true: housekeeping_scan calls gc()/housekeeping() for every registered log, cloud topics included. Signed-off-by: Oren Leiman <oren.leiman@redpanda.com>
1 parent 03bdc56 commit 3810690

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/v/storage/disk_log_impl.cc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,6 +1362,11 @@ gc_config disk_log_impl::apply_overrides(gc_config defaults) const {
13621362
}
13631363

13641364
ss::future<> disk_log_impl::housekeeping(housekeeping_config cfg) {
1365+
// Cloud topics do local retention/compaction elsewhere (ctp_stm trims the
1366+
// local log; compaction is at L1), so this loop does nothing for them.
1367+
if (config().cloud_topic_enabled()) {
1368+
co_return;
1369+
}
13651370
ss::gate::holder holder{_compaction_housekeeping_gate};
13661371
vlog(
13671372
gclog.trace,
@@ -1767,12 +1772,21 @@ ss::future<> disk_log_impl::rewrite_segment_with_offset_map(
17671772
}
17681773

17691774
ss::future<> disk_log_impl::gc(gc_config cfg) {
1775+
// Cloud topics do local retention/compaction elsewhere (ctp_stm trims the
1776+
// local log; compaction is at L1), so disk_log_impl gc does not apply.
1777+
if (config().cloud_topic_enabled()) {
1778+
co_return;
1779+
}
17701780
ss::gate::holder holder{_compaction_housekeeping_gate};
17711781
co_await do_gc(cfg);
17721782
}
17731783

17741784
ss::future<std::optional<model::offset>> disk_log_impl::do_gc(gc_config cfg) {
17751785
vassert(!_closed, "gc on closed log - {}", *this);
1786+
vassert(
1787+
!config().is_tiered_cloud(),
1788+
"[{}] gc on tiered_cloud partition",
1789+
config().ntp());
17761790

17771791
cfg = apply_overrides(cfg);
17781792

0 commit comments

Comments
 (0)