Commit 43cdac95 authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch 'yorick/fix-primary-host-release' into 'master'

Don't release primary connections in the DB LB

See merge request gitlab-org/gitlab!69988
parents 7c77b8ee 95d3ff34
......@@ -163,8 +163,6 @@ module Gitlab
def primary_write_location
load_balancer.primary_write_location
ensure
load_balancer.release_primary_connection
end
def database_replica_location
......
......@@ -16,7 +16,8 @@ module Gitlab
end
def release_connection
@load_balancer.release_primary_connection
# no-op as releasing primary connections isn't needed.
nil
end
def enable_query_cache!
......@@ -51,8 +52,6 @@ module Gitlab
def primary_write_location
@load_balancer.primary_write_location
ensure
@load_balancer.release_primary_connection
end
def database_replica_location
......
......@@ -20,10 +20,8 @@ RSpec.describe Gitlab::Database::LoadBalancing::PrimaryHost do
end
describe '#release_connection' do
it 'releases a connection from the pool' do
expect(load_balancer).to receive(:release_primary_connection)
host.release_connection
it 'does nothing' do
expect(host.release_connection).to be_nil
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