Prepare clusters_kubernetes_namespaces for sharding
What does this MR do and why?
Prepare clusters_kubernetes_namespaces for sharding:
- add
organization_id,group_id, andsharding_project_idcolumns - create a trigger that assigns the sharding keys from the associated cluster (copies
organization_id,group_id, andproject_idfrom theclusterstable) - create indexes on each sharding key column (
organization_id,group_id,sharding_project_id) - add foreign key constraints on
organization_id(toorganizations),group_id(tonamespaces), andsharding_project_id(toprojects) - add a multi-column not null constraint (not valid) ensuring exactly one sharding key is set
- queue a batched background migration to backfill the sharding key columns from the associated cluster
Addresses #584433
Changelog: other
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Tomasz Skorupa