Skip to content

Let a purge survive a store that fails a few deletes per pass - #302

Merged
joepio merged 1 commit into
mainfrom
purge-survives-a-flaky-store
Sep 10, 2026
Merged

Let a purge survive a store that fails a few deletes per pass#302
joepio merged 1 commit into
mainfrom
purge-survives-a-flaky-store

Conversation

@joepio

@joepio joepio commented Sep 10, 2026

Copy link
Copy Markdown
Member

Found while purging the unapproved sources of #277.

Purging Goeree-Overflakkee lists tens of thousands of objects; Hetzner's store answers a handful of deletes per pass with a 5xx. One such failure threw out of deleteObjects, deleteByPrefix aborted the pass, and purge_source.ts retried the whole prefix from the beginning, five times, each time hitting another transient failure somewhere in the list: three hours on one source, nothing finished.

  • deleteObject (new, private): the read path's timeout, four attempts with a short back-off, 404 counts as done, other 4xx not retried.
  • deleteObjects: every key is tried; failures are reported together at the end instead of stopping the batch.
  • deleteByPrefix: a page whose deletes partly failed does not stop the pass; leftovers are reported at the end and are still listed for the next pass, which the purge script's own retry provides.
  • purge_source.ts resolves through getProjectableSource, so a source switched off in the catalog (the step before removing its data) can be purged with the live image; the runnable lookup refused exactly those today.

Tests: a key that keeps failing does not block the others; a key that fails once is retried, and a 404 is success.

Purging Goeree-Overflakkee listed tens of thousands of objects, and the
store failed a handful of deletes per pass with a 5xx; one such failure
aborted the whole pass and the next attempt started from the beginning,
so the purge never finished. Each delete now gets the read path's
ceiling and a short retry, a key that still fails does not stop the
others, and a pass reports its leftovers at the end for the next pass to
find.

Also: purge_source.ts resolves the source through the projectable lookup,
so a source that was switched off in the catalog (the step before its
data is removed) can be purged with the live image instead of an old
one.
@joepio
joepio merged commit aaa9443 into main Sep 10, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant