Skip to content

fix(decomposedfs): delete all blobs when purging a space - #971

Merged
v-scharf merged 2 commits into
mainfrom
fix/purge-space-blobs
Nov 5, 2026
Merged

v-scharf merged 2 commits into
mainfrom
fix/purge-space-blobs

Conversation

@v-scharf

@v-scharf v-scharf commented Nov 4, 2026 •

Copy link
Copy Markdown

Purging a space now deletes the blobs of all its nodes, so with an s3 blobstore the data of purged project and personal spaces no longer stays in the bucket.

DeleteStorageSpace walked only the directory of the space root node to find blobs, but the node metadata lives in the nodes tree of the space, so no blob was found. It now walks the whole space directory (nodes, revisions, trashed nodes). posix is unaffected: there the space root and the root node are the same path.

Risk: the purge now reads every .mpk of the space and deletes the blobs one by one, so purging large spaces takes longer, also on decomposed where the blobs would go with the space directory anyway. A failed or interrupted purge can be retried.

Tested with a unit test (fails without the fix) and manually with decomposeds3 + minio: project space delete and user delete remove the objects from the bucket.

Fixes opencloud-eu/opencloud#1865

AI assistance: Claude Code (claude-opus-5-5) found the cause and wrote the fix and the test; tested manually by the author.

Purging a space walked only the directory of the space root node to find
the blobs to delete, but the metadata of the other nodes lives in the
nodes tree of the space. No blob was deleted, so with an s3 blobstore the
data of purged project and personal spaces stayed in the bucket. Walk the
whole space directory instead.

Fixes opencloud-eu/opencloud#1865

Assisted-by: Claude Code:claude-opus-5-5
})
// purging one space must remove only that space's entry: a sibling
// space of the same owner must stay in the by-user-id index.
// purging must delete the blobs of all nodes in the space, not only of the root node

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That new test should move two lines up, it currently disjoins the other comment from its test.

Comment thread pkg/storage/pkg/decomposedfs/spaces.go Resolved
Delete the blobs before the indexes and the metadata are removed, so that
a failed purge can be retried. Skip child symlinks, unparseable metadata
files and entries that vanished during the walk instead of aborting the
purge.

Assisted-by: Claude Code:claude-opus-5-5
@v-scharf
v-scharf requested a review from aduffeck November 5, 2026 09:45
@v-scharf
v-scharf merged commit 1bf5f89 into main Nov 5, 2026
19 checks passed
@v-scharf
v-scharf deleted the fix/purge-space-blobs branch November 5, 2026 12:23
@openclouders openclouders mentioned this pull request Nov 4, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Data is not deleted from S3 after deleting the space (personal or project)

2 participants