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?
- Changelog entry added, if necessary
- Added for this feature/bug
- Conform by the merge request performance guides
- Conform by the style guides
- Squashed related commits together