Repository navigation
fix: [stable-8.0][OCISDEV-1685] remove stale group shares in the share manager - #13460
Merged
Merged
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
2403905
force-pushed
the
fix/stable-8.0-OCISDEV-1685
branch
6 times, most recently
from
November 20, 2026 08:38
ac86cad to
f03d788
Compare
…e manager Update reva to ee73b99b8, the merge commit of owncloud/reva#813. A stale group share is a share ID in the group cache that has no share. On each listing of the received shares, the jsoncs3 share manager uploaded the received.json file of the user again with the same content, and the stale ID stayed. The new reva: - removes stale group shares from the group cache, only when it read the space file or a Stat proved that the file is missing - removes a stale entry only after a grace period of 5 minutes, and forgets a stale entry 1 hour after the last listing that found it - does not upload a file when a Remove changes nothing, and reads the file again after a failed Add or Remove upload - reads the space file again when a Remove or an Update does not find the share in memory - updates a share under the space lock, and returns NotFound after a parallel unshare - does not panic in sharecache Remove when the space entry is missing - does not panic in an Add to a purged provider space - writes a share before the grantee entry, and rolls back after a failure - removes the share in an unshare also when the grantee entry fails - removes many shares with one upload for each document, also in the cleanup of the ocis shares commands - publishes one ShareExpired event for each expired share - logs the share cleanup errors after a space delete The removal of shares uses at least 3 parallel removals, also when SHARING_USER_JSONCS3_MAX_CONCURRENCY is 1. The default of the setting does not change. Describe the minimum in the setting description and in the changelog. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: Roman Perekhod <[email protected]>
2403905
force-pushed
the
fix/stable-8.0-OCISDEV-1685
branch
from
November 20, 2026 08:46
f03d788 to
7d5e7b4
Compare
2403905
marked this pull request as ready for review
November 20, 2026 08:48
2403905
enabled auto-merge (squash)
November 20, 2026 08:49
mklos-kw
approved these changes
Nov 20, 2026
mzner
approved these changes
Nov 20, 2026
f-firas
approved these changes
Nov 20, 2026
deyankiteworks
approved these changes
Nov 20, 2026
This was referenced Nov 20, 2026
2403905
added a commit
that referenced
this pull request
Nov 23, 2026
Update reva to the branch of owncloud/reva#832, the backport of owncloud/reva#813. It depends on owncloud/reva#830, the backport of owncloud/reva#751. A stale group share is a share ID in the group cache that has no share. On each listing of the received shares, the jsoncs3 share manager uploaded the received.json file of the user again with the same content, and the stale ID stayed. The new reva removes stale group shares, and it removes many shares with one upload for each document. The removal of shares uses at least 3 parallel removals, also when SHARING_USER_JSONCS3_MAX_CONCURRENCY is 1. The default of the setting does not change. The setting description and the changelog describe the minimum. Backport of #13460. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: Roman Perekhod <[email protected]>
2403905
added a commit
that referenced
this pull request
Nov 23, 2026
…e manager Update reva to the branch of owncloud/reva#833, the backport of owncloud/reva#813. It depends on owncloud/reva#831, the backport of owncloud/reva#751. A stale group share is a share ID in the group cache that has no share. On each listing of the received shares, the jsoncs3 share manager uploaded the received.json file of the user again with the same content, and the stale ID stayed. The new reva removes stale group shares, and it removes many shares with one upload for each document. The removal of shares uses at least 3 parallel removals, also when SHARING_USER_JSONCS3_MAX_CONCURRENCY is 1. The default of the setting does not change. The setting description and the changelog describe the minimum. Backport of #13460. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: Roman Perekhod <[email protected]>
2403905
added a commit
that referenced
this pull request
Nov 23, 2026
Update reva to the branch of owncloud/reva#832, the backport of owncloud/reva#813. The branch is on top of the merged owncloud/reva#830. A stale group share is a share ID in the group cache that has no share. On each listing of the received shares, the jsoncs3 share manager uploaded the received.json file of the user again with the same content, and the stale ID stayed. The new reva removes stale group shares, and it removes many shares with one upload for each document. The removal of shares uses at least 3 parallel removals, also when SHARING_USER_JSONCS3_MAX_CONCURRENCY is 1. The default of the setting does not change. The setting description and the changelog describe the minimum. Backport of #13460. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: Roman Perekhod <[email protected]>
2403905
added a commit
that referenced
this pull request
Nov 23, 2026
…e manager Update reva to the branch of owncloud/reva#833, the backport of owncloud/reva#813. The branch is on top of the merged owncloud/reva#831. A stale group share is a share ID in the group cache that has no share. On each listing of the received shares, the jsoncs3 share manager uploaded the received.json file of the user again with the same content, and the stale ID stayed. The new reva removes stale group shares, and it removes many shares with one upload for each document. The removal of shares uses at least 3 parallel removals, also when SHARING_USER_JSONCS3_MAX_CONCURRENCY is 1. The default of the setting does not change. The setting description and the changelog describe the minimum. Backport of #13460. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: Roman Perekhod <[email protected]>
2403905
added a commit
that referenced
this pull request
Nov 23, 2026
Update reva to the commit 33e223087. It includes owncloud/reva#832, the backport of owncloud/reva#813. A stale group share is a share ID in the group cache that has no share. On each listing of the received shares, the jsoncs3 share manager uploaded the received.json file of the user again with the same content, and the stale ID stayed. The new reva removes stale group shares, and it removes many shares with one upload for each document. The removal of shares uses at least 3 parallel removals, also when SHARING_USER_JSONCS3_MAX_CONCURRENCY is 1. The default of the setting does not change. The setting description and the changelog describe the minimum. Backport of #13460. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: Roman Perekhod <[email protected]>
2403905
added a commit
that referenced
this pull request
Nov 23, 2026
…e manager Update reva to the commit b4c4df426. It includes owncloud/reva#833, the backport of owncloud/reva#813. A stale group share is a share ID in the group cache that has no share. On each listing of the received shares, the jsoncs3 share manager uploaded the received.json file of the user again with the same content, and the stale ID stayed. The new reva removes stale group shares, and it removes many shares with one upload for each document. The removal of shares uses at least 3 parallel removals, also when SHARING_USER_JSONCS3_MAX_CONCURRENCY is 1. The default of the setting does not change. The setting description and the changelog describe the minimum. Backport of #13460. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: Roman Perekhod <[email protected]>
2403905
added a commit
that referenced
this pull request
Nov 23, 2026
…13544) Update reva to the commit 33e223087. It includes owncloud/reva#832, the backport of owncloud/reva#813. A stale group share is a share ID in the group cache that has no share. On each listing of the received shares, the jsoncs3 share manager uploaded the received.json file of the user again with the same content, and the stale ID stayed. The new reva removes stale group shares, and it removes many shares with one upload for each document. The removal of shares uses at least 3 parallel removals, also when SHARING_USER_JSONCS3_MAX_CONCURRENCY is 1. The default of the setting does not change. The setting description and the changelog describe the minimum. Backport of #13460. Signed-off-by: Roman Perekhod <[email protected]> Co-authored-by: Claude Sonnet 5.5 <[email protected]>
2403905
added a commit
that referenced
this pull request
Nov 23, 2026
…e manager (#13545) Update reva to the commit b4c4df426. It includes owncloud/reva#833, the backport of owncloud/reva#813. A stale group share is a share ID in the group cache that has no share. On each listing of the received shares, the jsoncs3 share manager uploaded the received.json file of the user again with the same content, and the stale ID stayed. The new reva removes stale group shares, and it removes many shares with one upload for each document. The removal of shares uses at least 3 parallel removals, also when SHARING_USER_JSONCS3_MAX_CONCURRENCY is 1. The default of the setting does not change. The setting description and the changelog describe the minimum. Backport of #13460. Signed-off-by: Roman Perekhod <[email protected]> Co-authored-by: Claude Sonnet 5.5 <[email protected]>
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
Bump reva to
v2.0.0-20261117225436-38d3324cefd7(38d3324ce), the head of owncloud/reva#813.The jsoncs3 share manager uploaded the
received.jsonfile of a user again on each listing of the received shares when the user had a stale group share.A stale group share is a share ID in the group cache that has no share.
The removal did not change the file, and the stale ID stayed, so this repeated on each listing.
In production, this causes a large volume of
share not found. cleaning upwarnings and one full document upload per stale share for each listing.Changes in reva
Stale share cleanup
Stat, because a NotFound can be temporary. A second NotFound proves that the file is missing. Thus the cleanup also removes an entry from a failed first share in a space, which has no space file.Manager.StaleShareGracePeriod). An older version writes the grantee entry and the share at the same time. During a rolling upgrade, a listing can find the grantee entry before the share is on storage. Before, the listing removed this entry, and no group member saw the share. The rule applies to user entries and to group entries. A listing that finds the share again restarts the grace period, so two short losses do not add up to one long loss.Removedoes not upload a file when the share is not in it.AddandRemoveManyin each cache drop the cached document. The next call then reads the file again. Before, the memory state stayed different from the file, because the etag did not change and a sync got NotModified. After a failedRemove, a retry found nothing to remove, did not upload, and reported success. The share stayed in the file. After a failedAdd, the pod showed an entry that was not in the file. For example, a client got an error when it accepted a share, but this pod showed the share as accepted.received.jsonof the user to the user cache. Before, it sent the stale group IDs too, and the user cache downloaded the file again to find nothing to remove.Share and unshare
Sharewrites the share before the grantee entry. When a write fails, it removes the entries that it wrote, also the grantee entry. Before, the failed write kept the share ID in memory, and the next write of the grantee document uploaded it.AlreadyExists.ShareRemovedevent went out, and a retry got NotFound. An unshare still fails when the share itself cannot be removed.Batch removal
MaxConcurrency(SHARING_USER_JSONCS3_MAX_CONCURRENCY) limits the parallel removals. The limit is at least 3. Before the batched removal, the removal of one share updated its 3 documents in parallel. With a limit of 1, an unshare needed one more round trip to the storage. When reva gets no value, the limit is 10. Before, a purge of a space with many grantees started one parallel write for each document.ShareExpiredevent for each expired share.providercache.Cache.RemoveManyreturns the IDs that its CAS upload removed, so only one caller wins, also across pods. Before, each listing that found the expired share published an event, also when the removal failed.sharecache.Cache.RemoveManydeletes a space entry when it removes the last share of the space. Before, each listing read the space file of a purged space again.Cleanup of orphaned shares
ocis sharescommands removes all orphaned shares together, with one upload for each document. 20 orphaned shares in one space did 60 uploads and now do 3.Other
ListReceivedSharesand of the listing by resource ID has the fields of one share only. Before, the listing added the fields of each share to the same logger. A later line had the fields of all earlier shares, and a log search found the wrong share.sharecache.Cache.Removeno longer panics when the user or group has no entry for the space of the share, or when the share ID has no delimiter (OCISDEV-1675). Before, the panic stopped the sharing service, also in an unshare and in the cleanup of orphaned shares.Changes in ocis
SHARING_USER_JSONCS3_MAX_CONCURRENCYdoes not change and is 1. The value sets the number of listing workers and the limit of parallel removals. More listing workers make small machines slower.SHARING_USER_JSONCS3_MAX_CONCURRENCYnow says that the removal of shares always uses at least 3 parallel go-routines.Vendor diff
Against the reva pin of
stable-8.0(48aa66c6d, #13446), this bump adds only the commits of owncloud/reva#813. They change only these files:pkg/share/manager/jsoncs3/jsoncs3.gopkg/share/manager/jsoncs3/providercache/providercache.gopkg/share/manager/jsoncs3/receivedsharecache/receivedsharecache.gopkg/share/manager/jsoncs3/sharecache/sharecache.goChangelog
changelog/unreleased/bugfix-jsoncs3-stale-group-shares.mdChecks
go mod vendorwithGOWORK=offgives no change.go mod verifypasses.ocis,sharing,storage-users,storage-shares,frontendandgraphpackages build fromvendor/.pkg/share/manager/jsoncs3/...pass with-race. Each new regression test failed before its fix.38d3324ce.Known issues
Manager.initializein reva readsinitializedwithout the lock. The race detector reports it when parallel listings start on a new manager. This race also exists onstable-8.0. It needs a separate fix.Manager.Loadin reva, which the share migration uses, callsUserReceivedStates.Addwith only the space ID as the key. The other code usesstorageid:spaceid. Migrated user shares can thus get the wrong key. A code review found this. No test confirms it yet. It also exists onstable-8.0and needs a separate ticket.Status
Draft. It depends on owncloud/reva#813. When that pull request is merged, the reva version must point to the merge commit on reva
stable-8.0.Reva
stable-8.0also hase140a3899(owncloud/reva#812, OCISDEV-1140), which is not in the current pin. The re-pin to the merge commit adds it, and it then needs its own changelog entry in ocis.🤖 Generated with Claude Code