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 stops at the same page on each run when storage refuses to delete one key #534
One object that storage refuses to delete stops each run of the SweepObjects job at the same page. The sweep never gets past that page, so it never deletes the orphans on the later pages of the bucket.
Where
Main at 3b7a3c7122b9a3dd4a18c66c85640be95913ce4a.
SweepObjects.cs:57-68. The handler lists one page, then deletes all orphans of the page in one batch call.
ObjectStorage.cs:29-36. The batch delete throws DeleteObjectsException when one key fails.
The run throws, BackWave runs the job again with backoff, and each new run starts again at the first page.
Reproduction steps
In an integration test, put three objects under tenants/<tenant>/ that no row names, older than the grace.
Make the first listed key fail to delete. Use a fake IAmazonS3 whose DeleteObjectsAsync returns an error for that key, or an S3 deny policy or Object Lock on that key.
Set the list page size to 1 so that each object is on its own page.
Run SweepObjects two times.
Expected
The sweep deletes the two other orphans. It logs and counts the key that failed, and it tries that key again on the next run.
Actual
Each run throws at the first page. The two other orphans stay in the bucket. The next daily run stops at the same key.
Impact
Reliability and storage cost. A key that storage refuses to delete (Object Lock, a deny policy, a bad key) stops the sweep of the whole bucket until a person removes it. The failure is loud (a failed job and an Error log), but no orphan after that page gets deleted.
The review notes that a run that goes on past failed keys changes the retry contract of the job. One option: catch DeleteObjectsException per page, record the failed keys, go on to the next page, and fail the run at the end if any key failed. The delete is idempotent, so the retry of the run stays safe.
Activity