feat: Allow configuration of sec database
What does this merge request do and why?
Initial configuration for decomposing the sectionsec tables into a separate database. This configuration defaults to off and when enabled falls back to the main DB.
Relates to Add distribution configuration for Sec DB (gitlab#466281) in support of the parent epic Sec DB Decomposition Slice 1 - SBOM featureset (&14116)
For gitlab
application config see See feat: Add dedicated schema for sec DB (gitlab!156952 - merged)
How to set up and validate locally
- Checkout the
add-sec-db-schema
branch inside gitlab. - Checkout the
add-sec-db
branch inside GDK. - Run
gdk config set gitlab.rails.databases.sec.enabled true
. - Run
gdk reconfigure
. - Check
gitlab/config/database.yml
- Run
rake db:create db:migrate
- Witness!
Example
Click to expand
❯ gdk config set gitlab.rails.databases.sec.enabled true
❯ gdk reconfigure
❯ grep -A8 'sec:' gitlab/config/database.yml
sec:
adapter: postgresql
encoding: unicode
database: gitlabhq_development
database_tasks: false
host: localhost
port: 5432
pool: 10
gssencmode: disable
--
sec:
adapter: postgresql
encoding: unicode
database: gitlabhq_test
database_tasks: false
host: localhost
port: 5432
pool: 10
gssencmode: disable
❯ gdk config set gitlab.rails.databases.sec.use_main_database true
❯ gdk reconfigure
❯ grep -A8 'sec:' gitlab/config/database.yml
sec:
adapter: postgresql
encoding: unicode
database: gitlabhq_development_sec
host: localhost
port: 5432
pool: 10
gssencmode: disable
prepared_statements: false
--
sec:
adapter: postgresql
encoding: unicode
database: gitlabhq_test_sec
host: localhost
port: 5432
pool: 10
gssencmode: disable
prepared_statements: false
Impacted categories
The following categories relate to this merge request:
-
gdk-reliability - e.g. When a GDK action fails to complete. -
gdk-usability - e.g. Improvements or suggestions around how the GDK functions. -
gdk-performance - e.g. When a GDK action is slow or times out.
Merge request checklist
-
This change is backward compatible. If not, please include steps to communicate to our users. -
Tests added for new functionality. If not, please raise an issue to follow-up. -
Documentation added/updated, if needed. -
Announcement added, if change is notable. -
gdk doctor
test added, if needed. -
Add the ~highlight
label if this MR should be included in theCHANGELOG.md
.
Edited by Lucas Charles