Skip to content

Cells: Iteration 2: Ignore cross-joins, cross-db between `gitlab_main` and `gitlab_main_clusterwide|cell` to allow slowly updating `gitlab_schema` for tables

Problem

As part of the work on #390102 (closed) and !108462 (closed) we need to allow a number of existing cross-joins, create related issues, that we would later schedule to fix them to fulfil User can create group.

Once we change code as below it will trigger number of violations:

  • namespaces to use gitlab_main_cell
  • users to use gitlab_main_clusterwide

The exhaustive list of cross-joins that require describing can be identified by looking at Draft: Cells: Move `users` and `namespaces` in ... (!108462 - closed) for:

  • allow_cross_joins_across_databases - cross-joins that execute between users and namespaces
  • allow_cross_database_modification_within_transaction - cross-DB modification that changes users and namespaces in a single transaction
  • temporary_ignore_tables_in_transaction - cross-DB modification that changes users and namespaces in a single transaction
  • cross_database_ignore_tables - cross-DB modification (very wide) that allows to use subject.save! for records creating users and namespaces

At this stage it is "OK" to mark cross-DB modification and fix them later, as in worst case it affects transaction rollback capabilities in case of failures.

This issue requires describing each of the above, with what SQL query it executes, for what reason and possible solutions.

Edited by Kamil Trzciński