Update Project Authorizations in background for group shares
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA. As a benefit of being a GitLab Community Contributor, you receive complimentary access to GitLab Duo.
What does this MR do and why?
This MR moves the refresh of project authorizations for updating group links into a background job.
References
Related to !183920 (merged) and !195367 (merged)
Screenshots or screen recordings
Bildschirmaufzeichnung_vom_27.07.2025__19_03_54
How to set up and validate locally
- Ensure you have Database Load Balancing enabled.
- Create a group (just for isolation purpose, you could also use an existing group in GDK)
- Create many members in the group. In my tests, I used about 1230 members.
FactoryBot.create_list(:group_member, 1230, source: Group.find(<id>))in the rails console can help you. - Invite this group to another group. (Ensure you have the devtools network tab open, so you can get the correlation id)
- Copy the correlation id from the POST request that invited the group, add it to the performance bar and select it.
- Click on the count of the
pgsection from the performance bar, order chronologically, scroll down and notice manySELECT pg_wal_lsn_diff('0/296A3BF0', NULL) AS resultandSELECT CASE WHEN pg_is_in_recovery() = true AND EXISTS (SELECT 1 FROM pg_stat_get_wal_senders()) THEN pg_last_wal_replay_lsn()::text WHEN pg_is_in_recovery() = false THEN pg_current_wal_insert_lsn()::text ELSE NULL END AS location;queries. - Enable the
:project_authorizations_update_in_background_for_group_sharesfeature flag (either globally or for the groups you are testing with) - Repeat step 4, 5 and 6. Notice that the queries mentioned in step 6 aren't present so many times.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Niklas van Schrick