-
- Downloads
Eliminate N+1 queries in LFS file locks checks during a push
This significantly improves performance when a user pushes many references. project.path_locks.any? doesn't cache the output and runs `SELECT 1 AS one FROM "path_locks" WHERE project_id = N` each time. When there are thousands of refs being pushed, this can time out the unicorn worker. CE port for https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/6159.
parent
02c007bd
No related branches found
No related tags found
Showing
- app/models/project.rb 6 additions, 0 deletionsapp/models/project.rb
- changelogs/unreleased/sh-optimize-locks-check-ce.yml 5 additions, 0 deletionschangelogs/unreleased/sh-optimize-locks-check-ce.yml
- lib/gitlab/checks/commit_check.rb 1 addition, 1 deletionlib/gitlab/checks/commit_check.rb
- spec/lib/gitlab/git_access_spec.rb 16 additions, 0 deletionsspec/lib/gitlab/git_access_spec.rb
- spec/models/project_spec.rb 16 additions, 0 deletionsspec/models/project_spec.rb
Please register or sign in to comment