Use lazy init to correctly populate db list
What does this MR do and why?
Update Gitlab::Database.databases
to explicitly reference base models that can manage their own database connections. This prevents issues where the database list didn't contain secondary database connections, because their models were not loaded prior to the initialization of the list.
How to set up and validate locally
- Update configuration to use multiple databases
- In rails console, run
Gitlab::Database.databases
- Verify the returned hash has an entry for both
:main
and:ci
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Patrick Bair