Skip to content

rename the space root before purging it - #876

Merged
micbar merged 2 commits into
mainfrom
fix/posix-purge-race
Oct 19, 2026
Merged

micbar merged 2 commits into
mainfrom
fix/posix-purge-race

Conversation

@micbar

@micbar micbar commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Purging a space could fail with unlinkat …: directory not empty. Requests that lock nodes of the space while it is being removed recreate .oc-nodes/locks/<id>.mlock inside it.

  • rename the space root to .oc-purge-<name>-<uuid> before removing it
  • Lock creates the metadata dirs with Mkdir instead of MkdirAll, so it can't bring back a removed space root
  • the posix watcher ignores tombstones

Needed for opencloud-eu/opencloud#3710, which no longer ignores a failed purge when deleting a user.

Comment thread pkg/storage/fs/posix/lookup/lookup.go Resolved
Comment thread pkg/storage/pkg/decomposedfs/spaces.go Resolved
@micbar
micbar requested a review from aduffeck October 14, 2026 14:02
@micbar

micbar commented Oct 19, 2026

Copy link
Copy Markdown
Member Author

Tested locally with posix: purged spaces (500–1000 files) while 8–16 clients kept uploading and listing in them. 20/20 purges returned 204, nothing left on disk, no more directory not empty.

@micbar
micbar merged commit 0d451eb into main Oct 19, 2026
19 checks passed
@micbar
micbar deleted the fix/posix-purge-race branch October 19, 2026 11:55
@openclouders openclouders mentioned this pull request Oct 19, 2026
1 task
micbar added a commit that referenced this pull request Oct 19, 2026
* rename the space root before purging it

* fix: apply changes from code review
micbar added a commit that referenced this pull request Oct 19, 2026
* rename the space root before purging it

* fix: apply changes from code review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants