Skip to content

Hijack ActiveRecord::Base.connection in the DB load balancer

What does this MR do?

This updates the DB load balancing code so we ensure that all queries, even those using ActiveRecord::Base.connection directly, go through the load balancer.

Are there points in the code the reviewer needs to double check?

Why was this MR needed?

Rails internals use ActiveRecord::Base.connection directly in various places. This means that the primary going down can lead to application errors.

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

https://gitlab.com/gitlab-org/gitlab-ee/issues/3191

Merge request reports