Commit a39857d1 authored by Adam Hegyi's avatar Adam Hegyi

Remove optimized_elasticsearch_indexes_project FF

This change removes the optimized_elasticsearch_indexes_project feature
flag.
parent f0550cb6
...@@ -136,10 +136,10 @@ module EE ...@@ -136,10 +136,10 @@ module EE
return false unless elasticsearch_indexing? return false unless elasticsearch_indexing?
return true unless elasticsearch_limit_indexing? return true unless elasticsearch_limit_indexing?
return optimized_elasticsearch_indexes_project?(project) unless ::Feature.enabled?(:elasticsearch_indexes_project_cache, default_enabled: true) return elasticsearch_limited_project_exists?(project) unless ::Feature.enabled?(:elasticsearch_indexes_project_cache, default_enabled: true)
::Gitlab::Elastic::ElasticsearchEnabledCache.fetch(:project, project.id) do ::Gitlab::Elastic::ElasticsearchEnabledCache.fetch(:project, project.id) do
optimized_elasticsearch_indexes_project?(project) elasticsearch_limited_project_exists?(project)
end end
end end
...@@ -298,8 +298,7 @@ module EE ...@@ -298,8 +298,7 @@ module EE
private private
def optimized_elasticsearch_indexes_project?(project) def elasticsearch_limited_project_exists?(project)
if ::Feature.enabled?(:optimized_elasticsearch_indexes_project, default_enabled: true)
indexed_namespaces = ::Gitlab::ObjectHierarchy indexed_namespaces = ::Gitlab::ObjectHierarchy
.new(::Namespace.where(id: project.namespace_id)) .new(::Namespace.where(id: project.namespace_id))
.base_and_ancestors .base_and_ancestors
...@@ -312,10 +311,6 @@ module EE ...@@ -312,10 +311,6 @@ module EE
.from("(SELECT) as projects") # SELECT from "nothing" since the EXISTS queries have all the conditions. .from("(SELECT) as projects") # SELECT from "nothing" since the EXISTS queries have all the conditions.
.merge(indexed_namespaces.or(indexed_projects)) .merge(indexed_namespaces.or(indexed_projects))
.exists? .exists?
else
# old behavior
elasticsearch_limited_projects.exists?(project.id)
end
end end
def resume_elasticsearch_indexing def resume_elasticsearch_indexing
......
---
title: Remove optimized_elasticsearch_indexes_project feature flag
merge_request: 33965
author:
type: other
...@@ -306,7 +306,6 @@ RSpec.describe ApplicationSetting do ...@@ -306,7 +306,6 @@ RSpec.describe ApplicationSetting do
end end
describe '#elasticsearch_indexes_project?' do describe '#elasticsearch_indexes_project?' do
shared_examples 'examples for #elasticsearch_indexes_project?' do
context 'when project is in a subgroup' do context 'when project is in a subgroup' do
let(:root_group) { create(:group) } let(:root_group) { create(:group) }
let(:subgroup) { create(:group, parent: root_group) } let(:subgroup) { create(:group, parent: root_group) }
...@@ -334,23 +333,6 @@ RSpec.describe ApplicationSetting do ...@@ -334,23 +333,6 @@ RSpec.describe ApplicationSetting do
end end
end end
end end
context 'when optimized_elasticsearch_indexes_project feature flag is on' do
before do
stub_feature_flags(optimized_elasticsearch_indexes_project: true)
end
include_examples 'examples for #elasticsearch_indexes_project?'
end
context 'when optimized_elasticsearch_indexes_project feature flag is off' do
before do
stub_feature_flags(optimized_elasticsearch_indexes_project: false)
end
include_examples 'examples for #elasticsearch_indexes_project?'
end
end
end end
context 'projects' do context 'projects' do
......
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