Skip to content
代码片段 群组 项目
未验证 提交 fe492cd4 编辑于 作者: Tiger Watson's avatar Tiger Watson 提交者: GitLab
浏览文件

Add sharding keys for continuous_delivery

Add sharding keys for feature category `continuous_delivery`.

These tables have been identified as
[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).

A sharding key has been automatically selected for these tables. The sharding key was chosen because it is a
`NOT NULL` column referencing either `projects` or `namespaces`.

Additionally, `gitlab_schema` has been set to `gitlab_main_cell` for any tables that 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).

We have assigned a random backend engineer from ~"group::environments" to review these changes.
Please confirm that each table should indeed be cell local, and that the selected column is an appropriate
sharding key. 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 @DylanGriffith.

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::DetermineShardingKeyFeatureCategory keep.

To provide feedback on your experience with `gitlab-housekeeper` please comment in
<https://gitlab.com/gitlab-org/gitlab/-/issues/442003>.

Changelog: other
上级 28b676ab
No related branches found
No related tags found
无相关合并请求
......@@ -4,9 +4,32 @@ classes:
- ProtectedEnvironments::ApprovalRule
feature_categories:
- continuous_delivery
description: >-
A rule associated to a protected environment that allows a user, group, or role to approve a deployment.
See https://docs.gitlab.com/ee/ci/environments/deployment_approvals.html#multiple-approval-rules for more details.
description: A rule associated to a protected environment that allows a user, group,
or role to approve a deployment. See https://docs.gitlab.com/ee/ci/environments/deployment_approvals.html#multiple-approval-rules
for more details.
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/82800
milestone: '14.10'
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:
project_id:
references: projects
backfill_via:
parent:
foreign_key: protected_environment_id
table: protected_environments
sharding_key: project_id
belongs_to: protected_environment
group_id:
references: namespaces
backfill_via:
parent:
foreign_key: protected_environment_id
table: protected_environments
sharding_key: group_id
belongs_to: protected_environment
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册