Skip to content

[v26.1.x] ct/l0/gc: collect stranded L0 objects after all cloud topics deleted#30283

Open
vbotbuildovich wants to merge 1 commit intoredpanda-data:v26.1.xfrom
vbotbuildovich:backport-pr-30200-v26.1.x-904
Open

[v26.1.x] ct/l0/gc: collect stranded L0 objects after all cloud topics deleted#30283
vbotbuildovich wants to merge 1 commit intoredpanda-data:v26.1.xfrom
vbotbuildovich:backport-pr-30200-v26.1.x-904

Conversation

@vbotbuildovich
Copy link
Copy Markdown
Collaborator

Backport of PR #30200

max_gc_eligible_epoch returned std::nullopt when the partition
snapshot was empty, causing try_to_collect to report
no_collectible_epoch after listing. L0 objects left over from
previously deleted topics stayed in the bucket forever.

Fall through with snap_revision (controller last applied offset)
as the watermark: this is the zero-iteration case of the existing
join, which already starts at snap_revision and walks it down per
partition.

Safety rests on invariants from the existing algorithm:

- get_partitions ensures that the topic table snapshot is in sync
  with the controller stm (i.e. snap revision)
- L0 objects never have an epoch less than any constinuent topic's
  initial revision ID.

So with an empty topic table at snapshot revision N, any _new_ data
must have an epoch > N. Therefore any L0 objects w/ epoch <= N is
safe to GC.

Includes a ducktape regression test:

- pause GC
- accumulate some L0 objects
- delete the only cloud topic
- resume GC
- assert that orphaned objects drain.

Without the fixt the test times out w/ stuck objects.

Signed-off-by: Oren Leiman <oren.leiman@redpanda.com>
(cherry picked from commit 0eee6a8)
@vbotbuildovich vbotbuildovich added this to the v26.1.x-next milestone Apr 24, 2026
@vbotbuildovich vbotbuildovich added the kind/backport PRs targeting a stable branch label Apr 24, 2026
@vbotbuildovich vbotbuildovich requested a review from oleiman April 24, 2026 00:08
@oleiman oleiman self-assigned this Apr 24, 2026
Copy link
Copy Markdown
Member

@oleiman oleiman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clean

@oleiman oleiman requested a review from dotnwat May 1, 2026 15:44
@oleiman
Copy link
Copy Markdown
Member

oleiman commented May 1, 2026

@dotnwat I think you didn't get a chance to sign off on the PR into dev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/redpanda kind/backport PRs targeting a stable branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants