Skip to content

Skip share with validation if database is cross-cell

Thong Kuah requested to merge allow_cross_cell_database_config into master

What does this MR do and why?

Skip share with validation if database is cross-cell

  1. This MR introduces the ability to configure a database in config/database.yml as cross_cell: true.
  2. Only certain databases are allowed to be cross_cell: true. This is defined in db/database_connections/. At the moment only main_clusterwide is allowed to be cross_cell.
  3. If a database is cross_cell: true, then we skip the validation related to database_tasks: false and sharing with main.

Why? This allows a second GDK to be configured without having to set GITLAB_VALIDATE_DATABASE_CONFIG=0.

We will follow up in a https://gitlab.com/gitlab-org/gitlab-development-kit MR to set cross_cell: true in ../suppport/cells-add-secondary

main:
  database: gitlabhq_development
  host: this-gdk-host
main_clusterwide:
  database_tasks: false
  database: gitlabhq_development
  host: some-other-gdk-host

/cc @ayufan @DylanGriffith

Related issue: #412280

Screenshots or screen recordings

How to set up and validate locally

  1. Create a new GDK using https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/main/doc/howto/cells.md#install-another-gdk-to-act-as-a-cell
  2. In the new GDK, cd into gitlab. Then run GITLAB_VALIDATE_DATABASE_CONFIG=1 bundle exec rake gitlab:db:validate_config. It should fail as described in #412280
  3. Checkout this branch from the new GDK.
  4. Update config/database.yml, and add cross_cell: true to the main_clusterwide section.
  5. GITLAB_VALIDATE_DATABASE_CONFIG=1 bundle exec rake gitlab:db:validate_config. It should now pass.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Thong Kuah

Merge request reports

Loading