Commit 9f7e9a6a authored by Stan Hu's avatar Stan Hu

Merge branch '338615-feature-flag-rollout-load_balancing_for_export_workers' into 'master'

Feature flag rollout - load_balancing_for_export_workers

See merge request gitlab-org/gitlab!82321
parents 0f559e55 08421cb6
---
name: load_balancing_for_export_workers
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68153
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/338615
milestone: '14.2'
type: development
group: group::import
default_enabled: false
......@@ -166,8 +166,6 @@ module Gitlab
end
def read_from_replica_if_available(&block)
return yield unless ::Feature.enabled?(:load_balancing_for_export_workers, type: :development, default_enabled: :yaml)
::Gitlab::Database::LoadBalancing::Session.current.use_replicas_for_read_queries(&block)
end
end
......
......@@ -158,26 +158,10 @@ RSpec.describe Gitlab::ImportExport::Json::StreamingSerializer do
end
describe 'load balancing' do
context 'when feature flag load_balancing_for_export_workers is enabled' do
before do
stub_feature_flags(load_balancing_for_export_workers: true)
end
it 'reads from replica' do
expect(Gitlab::Database::LoadBalancing::Session.current).to receive(:use_replicas_for_read_queries).and_call_original
subject.execute
end
end
it 'reads from replica' do
expect(Gitlab::Database::LoadBalancing::Session.current).to receive(:use_replicas_for_read_queries).and_call_original
context 'when feature flag load_balancing_for_export_workers is disabled' do
it 'reads from primary' do
stub_feature_flags(load_balancing_for_export_workers: false)
expect(Gitlab::Database::LoadBalancing::Session.current).not_to receive(:use_replicas_for_read_queries)
subject.execute
end
subject.execute
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