Skip to content

Dynamically read pool sizes for LB configurations

Yorick Peterse requested to merge yorick/lb-fix-pool-size into master

What does this MR do and why?

In various places we update the pool size to use for the database, then reconnect. The global instance of Gitlab::Database::LoadBalancing::Configuration is memoized, and may be read before the pool size is updated. This can result in the pool size being out of date, if database.yml uses a value different from the one GitLab wants.

To work around this, LoadBalancing::Configuration#pool_size now always reads the value from the underlying model. All other LB settings are still persisted in-memory, as we don't support changing these at runtime anyway.

MR acceptance checklist

Quality

  • Quality checklist confirmed

Performance, reliability, and availability

  • Performance, reliability, and availability checklist confirmed

Documentation

  • Documentation checklist confirmed

Security

  • Security checklist confirmed

Deployment

  • Deployment checklist confirmed

Merge request reports

Loading