Commit 6ddc8316 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Ignore writes associated with runner heartbeat

This commit makes it possible to keep using database replicas even when
a write related to a runner heartbeat happened.
parent abf77bd5
......@@ -17,6 +17,17 @@ module EE
super
end
def heartbeat(values)
return super unless ::Feature.enabled?(:ci_runner_builds_queue_on_replicas, self, default_enabled: :yaml)
##
# We can safely ignore writes performed by a runner heartbeat. We do
# not want to upgrade database connection proxy to use the primary
# database after heartbeat write happens.
#
::Gitlab::Database::LoadBalancing::Session.without_sticky_writes { super }
end
def minutes_cost_factor(access_level)
return 0.0 unless instance_type?
......
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