Skip to content

The object sweep stops at the same page on each run when storage refuses to delete one key #534

Open

Description

@pdevito3

Summary

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.

The run throws, BackWave runs the job again with backoff, and each new run starts again at the first page.

Reproduction steps

  1. In an integration test, put three objects under tenants/<tenant>/ that no row names, older than the grace.
  2. 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.
  3. Set the list page size to 1 so that each object is on its own page.
  4. 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.

Source

Finding L1 in the review comment of #526: #526 (comment)

Suggested fix

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions