Skip to content

Mark tables as exempt from sharding

What does this MR do and why?

Mark the following tables as exempt from sharding.

  • ci_job_artifact_states
  • ci_secure_file_states
  • dependency_proxy_blob_states
  • dependency_proxy_manifest_states
  • group_wiki_repositories
  • group_wiki_repository_states
  • lfs_objects
  • lfs_object_states
  • merge_request_diff_details
  • pages_deployment_states
  • pool_repositories
  • project_repositories
  • project_states
  • snippet_repositories
  • snippet_repository_states
  • upload_states

For these tables, this MR does the following:

  1. In db/docs/, change the schema to gitlab_main_cell_local or gitlab_ci_cell_local for these tables.
  2. In db/docs/, remove exempt_from_sharding: true since it is implied by the schema.
  3. In db/docs/, remove sharding_key: or desired_sharding_key: attributes from these tables.
  4. In db/docs/, add sharding_key_issue_url for these tables which don't have a non-nullable organization_id, namespace_id, or project_id with loose foreign key constraint.
    • Exception: Do not attempt to add these columns to lfs_object_states. LFS storage must be rearchitected, or specially handled by Cells and Org Mover, or both.

References

Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.

MR acceptance checklist

Please 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 Douglas Barbosa Alexandre

Merge request reports

Loading