Set sharding keys for deploy_tokens, group_deploy_keys
Sharding keys need to be set for the tables: deploy_tokens, group_deploy_keys
This involves choosing one of the following, based on the intended behaviour of the table:
-
The table is not cell-local
- Set
gitlab_schematogitlab_main_clusterwide.
- Set
-
The table is cell-local and requires a sharding key
- Set
gitlab_schematogitlab_main_cell - Add a
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. - You may also need to set
allow_cross_joins,allow_cross_transactionsandallow_cross_foreign_keysif changing the schema causes pipeline failures. Seedb/docs/epics.ymlfor an example.
- Set
-
The table is cell-local and does not require a sharding key
- Set
gitlab_schematogitlab_main_celland - Set
exempt_from_shardingtotrue.
- Set
Documentation
- Choosing either the gitlab_main_cell or gitlab_main_clusterwide schema
- Defining a sharding key for all cell-local tables
- Defining a desired_sharding_key to automatically backfill a sharding_key
Status
-
group_deploy_keys- !159517 (merged) -
deploy_tokens-
Add and backfill - !160526 (merged) - [-] Remove invalid records - https://gitlab.com/gitlab-org/gitlab/-/issues/474370
- [-] Finalize and add constraint - #477395 (closed)
-
Edited by Tiger Watson