Repository navigation
fix(decomposedfs): invalidate all space indexes on purge - #695
Merged
Merged
Conversation
aduffeck
requested changes
Jun 25, 2026
aduffeck
left a comment
Member
There was a problem hiding this comment.
Thanks for opening the PR. Can you please revert the changes in utils/decomposedfs? It's supposed to be a verbatim copy of the ocis storage driver implementation shouldn't be changed.
The rest of the changes looks good to me 👍
Purging a space removed only the by-type index, leaving stale entries in the by-user-id and by-group indexes for the owner and every grantee. The search service then logs an error for every orphaned space on each indexing pass, and the space id remains in the on-disk index files. Remove the space from the by-user-id and by-group indexes for the owner and each grantee on purge, the same way an expired grant is already removed. This covers both decomposedfs trees (pkg, used by the decomposeds3, decomposed and posix drivers, and utils, used by the ocis and s3ng drivers). Fixes: opencloud-eu/opencloud#2985
michaelstingl
force-pushed
the
issue-2985-purge-index
branch
from
June 25, 2026 15:13
55c9213 to
781d330
Compare
Author
|
Done — reverted both Could you approve the pipeline run when you get a chance? As a non-member my pushes need approval before CI can run. Thanks! 🤖 drafted with Claude Code, reviewed before submitting. |
aduffeck
approved these changes
Jun 26, 2026
Member
|
Merged, thanks! |
michaelstingl
added a commit
to michaelstingl/opencloud-eu-reva
that referenced
this pull request
Jun 27, 2026
The space index tests added in opencloud-eu#695 purge a project space as its owner (a space manager) and expect success. opencloud-eu#672 later restricted managers to disabling spaces, so that only a delete-all-spaces user may purge. The opencloud-eu#695 branch predated that change and was not rebased onto it, so a textually clean merge left these three tests failing on main. Purge as a delete-all-spaces user instead, matching the current permission model. Disabling stays with the space manager. Test-only, no production change.
michaelstingl
added a commit
to michaelstingl/opencloud-eu-reva
that referenced
this pull request
Jun 27, 2026
… restriction The space index tests added in opencloud-eu#695 purge a project space as its owner (a space manager) and expect success. opencloud-eu#672 later restricted managers to disabling spaces, so that only a delete-all-spaces user may purge. The opencloud-eu#695 branch predated that change and was not rebased onto it, so a textually clean merge left these three tests failing on main. Purge as a delete-all-spaces user in those tests, matching the current permission model, and add the missing counterpart assertion: a space manager may disable a project space but not purge it. Test-only, no production change.
This was referenced Jun 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The
purgebranch ofDeleteStorageSpaceremoved only the by-type index. It left the purged space referenced in the by-user-id and by-group indexes, for the space owner and for every grantee. After a purge the on-disk space tree is gone, but those index entries remain. The search service then walks each indexed space and logs an error for the missing one on every pass.Root cause:
updateIndexespopulates the by-type index and the by-user-id / by-group indexes (the owner on space creation, each grantee on share), but the purge only calledspaceTypeIndex.Remove. A// TODO invalidate ALL indexes in msgpack, not only by typeat that call site noted the gap.Fix: on purge, also remove the space from the by-user-id and by-group indexes, for the owner (read from the
OwnerIDAttrextended attribute) and for each grantee (fromListGrants). Removal is best effort: the purge logs an index error and continues, the same way the expired-grant removal already does.The same gap exists in both decomposedfs trees, so the fix covers both:
pkg/storage/pkg/decomposedfs(used by the decomposeds3, decomposed and posix drivers) andpkg/storage/utils/decomposedfs(used by the ocis and s3ng drivers).Scope: this stops new stale index entries on purge. It does not delete the S3 objects that a purge already leaves behind on the decomposedS3 driver (a separate blob-removal concern), and it does not clean up spaces that were orphaned before this change.
Related Issue
Motivation and Context
Any space purge leaves a stale reference in the by-user-id / by-group index. The issue surfaced after a delete-and-recreate of a project space, where the old space stays referenced for the owner and the shared users. The reproduction and the root-cause trace are in the linked issue.
How Has This Been Tested?
go testandgo veton both decomposedfs packages (full suites pass)golangci-lintv2.10.1 (pinned in the Makefile) on both packages: 0 issuesScreenshots (if appropriate):
Types of changes
Checklist:
Type:*label via ready-release-go, so no fragment is needed)🤖 drafted with Claude Code, reviewed before submitting.