Fully shard todos
Todos (# rows: https://postgres.ai/console/gitlab/gitlab-production-main/sessions/42475/commands/130022)
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_idcolumn -> !204713 (merged)- add column
organization_id - prepare async index on
organization_id
- add column
-
verify the index on organization_idhas 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_idovergroup_idwhen both are set - modify the rails model to set
organization_idwhenprojectandgrouparenil(i.eparentless?) - set
NOT NULL (NOT VALID)on sharding key
- add concurrent index on
-
verify the foreign key constraint (NOT VALID)onorganization_idhas 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 -
verify sharding key backfills completed successfully -
verify 0 rows where sharding key columns are num_nonnulls( organization_id, project_id, group_id ) != 1-> https://postgres.ai/console/gitlab/gitlab-production-main/sessions/44711/commands/137256
Milestone 18.6
-
Prepare to fully shard table -> !209494 (merged) - validate foreign key constraint (SYNC)
- finalize sharding key backfill
- prepare ASYNC constraint check on
NOT NULLsharding key
-
Verify the NOT NULL (NOT VALID) -> NOT NULLconstraint has changed on the sharding key on .com -
Fully shard table -> !211275 (merged) - SYNC validate
NOT NULLconstraint on sharding key - update
db/docs/*.ymlwith sharding key
- SYNC validate
-
verify the NOT NULLconstraint check is set on the table's sharding key
Edited by Tomasz Skorupa