Create draft MRs for tables that where previously gitlab_main_clusterwide
Task
-
Generate draft MRs with the following description:
Variables
- GROUP
- TABLE_LIST
Add sharding key tracking issues for feature category GROUP
Background
Tables require manual classification. All tables need correct classification; creating tracking issues acceptable for complex cases.
Random backend engineer from ~"group::GROUP" assigned as DRI with engineering manager visibility. Minimal time commitment required.
Assign to database reviewer/maintainer when finished. Contact #f_cells_and_organizations for questions.
Task
For each table, select one option:
Option 1: Add sharding key tracking issue
For tables with unknown sharding behavior or requiring additional work.
Replace TODO with issue link:
- sharding_key_issue_url: TODO
+ sharding_key_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/1234
Multiple entries can reference same issue. Issues tracked on progress dashboard.
New Issue Template
Title: Set sharding keys for tables in 'group::GROUP'
Description:
Sharding keys required for tables: TABLE_LIST
Select based on table behavior:
Org-level with sharding key:
- Set
gitlab_schema: gitlab_main_cell - Add
sharding_keyordesired_sharding_keyconfiguration. If the configuration is known but the chosen key doesn't yet meet not-null and foreign key requirements, you can add an exception toallowed_to_be_missing_not_nullorallowed_to_be_missing_foreign_keyto get the pipeline passing. Please link to a follow-up issue in a code comment next to the exception. - See
db/docs/epics.ymlfor an example.
Cell-local (cell-specific features):
- Set
gitlab_schema: gitlab_main_cell_local - No foreign key references to/from organization tables
User-related:
- Set
gitlab_schema: gitlab_main_user - Must strictly belong to user
Cell settings:
- Set
gitlab_schema: gitlab_main_cell_setting - No foreign key references to/from organization tables
Note: gitlab_main_clusterwide has been deprecated. Consult Tenant Scale group for alternatives.
Documentation
Option 2: Add sharding key configuration
For tables with easily identifiable sharding keys requiring minimal work.
Remove sharding_key_issue_url and complete classification:
Org-level with sharding key:
- Set
gitlab_schema: gitlab_main_cell - Add
sharding_keyordesired_sharding_keyconfiguration. If the configuration is known but the chosen key doesn't yet meet not-null and foreign key requirements, you can add an exception toallowed_to_be_missing_not_nullorallowed_to_be_missing_foreign_keyto get the pipeline passing. Please link to a follow-up issue in a code comment next to the exception. - See
db/docs/epics.ymlfor an example.
Cell-local (cell-specific features):
- Set
gitlab_schema: gitlab_main_cell_local - No foreign key references to/from organization tables
User-related:
- Set
gitlab_schema: gitlab_main_user - Must strictly belong to user
Cell settings:
- Set
gitlab_schema: gitlab_main_cell_setting - No foreign key references to/from organization tables
Note: gitlab_main_clusterwide has been deprecated. Consult Tenant Scale group for alternatives.
Documentation
Add to epic &11670
Related to #548458 (closed)
Feedback: #548458 (closed)