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
ceab1698
Commit
ceab1698
authored
Mar 17, 2020
by
Dmitry Gruzd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove elasticsearch_use_routing feature flag
parent
dec11f02
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
47 deletions
+29
-47
changelogs/unreleased/196838-remove-routing-ff.yml
changelogs/unreleased/196838-remove-routing-ff.yml
+5
-0
ee/lib/elastic/latest/routing.rb
ee/lib/elastic/latest/routing.rb
+0
-1
ee/spec/lib/elastic/latest/routing_spec.rb
ee/spec/lib/elastic/latest/routing_spec.rb
+24
-46
No files found.
changelogs/unreleased/196838-remove-routing-ff.yml
0 → 100644
View file @
ceab1698
---
title
:
Improve Advanced global search performance by using routing
merge_request
:
27398
author
:
type
:
performance
ee/lib/elastic/latest/routing.rb
View file @
ceab1698
...
...
@@ -8,7 +8,6 @@ module Elastic
ES_ROUTING_MAX_COUNT
=
128
def
routing_options
(
options
)
return
{}
if
Feature
.
disabled?
(
:elasticsearch_use_routing
)
return
{}
if
options
[
:public_and_internal_projects
]
ids
=
if
options
[
:project_id
]
...
...
ee/spec/lib/elastic/latest/routing_spec.rb
View file @
ceab1698
...
...
@@ -27,62 +27,40 @@ describe Elastic::Latest::Routing do
end
describe
'#routing_options'
do
include
StubFeatureFlags
context
'when feature flag is enabled'
do
before
do
stub_feature_flags
(
elasticsearch_use_routing:
true
)
end
it
'returns correct options for project_id'
do
expect
(
subject
.
routing_options
({
project_id:
1
})).
to
eq
({
routing:
'project_1'
})
end
it
'returns correct options for repository_id'
do
expect
(
subject
.
routing_options
({
repository_id:
1
})).
to
eq
({
routing:
'project_1'
})
end
it
'returns correct options for project_ids'
do
expect
(
subject
.
routing_options
({
project_ids:
project_ids
})).
to
eq
({
routing:
project_routing
})
end
it
'returns correct options for project_id'
do
expect
(
subject
.
routing_options
({
project_id:
1
})).
to
eq
({
routing:
'project_1'
})
end
it
'returns empty hash when provided an empty array
'
do
expect
(
subject
.
routing_options
({
project_ids:
[]
})).
to
eq
({
})
end
it
'returns correct options for repository_id
'
do
expect
(
subject
.
routing_options
({
repository_id:
1
})).
to
eq
({
routing:
'project_1'
})
end
it
'returns empty hash when provided :any to
project_ids'
do
expect
(
subject
.
routing_options
({
project_ids: :any
})).
to
eq
({
})
end
it
'returns correct options for
project_ids'
do
expect
(
subject
.
routing_options
({
project_ids:
project_ids
})).
to
eq
({
routing:
project_routing
})
end
it
'returns empty hash when public projects flag is passed
'
do
expect
(
subject
.
routing_options
({
project_ids:
project_ids
,
public_and_internal_projects:
true
})).
to
eq
({})
end
it
'returns empty hash when provided an empty array
'
do
expect
(
subject
.
routing_options
({
project_ids:
[]
})).
to
eq
({})
end
it
'uses project_ids rather than repository_id when both are supplied'
do
options
=
{
project_ids:
project_ids
,
repository_id:
'wiki_5'
}
it
'returns empty hash when provided :any to project_ids'
do
expect
(
subject
.
routing_options
({
project_ids: :any
})).
to
eq
({})
end
expect
(
subject
.
routing_options
(
options
)).
to
eq
({
routing:
project_routing
})
end
it
'returns empty hash when public projects flag is passed'
do
expect
(
subject
.
routing_options
({
project_ids:
project_ids
,
public_and_internal_projects:
true
})).
to
eq
({})
end
it
'returns empty hash when there are too many project_ids
'
do
max_count
=
included_class
::
ES_ROUTING_MAX_COUNT
it
'uses project_ids rather than repository_id when both are supplied
'
do
options
=
{
project_ids:
project_ids
,
repository_id:
'wiki_5'
}
expect
(
subject
.
routing_options
({
project_ids:
1
.
upto
(
max_count
+
1
).
to_a
})).
to
eq
({})
end
expect
(
subject
.
routing_options
(
options
)).
to
eq
({
routing:
project_routing
})
end
context
'when feature flag is disabled'
do
before
do
stub_feature_flags
(
elasticsearch_use_routing:
false
)
end
it
'returns empty hash for project_ids'
do
expect
(
subject
.
routing_options
({
project_ids:
project_ids
})).
to
eq
({})
end
it
'returns empty hash when there are too many project_ids'
do
max_count
=
included_class
::
ES_ROUTING_MAX_COUNT
it
'returns empty hash for empty options'
do
expect
(
subject
.
routing_options
({})).
to
eq
({})
end
expect
(
subject
.
routing_options
({
project_ids:
1
.
upto
(
max_count
+
1
).
to_a
})).
to
eq
({})
end
end
end
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