Fully shard cluster_providers_gcp
Summary
The cluster_providers_gcp table currently has desired_sharding_key defined but is missing the sharding_key_issue_url attribute. This issue tracks the work needed to implement the sharding key for this table.
Table Information
-
Table name:
cluster_providers_gcp -
Schema:
gitlab_main_org -
Desired sharding keys:
-
project_id(references projects) -
group_id(references namespaces) -
organization_id(references organizations)
-
-
Backfill strategy: Via parent table
clusters
Implementation Plan
Milestone 18.8 (Required stop)
-
Prepare to shard table -> !216885
- Add
organization_id,namespace_id&&project_idcolumns - Create a trigger that assigns the sharding key
- Index each sharding key column
- Add a foreign key constraint on each sharding key column
- Add a not null (not valid) constraint on the sharding key
- Backfill the sharding key
- Add
- Verify the sharding key backfill completes successfully
- Verify the backfill has assigned a sharding key column to all rows
Milestone 18.9
-
Fully shard table
- Validate column indexes
- Remove any rows that point to a row that no longer exists through the foreign key constraint
- Validate foreign key constraints
- Validate sharding key
-
Update table documentation with
sharding_keyand removedesired_sharding_key
Related
Edited by Tomasz Skorupa