diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 09:08:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 09:08:42 +0000 |
commit | b76ae638462ab0f673e5915986070518dd3f9ad3 (patch) | |
tree | bdab0533383b52873be0ec0eb4d3c66598ff8b91 /lib/gitlab/database/load_balancing/sticking.rb | |
parent | 434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff) | |
download | gitlab-ce-b76ae638462ab0f673e5915986070518dd3f9ad3.tar.gz |
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'lib/gitlab/database/load_balancing/sticking.rb')
-rw-r--r-- | lib/gitlab/database/load_balancing/sticking.rb | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/gitlab/database/load_balancing/sticking.rb b/lib/gitlab/database/load_balancing/sticking.rb index 8e1aa079216..20d42b9a694 100644 --- a/lib/gitlab/database/load_balancing/sticking.rb +++ b/lib/gitlab/database/load_balancing/sticking.rb @@ -53,14 +53,8 @@ module Gitlab # write location. If no such location exists, err on the side of caution. return false unless location - if ::Feature.enabled?(:load_balancing_refine_load_balancer_methods) - load_balancer.select_up_to_date_host(location).tap do |selected| - unstick(namespace, id) if selected - end - else - load_balancer.select_caught_up_hosts(location).tap do |selected| - unstick(namespace, id) if selected - end + load_balancer.select_up_to_date_host(location).tap do |selected| + unstick(namespace, id) if selected end end @@ -109,7 +103,7 @@ module Gitlab if LoadBalancing.enable? load_balancer.primary_write_location else - Gitlab::Database.get_write_location(ActiveRecord::Base.connection) + Gitlab::Database.main.get_write_location(ActiveRecord::Base.connection) end return if location.blank? |