Skip to content

Migrate to Rails 6.1 connection handling

Thong Kuah requested to merge legacy_connection_handling_false into master

What does this MR do?

Use new Rails 6.1 connection handling. This is in preparation for decomposition epic where we will make GitLab use multiple databases.

This should be a fairly safe setting to change as we don't currently use any multi-database methods from Rails, such as while_preventing_writes, preventing_writes, connected_to, connected_to_many, connecting_to, with_role_and_shard, connection_handlers, connection_handlers=, current_role.

However, this changes a behaviour inside Rails' establish_connection method (it switches from using LegacyPoolManager to PoolManager). This change should be safe and result in no-change but because Rails itself, and the GitLab database load balancer use this exact method on application initialization, we use an environment variable to control when this new connection handling gets introduced to production.

Related issue: #332451 (closed), #332288 (closed)

Screenshots (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Thong Kuah

Merge request reports