Skip to content

[feature/guest-links] introduce migration framework and import spacemember shares#617

Open
rhafer wants to merge 12 commits intoopencloud-eu:feature/guest-linksfrom
rhafer:space-member-migration
Open

[feature/guest-links] introduce migration framework and import spacemember shares#617
rhafer wants to merge 12 commits intoopencloud-eu:feature/guest-linksfrom
rhafer:space-member-migration

Conversation

@rhafer
Copy link
Copy Markdown
Member

@rhafer rhafer commented May 6, 2026

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:

  • Tests, Tests, Tests, ...
  • The UserIds stored in the grants on storageprovider do not include the IDP value. As a temporary hack we use a hardcoded value for IDP. This needs to be change to perform a user/groupid lookup via the gateway to get the correct value
  • There no is protection against running the migratons in parallel when multiple instances of the shareprovider are running
  • while migrations are running we should deny any request that would cause a write to the storage (reads should be ok)
  • some optimization (e.g. don't run migrations on a fresh install)

Issue: opencloud-eu/opencloud#2612

@rhafer rhafer self-assigned this May 6, 2026
@rhafer rhafer force-pushed the space-member-migration branch 3 times, most recently from 423b582 to e887afa Compare May 7, 2026 12:52
@rhafer rhafer marked this pull request as ready for review May 7, 2026 12:52
rhafer added 12 commits May 7, 2026 16:11
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.
@rhafer rhafer force-pushed the space-member-migration branch from e887afa to f863cda Compare May 7, 2026 14:12
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.

1 participant