You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The object sweep checks for unknown migrations only at the start of a run, so a migration during the run can make it delete live objects #535
The SweepObjects job checks for unknown migrations only one time, at the start of a run. A migration that a newer Server applies while an old Server's run is in progress is not seen. If that migration moves storage keys into a table that the old Server does not know, the old run deletes live objects.
Start a sweep run on a Server built at commit A, with a bucket that has many pages.
While the run lists its pages, apply a migration from commit B that moves the rows of an attachment table into a new table that commit A does not know. A test can do this with a fake ObjectStorage whose ListPageAsync applies the migration (or moves the rows with SQL) before it returns page 2.
Let the run finish.
Expected
The run sees the new migration before it decides on the next page, and stops, as it does when the migration was applied before the run.
Actual
The run uses the old model for every page. The moved rows are not visible to it, so it deletes the objects of those rows that are older than the grace.
Impact
Data loss during a rolling deploy. The window needs a migration that moves storage keys into a new table while a run of the old Server is in progress, so it is rare. The loss is silent and cannot be undone.
From the review: a check for each page makes the window smaller, but does not close it. A sound fix needs a lock that the migration also takes, for example a Postgres advisory lock that the sweep holds for its run and that the migration step takes before it applies.
Closing as not worth the machinery. The bad case needs a migration that moves storage keys into a new table while an old Server's sweep run is in progress. A check before each page only narrows the window; the sound fix is an advisory lock that the migration step also takes, which is new deploy-time machinery for a rare case. Workaround if it ever matters: pause the sweep schedule during a deploy that moves storage key columns.
Activity
pdevito3 commentedon Nov 21, 2026
Closing as not worth the machinery. The bad case needs a migration that moves storage keys into a new table while an old Server's sweep run is in progress. A check before each page only narrows the window; the sound fix is an advisory lock that the migration step also takes, which is new deploy-time machinery for a rare case. Workaround if it ever matters: pause the sweep schedule during a deploy that moves storage key columns.