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