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
...
@@ -763,9 +763,7 @@ module Ci
def
any_runners_available?
def
any_runners_available?
cache_for_available_runners
do
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?
project
.
active_runners
.
exists?
end
end
end
end
end
...
...
app/models/ci/runner.rb
View file @
c6926279
...
@@ -141,16 +141,9 @@ module Ci
...
@@ -141,16 +141,9 @@ module Ci
project_groups
=
::
Group
.
joins
(
:projects
).
where
(
projects:
{
id:
project_id
})
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
))
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
}
}
# deprecated
scope
:owned_or_instance_wide
,
->
(
project_id
)
do
scope
:owned_or_instance_wide
,
->
(
project_id
)
do
from_union
(
from_union
(
[
[
...
@@ -159,7 +152,7 @@ module Ci
...
@@ -159,7 +152,7 @@ module Ci
instance_type
instance_type
],
],
remove_duplicates:
false
remove_duplicates:
false
)
.
allow_cross_joins_across_databases
(
url:
'https://gitlab.com/gitlab-org/gitlab/-/issues/336433'
)
)
end
end
scope
:assignable_for
,
->
(
project
)
do
scope
:assignable_for
,
->
(
project
)
do
...
...
app/models/project.rb
View file @
c6926279
...
@@ -1775,17 +1775,12 @@ class Project < ApplicationRecord
...
@@ -1775,17 +1775,12 @@ class Project < ApplicationRecord
def
all_runners
def
all_runners
Ci
::
Runner
.
from_union
([
runners
,
group_runners
,
shared_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
end
def
all_available_runners
def
all_available_runners
Ci
::
Runner
.
from_union
([
runners
,
group_runners
,
available_shared_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
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
def
active_runners
strong_memoize
(
:active_runners
)
do
strong_memoize
(
:active_runners
)
do
all_available_runners
.
active
all_available_runners
.
active
...
@@ -1793,9 +1788,7 @@ class Project < ApplicationRecord
...
@@ -1793,9 +1788,7 @@ class Project < ApplicationRecord
end
end
def
any_online_runners?
(
&
block
)
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
)
online_runners_with_tags
.
any?
(
&
block
)
end
end
end
def
valid_runners_token?
(
token
)
def
valid_runners_token?
(
token
)
...
...
app/services/ci/update_build_queue_service.rb
View file @
c6926279
...
@@ -99,17 +99,15 @@ module Ci
...
@@ -99,17 +99,15 @@ module Ci
private
private
def
tick_for
(
build
,
runners
)
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_recent_runner_queue
runners
=
runners
.
with_tags
if
Feature
.
enabled?
(
:ci_preload_runner_tags
,
default_enabled: :yaml
)
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
|
runners
.
each
do
|
runner
|
metrics
.
increment_runner_tick
(
runner
)
metrics
.
increment_runner_tick
(
runner
)
runner
.
pick_build!
(
build
)
runner
.
pick_build!
(
build
)
end
end
end
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
...
@@ -239,44 +239,20 @@ RSpec.describe Ci::Runner do
end
end
end
end
context
'when ci_decompose_belonging_to_parent_group_of_project_query is enabled'
do
context
'when use_traversal_ids* are enabled'
do
context
'when use_traversal_ids* are enabled'
do
it_behaves_like
'.belonging_to_parent_group_of_project'
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
end
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
before
do
stub_feature_flags
(
ci_decompose_belonging_to_parent_group_of_project_query:
false
)
stub_feature_flags
(
end
use_traversal_ids:
false
,
use_traversal_ids_for_ancestors:
false
,
context
'when use_traversal_ids* are enabled'
do
use_traversal_ids_for_ancestor_scopes:
false
it_behaves_like
'.belonging_to_parent_group_of_project'
)
end
end
context
'when use_traversal_ids* are disabled'
do
it_behaves_like
'.belonging_to_parent_group_of_project'
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
end
end
describe
'.owned_or_instance_wide'
do
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