Skip to content
Snippets Groups Projects
Commit 464b55c5 authored by Manoj M J's avatar Manoj M J :speech_balloon:
Browse files

Add desired sharding keys for service_desk

Add desired sharding keys for feature category `service_desk`.

These tables have been identified as a [cell local tables](https://docs.gitlab.com/ee/development/database/multiple_databases.html#guidelines-on-choosing-between-gitlab_main_cell-and-gitlab_main_clusterwide-schema).
All cell local tables require a [sharding key](https://docs.gitlab.com/ee/development/database/multiple_databases.html#defining-a-sharding-key-for-all-cell-local-tables)
or a [desired sharding key](https://docs.gitlab.com/ee/development/database/multiple_databases.html#defining-a-desired_sharding_key-for-automatically-backfilling-a-sharding_key)

A desired sharding key has been automatically selected for these tables.
These keys were chosen as the desired sharding keys because the
table has a :belongs_to relationship to a table that itself has a `NOT NULL` sharding key.

Additionally, `gitlab_schema` has been set to `gitlab_main_cell` for any tables didn't use this schema already.
For these tables we have also added `allow_cross_joins`, `allow_cross_transactions` and
`allow_cross_foreign_keys`. These will silence any existing violations, allowing the pipeline to pass without
requiring further changes. In the future, we'll remove these `allow_...` statements and fix any violations as
they arise. You can read more about this in the [documentation for multiple databases](https://docs.gitlab.com/ee/development/database/multiple_databases.html)

Reviewer, please confirm that:

- each of these tables can be classified as cell local
- the selected desired sharding key is appropriate
- the backfill configuration for the desired sharding key is correct

When you are finished, please request a review from the database maintainer suggested by Danger.
If you have any questions or concerns, reach out to @tigerwnz or @manojmj.

If you would like to go through similar merged MRs so as to gather an understanding on this topic, you
can use [this](https://gitlab.com/gitlab-org/gitlab/-/merge_requests?scope=all&state=merged&label_name[]=automation%3Agitlab-housekeeper-authored) link.

This change was generated by
[gitlab-housekeeper](https://gitlab.com/gitlab-org/gitlab/-/tree/master/gems/gitlab-housekeeper)
using the Keeps::DetermineDesiredShardingKeyFeatureCategory keep.

To provide feedback on your experience with `gitlab-housekeeper` please comment in
<#442003>.

Changelog: other
parent faf5c109
No related branches found
No related tags found
1 merge request!148041Add desired sharding keys for service_desk
......@@ -7,4 +7,19 @@ feature_categories:
description: Holds Customer Relations (CRM) Contacts
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/71007
milestone: '14.4'
gitlab_schema: gitlab_main
gitlab_schema: gitlab_main_cell
allow_cross_joins:
- gitlab_main_clusterwide
allow_cross_transactions:
- gitlab_main_clusterwide
allow_cross_foreign_keys:
- gitlab_main_clusterwide
desired_sharding_key:
namespace_id:
references: namespaces
backfill_via:
parent:
foreign_key: issue_id
table: issues
sharding_key: namespace_id
belongs_to: issue
......@@ -7,4 +7,19 @@ feature_categories:
description: Email addresses for non-GitLab users added to issues as participants
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/42943
milestone: '13.5'
gitlab_schema: gitlab_main
gitlab_schema: gitlab_main_cell
allow_cross_joins:
- gitlab_main_clusterwide
allow_cross_transactions:
- gitlab_main_clusterwide
allow_cross_foreign_keys:
- gitlab_main_clusterwide
desired_sharding_key:
namespace_id:
references: namespaces
backfill_via:
parent:
foreign_key: issue_id
table: issues
sharding_key: namespace_id
belongs_to: issue
......@@ -5,7 +5,23 @@ classes:
feature_categories:
- service_desk
- team_planning
description: The Message-ID of the original email that resulted in the creation of an issue
description: The Message-ID of the original email that resulted in the creation of
an issue
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/71749
milestone: '14.6'
gitlab_schema: gitlab_main
gitlab_schema: gitlab_main_cell
allow_cross_joins:
- gitlab_main_clusterwide
allow_cross_transactions:
- gitlab_main_clusterwide
allow_cross_foreign_keys:
- gitlab_main_clusterwide
desired_sharding_key:
namespace_id:
references: namespaces
backfill_via:
parent:
foreign_key: issue_id
table: issues
sharding_key: namespace_id
belongs_to: issue
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment