[feature/guest-links] introduce migration framework and import spacemember shares#617
Open
rhafer wants to merge 12 commits intoopencloud-eu:feature/guest-linksfrom
Open
[feature/guest-links] introduce migration framework and import spacemember shares#617rhafer wants to merge 12 commits intoopencloud-eu:feature/guest-linksfrom
rhafer wants to merge 12 commits intoopencloud-eu:feature/guest-linksfrom
Conversation
423b582 to
e887afa
Compare
Move away from lazily initializing the connection to the metastorage and try initialize at service startup. This is ground work for the upcoming migration to import the space memberships into the jsoncs3 share manager.
This is not a service user (i.e. managed by the service-auth authentication), but a special just for the system metadata storage.
When the received share to import has a userid set, we need to update the UserReceiveState even if the Grantee is a group (to correctly import the "accepted" state).
For the upcoming migration of space memberships to the shareprovider the service user needs to be able to read the Grants of all spaceroots.
…pacemember shares The migration state (currently only the version number) is persisted on the metadata storage (migratiion/state.json). Add a first migration "0001_import_spacemembers" to import the spaceroot Grants on the storageprovider as shares into the manager. Issue: opencloud-eu/opencloud#2612
When importing space membership, the userid's from the grants do not have an IDP value set. Do a user/group lookup to get the correct IDP value. Cache results to avoid repeated lookups.
res might be nil when disk.Download returned an error
This add locking around the migration runner to prevent the migrations being executed in parallel when multiple instances of the sharing service are running. The lock has a ttl of 1 minute and is refreshed every 20 seconds. Other instances are trying to acquire the look evert 5 seconds until it was either released or became stale.
This is needed for being able to run the unit tests of the jsoncs3 sharemanager.
While migration are running block any Write call on the share manager.
e887afa to
f863cda
Compare
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.
The migration state (currently only the version number) is persisted on the metadata storage (migratiion/state.json).
Add a first migration "0001_import_spacemembers" to import the spaceroot Grants on the storageprovider as shares into the manager.
There are still some open issues to address:
Issue: opencloud-eu/opencloud#2612