Merge branch 'docs-zj-update-n-plus-one-comments' into 'master'

Update comments about N + 1 Gitaly calls

See merge request gitlab-org/gitlab-ce!27178
This commit is contained in:
Douglas Barbosa Alexandre 2019-04-09 16:34:11 +00:00
commit 61ab1f7364
7 changed files with 8 additions and 7 deletions

View File

@ -14,8 +14,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
respond_to do |format| respond_to do |format|
format.html do format.html do
# n+1: https://gitlab.com/gitlab-org/gitlab-ce/issues/37434 # n+1: https://gitlab.com/gitlab-org/gitlab-ce/issues/40260
# Also https://gitlab.com/gitlab-org/gitlab-ce/issues/40260
Gitlab::GitalyClient.allow_n_plus_1_calls do Gitlab::GitalyClient.allow_n_plus_1_calls do
render render
end end

View File

@ -25,7 +25,7 @@ class Projects::BranchesController < Projects::ApplicationController
@refs_pipelines = @project.ci_pipelines.latest_successful_for_refs(@branches.map(&:name)) @refs_pipelines = @project.ci_pipelines.latest_successful_for_refs(@branches.map(&:name))
@merged_branch_names = repository.merged_branch_names(@branches.map(&:name)) @merged_branch_names = repository.merged_branch_names(@branches.map(&:name))
# n+1: https://gitlab.com/gitlab-org/gitaly/issues/992 # n+1: https://gitlab.com/gitlab-org/gitlab-ce/issues/48097
Gitlab::GitalyClient.allow_n_plus_1_calls do Gitlab::GitalyClient.allow_n_plus_1_calls do
@max_commits = @branches.reduce(0) do |memo, branch| @max_commits = @branches.reduce(0) do |memo, branch|
diverging_commit_counts = repository.diverging_commit_counts(branch) diverging_commit_counts = repository.diverging_commit_counts(branch)

View File

@ -15,7 +15,7 @@ class RootController < Dashboard::ProjectsController
before_action :redirect_logged_user, if: -> { current_user.present? } before_action :redirect_logged_user, if: -> { current_user.present? }
def index def index
# n+1: https://gitlab.com/gitlab-org/gitlab-ce/issues/37434 # n+1: https://gitlab.com/gitlab-org/gitlab-ce/issues/40260
Gitlab::GitalyClient.allow_n_plus_1_calls do Gitlab::GitalyClient.allow_n_plus_1_calls do
super super
end end

View File

@ -110,7 +110,7 @@ class Blob < SimpleDelegator
end end
def load_all_data! def load_all_data!
# Endpoint needed: gitlab-org/gitaly#756 # Endpoint needed: https://gitlab.com/gitlab-org/gitaly/issues/756
Gitlab::GitalyClient.allow_n_plus_1_calls do Gitlab::GitalyClient.allow_n_plus_1_calls do
super(project.repository) if project super(project.repository) if project
end end

View File

@ -14,7 +14,9 @@ module MergeRequests
private private
def refresh_merge_requests! def refresh_merge_requests!
# n + 1: https://gitlab.com/gitlab-org/gitlab-ce/issues/60289
Gitlab::GitalyClient.allow_n_plus_1_calls(&method(:find_new_commits)) Gitlab::GitalyClient.allow_n_plus_1_calls(&method(:find_new_commits))
# Be sure to close outstanding MRs before reloading them to avoid generating an # Be sure to close outstanding MRs before reloading them to avoid generating an
# empty diff during a manual merge # empty diff during a manual merge
close_upon_missing_source_branch_ref close_upon_missing_source_branch_ref

View File

@ -6,7 +6,7 @@ Workhorse and GitLab-Shell.
## Beginner's guide ## Beginner's guide
Start by reading the gitaly repository's Start by reading the gitaly repository's
[Beginner's guide to Gitaly contributions](https://gitlab.com/gitlab-org/gitaly/blob/master/doc/beginners_guide.md). [Beginner's guide to Gitaly contributions](https://gitlab.com/gitlab-org/gitaly/blob/master/doc/beginners_guide.md).
It describes how to setup gitaly, the various components of gitaly and what they do, and how to run its test suites. It describes how to setup gitaly, the various components of gitaly and what they do, and how to run its test suites.
## Developing new Git features ## Developing new Git features

View File

@ -150,7 +150,7 @@ module Banzai
end end
def uri_type(path) def uri_type(path)
# https://gitlab.com/gitlab-org/gitlab-ce/issues/58011 # https://gitlab.com/gitlab-org/gitlab-ce/issues/58657
Gitlab::GitalyClient.allow_n_plus_1_calls do Gitlab::GitalyClient.allow_n_plus_1_calls do
@uri_types[path] ||= current_commit.uri_type(path) @uri_types[path] ||= current_commit.uri_type(path)
end end