Add deprecation for single DB connnection
Deprecate single DB connection
-
Add deprecation notice, follow https://docs.gitlab.com/ee/development/deprecation_guidelines/index.html
Previously, the config/database.yml looked like this. It only has main: section:
production:
main:
adapter: postgresql
encoding: unicode
database: gitlabhq_production
...
With two database connections configured, the config/database.yml should look like:
production:
main:
adapter: postgresql
encoding: unicode
database: gitlabhq_production
...
ci:
adapter: postgresql
encoding: unicode
database: gitlabhq_production # Ensure this is the same as main's database field
database_tasks: false # Ensure this is false
...
How to switch to two connections
Omnibus
-
In
/etc/gitlab/gitlab.rb, add the following line:gitlab_rails['databases']['ci']['enable'] = true -
Run
gitlab-ctlreconfigure -
Run
gitlab-rake gitlab:db:validate_configto check the config is correct. You can also check the contents ofconfig/database.ymlto verify it has two connections configured (see above).
Charts
- Configure
global.psql.ci.enabletotrue - In the
toolboxpod, rungitlab-rake gitlab:db:validate_configto check the config is correct. You can also check the contents ofconfig/database.ymlto verify it has two connections configured (see above).
From source
Edit config/database.yml to add the ci: section. You can copy most fields from main, except for database_tasks which should be set to false
Edited by Thong Kuah