Commit f6b9d3ed authored by Adam Hegyi's avatar Adam Hegyi

Remove maven metadata CTE FF

This change removes the
maven_metadata_by_path_with_optimization_fence feature flag.

Changelog: changed
parent eeef2847
...@@ -161,7 +161,7 @@ class Packages::Package < ApplicationRecord ...@@ -161,7 +161,7 @@ class Packages::Package < ApplicationRecord
after_commit :update_composer_cache, on: :destroy, if: -> { composer? } after_commit :update_composer_cache, on: :destroy, if: -> { composer? }
def self.only_maven_packages_with_path(path, use_cte: false) def self.only_maven_packages_with_path(path, use_cte: false)
if use_cte && Feature.enabled?(:maven_metadata_by_path_with_optimization_fence, default_enabled: :yaml) if use_cte
# This is an optimization fence which assumes that looking up the Metadatum record by path (globally) # This is an optimization fence which assumes that looking up the Metadatum record by path (globally)
# and then filter down the packages (by project or by group and subgroups) will be cheaper than # and then filter down the packages (by project or by group and subgroups) will be cheaper than
# looking up all packages within a project or group and filter them by path. # looking up all packages within a project or group and filter them by path.
......
---
name: maven_metadata_by_path_with_optimization_fence
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/57041
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/325460
milestone: '13.11'
type: development
group: group::optimize
default_enabled: true
...@@ -17,7 +17,6 @@ RSpec.describe ::Packages::Maven::PackageFinder do ...@@ -17,7 +17,6 @@ RSpec.describe ::Packages::Maven::PackageFinder do
group.add_developer(user) group.add_developer(user)
end end
shared_examples 'Packages::Maven::PackageFinder examples' do
describe '#execute!' do describe '#execute!' do
subject { finder.execute! } subject { finder.execute! }
...@@ -97,27 +96,10 @@ RSpec.describe ::Packages::Maven::PackageFinder do ...@@ -97,27 +96,10 @@ RSpec.describe ::Packages::Maven::PackageFinder do
end end
end end
end end
end
context 'when the maven_metadata_by_path_with_optimization_fence feature flag is off' do
before do
stub_feature_flags(maven_metadata_by_path_with_optimization_fence: false)
end
it_behaves_like 'Packages::Maven::PackageFinder examples'
end
context 'when the maven_metadata_by_path_with_optimization_fence feature flag is on' do
before do
stub_feature_flags(maven_metadata_by_path_with_optimization_fence: true)
end
it_behaves_like 'Packages::Maven::PackageFinder examples'
it 'uses CTE in the query' do it 'uses CTE in the query' do
sql = described_class.new(user, group, path: package.maven_metadatum.path).send(:packages).to_sql sql = described_class.new(user, group, path: package.maven_metadatum.path).send(:packages).to_sql
expect(sql).to include('WITH "maven_metadata_by_path" AS') expect(sql).to include('WITH "maven_metadata_by_path" AS')
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