Fully shard cluster_providers_aws

Summary

The cluster_providers_aws 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_aws
  • 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:
    • Add organization_id, namespace_id && project_id columns
    • 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
  • 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_key and remove desired_sharding_key
Edited by 🤖 GitLab Bot 🤖