Skip to content

objectstore: finish snapshot cleanup when the bucket is missing - #1973

Merged
Luiz Oliveira (laoj2) merged 2 commits into
agent-substrate:mainfrom
cloudonly:fix-missing-snapshot-bucket-delete
Oct 8, 2026
Merged

Luiz Oliveira (laoj2) merged 2 commits into
agent-substrate:mainfrom
cloudonly:fix-missing-snapshot-bucket-delete

Conversation

@cloudonly

@cloudonly Luomu (cloudonly) commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1970

Actor deletion can get stuck when its snapshot bucket has already been removed. Treat S3 NoSuchBucket and GCS storage.ErrBucketNotExist as completed cleanup in DeletePrefix, including when the bucket disappears after listing. Log a warning with the bucket, prefix or object, and provider error when taking this path. Other storage errors still fail cleanup, and copies from a missing source still fail.

Regression coverage:

  • S3/GCS HTTP regressions cover missing-bucket and access-denied responses and missing-source copies. S3 also covers bucket removal after listing and other service errors.
  • Warning-log tests for both providers and both cleanup phases.
  • TestDeleteActor_MissingSnapshotBucket exercises the DeleteActor RPC with wrapped S3/GCS missing-bucket errors injected at the object-store boundary. It covers a SUSPENDED actor with an external snapshot and a DELETING actor with an in-progress snapshot, verifies the cleanup prefix, and confirms that GetActor returns NotFound after deletion.

Validation for e73bfd6: pr-workflow passed, including unit tests and E2E. The Actions Workflow Security Scan, GitHub Actions Scan, and CLA checks also passed.

AI tools were used in preparing this PR.

@cloudonly Luomu (cloudonly) mentioned this pull request Sep 30, 2026
2 tasks done
@bowei Bowei Du (bowei) added area/reliability area/storage kind/bug Something isn't working / bugfixes labels Sep 30, 2026
@cloudonly
Luomu (cloudonly) marked this pull request as ready for review October 1, 2026 14:34
objects, err := s.List(ctx, bucket, prefix)
if err != nil {
if isMissingBucket(err) {
return nil

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

can we log a warning here, instead of returning silently?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Addressed in e73bfd6. DeletePrefix now logs a warning when a missing bucket is detected during either listing or per-object deletion, including the bucket, prefix/object, and provider error. Added TestDeletePrefix_MissingBucketWarning to cover both paths for S3 and GCS and assert the warning level, bucket, and provider error.

@@ -24,11 +24,14 @@ package objectstore

import (

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

can we add a functional test covering the DeleteActor path from #1970?

e.g., trying to delete an actor, whose bucket is gone still succeeds.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added TestDeleteActor_MissingSnapshotBucket in e73bfd6. It exercises the DeleteActor RPC with wrapped S3 NoSuchBucket and GCS ErrBucketNotExist errors injected at the object-store boundary. The cases cover a SUSPENDED actor with an external snapshot and a DELETING actor with an in-progress snapshot; each verifies the cleanup prefix, successful deletion, and a subsequent GetActor returning NotFound. The latest pr-workflow run is awaiting workflow approval (action_required).

@laoj2
Luiz Oliveira (laoj2) added this pull request to the merge queue Oct 5, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Oct 5, 2026
@cloudonly

Luomu (cloudonly) commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor Author

Luiz Oliveira (@laoj2) could you please re-enqueue this PR in the merge queue for main? Thanks!

@laoj2
Luiz Oliveira (laoj2) added this pull request to the merge queue Oct 8, 2026
Merged via the queue into agent-substrate:main with commit 15759eb Oct 8, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/reliability area/storage kind/bug Something isn't working / bugfixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: actor cannot be deleted

3 participants