Commit 5ea31b5a authored by Dmytro Zaporozhets's avatar Dmytro Zaporozhets

Merge branch '196838-remove-routing-ff' into 'master'

Remove elasticsearch_use_routing feature flag

See merge request gitlab-org/gitlab!27398
parents f600c3e7 ceab1698
---
title: Improve Advanced global search performance by using routing
merge_request: 27398
author:
type: performance
...@@ -8,7 +8,6 @@ module Elastic ...@@ -8,7 +8,6 @@ module Elastic
ES_ROUTING_MAX_COUNT = 128 ES_ROUTING_MAX_COUNT = 128
def routing_options(options) def routing_options(options)
return {} if Feature.disabled?(:elasticsearch_use_routing)
return {} if options[:public_and_internal_projects] return {} if options[:public_and_internal_projects]
ids = if options[:project_id] ids = if options[:project_id]
......
...@@ -27,13 +27,6 @@ describe Elastic::Latest::Routing do ...@@ -27,13 +27,6 @@ describe Elastic::Latest::Routing do
end end
describe '#routing_options' do 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 it 'returns correct options for project_id' do
expect(subject.routing_options({ project_id: 1 })).to eq({ routing: 'project_1' }) expect(subject.routing_options({ project_id: 1 })).to eq({ routing: 'project_1' })
end end
...@@ -70,19 +63,4 @@ describe Elastic::Latest::Routing do ...@@ -70,19 +63,4 @@ describe Elastic::Latest::Routing do
expect(subject.routing_options({ project_ids: 1.upto(max_count + 1).to_a })).to eq({}) expect(subject.routing_options({ project_ids: 1.upto(max_count + 1).to_a })).to eq({})
end end
end 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 for empty options' do
expect(subject.routing_options({})).to eq({})
end
end
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment