Skip to content

perf: cache authorized-group delegation lookups#59328

Open
solracsf wants to merge 1 commit into
masterfrom
perfCacheAuthorizedGroupLookups
Open

perf: cache authorized-group delegation lookups#59328
solracsf wants to merge 1 commit into
masterfrom
perfCacheAuthorizedGroupLookups

Conversation

@solracsf

@solracsf solracsf commented Mar 31, 2026

Copy link
Copy Markdown
Member

Summary

Repeated group-backend and DB queries on every #[AuthorizedAdminSetting] request, every share formatting call, and every group-membership hook are replaced by scoped caches (per-request arrays, a two-tier local+distributed cache, and a per-instance memoization property). All four write paths on authorized_groups invalidate the cache through AuthorizedGroupService, which now batches N mutations into a single clearCache() call.

A UNIQUE constraint on group_id is added via migration, closing a concurrent-write race that the previous applicative pre-check could not cover. Duplicate rows on existing instances are cleaned up in preSchemaChange() before the index is created.

Checklist

AI (if applicable)

  • The content of this PR was reviewed using AI
@solracsf solracsf force-pushed the perfCacheAuthorizedGroupLookups branch 2 times, most recently from ee331fb to 953b44b Compare March 31, 2026 12:04
@solracsf solracsf marked this pull request as ready for review March 31, 2026 12:57
@solracsf solracsf requested a review from a team as a code owner March 31, 2026 12:57
@solracsf solracsf requested review from Altahrim, CarlSchwan, artonge and leftybournes and removed request for a team March 31, 2026 12:57
@solracsf solracsf added 3. to review Waiting for reviews feature: users and groups and removed 2. developing Work in progress labels Mar 31, 2026
@solracsf solracsf added this to the Nextcloud 34 milestone Mar 31, 2026
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
@solracsf solracsf force-pushed the perfCacheAuthorizedGroupLookups branch from 953b44b to 22630a5 Compare March 31, 2026 13:03
This was referenced Jun 5, 2026
@susnux susnux added the community pull requests from community label Jun 9, 2026
@susnux susnux modified the milestones: Nextcloud 34.0.1, Nextcloud 35 Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4 participants