Commit c85831f7 authored by Sean McGivern's avatar Sean McGivern

Remove duplicate authorization refresh on project create

When we create a project in a group, we need to refresh the
project_authorizations table for all of the group's members to give them
access to the new project.

In https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/13775, we
split this refresh up:

1. The creator of the project had their permissions refreshed
   immediately.
2. All of the other group members had their permissions refreshed
   asynchronously, as they could wait a few seconds to see the new
   project with no major impact.

Unfortunately, in the corresponding merge to our EE
codebase (https://gitlab.com/gitlab-org/gitlab/-/merge_requests/2787),
we didn't remove the existing refresh. From this point on, we had a
third refresh for EE installs: for all group members, we'd refresh
permissions and wait (even though we were _also_ doing this
asynchronously).

Later, as this was a line that was in EE but not in the FOSS version, we
extracted it to the ee/ directory:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/2831

The upshot of all of this is:

1. EE distributions have been double-scheduling background jobs. If a
   group has 10 users, we'd schedule 20 jobs rather than 10. FOSS
   distributions would just schedule 10.
2. EE distributions have also been slower, because the second batch of
   10 scheduled jobs would block the HTTP response from happening until
   they completed, or 10 seconds passed - whichever is sooner.
3. This has given no correctness benefit: FOSS has behaved correctly
   thoroughout this period without the extra refresh.

So this is safe to remove.
parent a82496ba
---
title: Remove duplicate authorization refresh for group members on project creation
merge_request:
author:
type: performance
......@@ -48,8 +48,6 @@ module EE
super
create_predefined_push_rule
project.group&.refresh_members_authorized_projects
end
# rubocop: disable CodeReuse/ActiveRecord
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment