Commit ca99d02e authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch 'fix-session-current-use-primary-gdk-error' into 'master'

Fix undefined method `use_primary!' error in GDK

See merge request gitlab-org/gitlab!72247
parents 22454d66 5c363893
...@@ -74,7 +74,7 @@ module Gitlab ...@@ -74,7 +74,7 @@ module Gitlab
def unstick_or_continue_sticking(namespace, id) def unstick_or_continue_sticking(namespace, id)
return if all_caught_up?(namespace, id) return if all_caught_up?(namespace, id)
Session.current.use_primary! ::Gitlab::Database::LoadBalancing::Session.current.use_primary!
end end
# Select a replica that has caught up with the primary. If one has not been # Select a replica that has caught up with the primary. If one has not been
...@@ -83,14 +83,14 @@ module Gitlab ...@@ -83,14 +83,14 @@ module Gitlab
replica_selected = replica_selected =
select_caught_up_replicas(namespace, id) select_caught_up_replicas(namespace, id)
Session.current.use_primary! unless replica_selected ::Gitlab::Database::LoadBalancing::Session.current.use_primary! unless replica_selected
end end
# Starts sticking to the primary for the given namespace and id, using # Starts sticking to the primary for the given namespace and id, using
# the latest WAL pointer from the primary. # the latest WAL pointer from the primary.
def stick(namespace, id) def stick(namespace, id)
mark_primary_write_location(namespace, id) mark_primary_write_location(namespace, id)
Session.current.use_primary! ::Gitlab::Database::LoadBalancing::Session.current.use_primary!
end end
def bulk_stick(namespace, ids) def bulk_stick(namespace, ids)
...@@ -100,7 +100,7 @@ module Gitlab ...@@ -100,7 +100,7 @@ module Gitlab
end end
end end
Session.current.use_primary! ::Gitlab::Database::LoadBalancing::Session.current.use_primary!
end end
def with_primary_write_location def with_primary_write_location
......
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