Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
c6926279
Commit
c6926279
authored
Jan 14, 2022
by
Maxime Orefice
Committed by
Furkan Ayhan
Jan 14, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove ci_decompose_belonging_to_parent_group feature flag
Changelog: performance
parent
fe881e80
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
69 deletions
+19
-69
app/models/ci/build.rb
app/models/ci/build.rb
+1
-3
app/models/ci/runner.rb
app/models/ci/runner.rb
+2
-9
app/models/project.rb
app/models/project.rb
+1
-8
app/services/ci/update_build_queue_service.rb
app/services/ci/update_build_queue_service.rb
+6
-8
config/feature_flags/development/ci_decompose_belonging_to_parent_group_of_project_query.yml
..._decompose_belonging_to_parent_group_of_project_query.yml
+0
-8
spec/models/ci/runner_spec.rb
spec/models/ci/runner_spec.rb
+9
-33
No files found.
app/models/ci/build.rb
View file @
c6926279
...
...
@@ -763,9 +763,7 @@ module Ci
def
any_runners_available?
cache_for_available_runners
do
::
Gitlab
::
Database
.
allow_cross_joins_across_databases
(
url:
'https://gitlab.com/gitlab-org/gitlab/-/issues/339937'
)
do
project
.
active_runners
.
exists?
end
project
.
active_runners
.
exists?
end
end
...
...
app/models/ci/runner.rb
View file @
c6926279
...
...
@@ -141,16 +141,9 @@ module Ci
project_groups
=
::
Group
.
joins
(
:projects
).
where
(
projects:
{
id:
project_id
})
if
Feature
.
enabled?
(
:ci_decompose_belonging_to_parent_group_of_project_query
,
default_enabled: :yaml
)
belonging_to_group
(
project_groups
.
self_and_ancestors
.
pluck
(
:id
))
else
joins
(
:groups
)
.
where
(
namespaces:
{
id:
project_groups
.
self_and_ancestors
.
as_ids
})
.
allow_cross_joins_across_databases
(
url:
'https://gitlab.com/gitlab-org/gitlab/-/issues/336433'
)
end
belonging_to_group
(
project_groups
.
self_and_ancestors
.
pluck
(
:id
))
}
# deprecated
scope
:owned_or_instance_wide
,
->
(
project_id
)
do
from_union
(
[
...
...
@@ -159,7 +152,7 @@ module Ci
instance_type
],
remove_duplicates:
false
)
.
allow_cross_joins_across_databases
(
url:
'https://gitlab.com/gitlab-org/gitlab/-/issues/336433'
)
)
end
scope
:assignable_for
,
->
(
project
)
do
...
...
app/models/project.rb
View file @
c6926279
...
...
@@ -1775,17 +1775,12 @@ class Project < ApplicationRecord
def
all_runners
Ci
::
Runner
.
from_union
([
runners
,
group_runners
,
shared_runners
])
.
allow_cross_joins_across_databases
(
url:
'https://gitlab.com/gitlab-org/gitlab/-/issues/339937'
)
end
def
all_available_runners
Ci
::
Runner
.
from_union
([
runners
,
group_runners
,
available_shared_runners
])
.
allow_cross_joins_across_databases
(
url:
'https://gitlab.com/gitlab-org/gitlab/-/issues/339937'
)
end
# Once issue 339937 is fixed, please search for all mentioned of
# https://gitlab.com/gitlab-org/gitlab/-/issues/339937,
# and remove the allow_cross_joins_across_databases.
def
active_runners
strong_memoize
(
:active_runners
)
do
all_available_runners
.
active
...
...
@@ -1793,9 +1788,7 @@ class Project < ApplicationRecord
end
def
any_online_runners?
(
&
block
)
::
Gitlab
::
Database
.
allow_cross_joins_across_databases
(
url:
'https://gitlab.com/gitlab-org/gitlab/-/issues/339937'
)
do
online_runners_with_tags
.
any?
(
&
block
)
end
online_runners_with_tags
.
any?
(
&
block
)
end
def
valid_runners_token?
(
token
)
...
...
app/services/ci/update_build_queue_service.rb
View file @
c6926279
...
...
@@ -99,17 +99,15 @@ module Ci
private
def
tick_for
(
build
,
runners
)
::
Gitlab
::
Database
.
allow_cross_joins_across_databases
(
url:
'https://gitlab.com/gitlab-org/gitlab/-/issues/339937'
)
do
runners
=
runners
.
with_recent_runner_queue
runners
=
runners
.
with_tags
if
Feature
.
enabled?
(
:ci_preload_runner_tags
,
default_enabled: :yaml
)
runners
=
runners
.
with_recent_runner_queue
runners
=
runners
.
with_tags
if
Feature
.
enabled?
(
:ci_preload_runner_tags
,
default_enabled: :yaml
)
metrics
.
observe_active_runners
(
->
{
runners
.
to_a
.
size
})
metrics
.
observe_active_runners
(
->
{
runners
.
to_a
.
size
})
runners
.
each
do
|
runner
|
metrics
.
increment_runner_tick
(
runner
)
runners
.
each
do
|
runner
|
metrics
.
increment_runner_tick
(
runner
)
runner
.
pick_build!
(
build
)
end
runner
.
pick_build!
(
build
)
end
end
...
...
config/feature_flags/development/ci_decompose_belonging_to_parent_group_of_project_query.yml
deleted
100644 → 0
View file @
fe881e80
---
name
:
ci_decompose_belonging_to_parent_group_of_project_query
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/76454
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/348560
milestone
:
'
14.7'
type
:
development
group
:
group::pipeline execution
default_enabled
:
false
spec/models/ci/runner_spec.rb
View file @
c6926279
...
...
@@ -239,44 +239,20 @@ RSpec.describe Ci::Runner do
end
end
context
'when ci_decompose_belonging_to_parent_group_of_project_query is enabled'
do
context
'when use_traversal_ids* are enabled'
do
it_behaves_like
'.belonging_to_parent_group_of_project'
end
context
'when use_traversal_ids* are disabled'
do
before
do
stub_feature_flags
(
use_traversal_ids:
false
,
use_traversal_ids_for_ancestors:
false
,
use_traversal_ids_for_ancestor_scopes:
false
)
end
it_behaves_like
'.belonging_to_parent_group_of_project'
end
context
'when use_traversal_ids* are enabled'
do
it_behaves_like
'.belonging_to_parent_group_of_project'
end
context
'when
ci_decompose_belonging_to_parent_group_of_project_query is
disabled'
do
context
'when
use_traversal_ids* are
disabled'
do
before
do
stub_feature_flags
(
ci_decompose_belonging_to_parent_group_of_project_query:
false
)
end
context
'when use_traversal_ids* are enabled'
do
it_behaves_like
'.belonging_to_parent_group_of_project'
stub_feature_flags
(
use_traversal_ids:
false
,
use_traversal_ids_for_ancestors:
false
,
use_traversal_ids_for_ancestor_scopes:
false
)
end
context
'when use_traversal_ids* are disabled'
do
before
do
stub_feature_flags
(
use_traversal_ids:
false
,
use_traversal_ids_for_ancestors:
false
,
use_traversal_ids_for_ancestor_scopes:
false
)
end
it_behaves_like
'.belonging_to_parent_group_of_project'
end
it_behaves_like
'.belonging_to_parent_group_of_project'
end
describe
'.owned_or_instance_wide'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment