Fully shard todos
https://postgres.ai/console/gitlab/gitlab-production-main/sessions/42475/commands/130022)
Todos (# rows:Milestone 18.5 (required stop)
-
identify the source of num_nonnulls( project_id, group_id ) > 1
-> https://postgres.ai/console/gitlab/gitlab-production-main/sessions/42475/commands/130020 -
identify the source of num_nonnulls( project_id, group_id ) < 1
-> https://postgres.ai/console/gitlab/gitlab-production-main/sessions/43299/commands/132277 -
Add organization_id
column -> !204713 (merged)- add column
organization_id
- prepare async index on
organization_id
- add column
-
verify the index on organization_id
has been created on gitlab.com -
Set sharding key column -> !204559 (merged) - add concurrent index on
organization_id
- add concurrent foreign key constraint
(NOT VALID)
onorganization_id
- backfill rows that contain
num_nonnulls( project_id, group_id, organization_id ) > 1
- backfill rows that contain
num_nonnulls( project_id, group_id, organization_id ) < 1
- modify the rails model to prefer
project_id
overgroup_id
when both are set - modify the rails model to set
organization_id
whenproject
andgroup
arenil
(i.eparentless?
) - set
NOT NULL (NOT VALID)
on sharding key
- add concurrent index on
-
verify the foreign key constraint (NOT VALID)
onorganization_id
has been created on gitlab.com -
validate foreign key constraint (ASYNC) -> !208310 (merged) -
verify the foreign key constraint is present on the table's sharding key column -
validate foreign key constraint (SYNC) -
verify sharding key backfills completed successfully -
verify 0 rows where sharding key columns are num_nonnulls( organization_id, project_id, group_id ) != 1
Milestone 18.6
-
finalize sharding key backfill -> -
set NOT NULL
constraint on sharding key -> -
verify the NOT NULL
constraint is applied on the table's sharding key for gitlab.com
Edited by Tomasz Skorupa