Skip to content
代码片段 群组 项目
用户头像
Shubham Kumar 编辑于
## What does this MR do and why?

Add and backfill multiple sharding keys for bulk_import_export_uploads.

This table has a
[desired sharding key](https://docs.gitlab.com/ee/development/database/multiple_databases.html#define-a-desired_sharding_key-to-automatically-backfill-a-sharding_key)
configured ([view configuration](https://gitlab.com/gitlab-org/gitlab/-/blob/master/db/docs/bulk_import_export_uploads.yml)).

This merge request is the first step towards transforming the desired sharding key into a
[sharding key](https://docs.gitlab.com/ee/development/database/multiple_databases.html#defining-a-sharding-key-for-all-cell-local-tables).

This involves three changes:

- Adding a new column that will serve as the sharding key (along with the relevant index and foreign key).
- Populating the sharding key when new records are created by adding a database function and trigger.
- Scheduling a [batched background migration](https://docs.gitlab.com/ee/development/database/batched_background_migrations.html)
  to set the sharding key for existing records.

Once the background migration has completed, a second merge request will be created to finalize the background
migration and validate the not null constraint.

## How to verify

Please review this merge
request from a ~backend perspective. The main thing we are looking to verify is that the added column and association
match the values specified by the [desired sharding key](https://gitlab.com/gitlab-org/gitlab/-/blob/master/db/docs/bulk_import_export_uploads.yml)
configuration and that backfilling the column from this other table makes sense in the context of this feature.

When you are finished, please:

1. Trigger the [database testing pipeline](https://docs.gitlab.com/ee/development/database/database_migration_pipeline.html)
   as instructed by Danger.
1. Request a review from the ~backend maintainer and ~database reviewer suggested by Danger.

If you have any questions or concerns, reach out to `@tigerwnz` or @shubhamkrai.

This merge request was generated by a once off keep implemented in
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/143774

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

To provide feedback on your experience with `gitlab-housekeeper` please create an issue with the
label ~"GitLab Housekeeper" and consider pinging the author of this keep.

Changelog: other
f38e81ed
历史
用户头像 f38e81ed
代码所有者
将用户和群组指定为特定文件更改的核准人。 了解更多。
名称 最后提交 最后更新
..
20211202041233
20230721095222
20230721095223
20230924134300
20230926092914
20230926092944
20230926093004
20230926093025
20230926093101
20230926093144
20230926093211
20230926093251
20230926105440
20230926105931
20230927124202
20230928145555
20230928145637
20230929155123
20231002162941
20231003045342
20231005151816
20231009115713
20231013204933
20231016001000
20231016173128
20231016173129
20231016194926
20231016194927
20231016194942
20231016194943
20231017095738
20231017134349
20231017135207
20231017154804
20231017181403
20231018083247
20231018093625
20231018105749
20231018140154
20231018152419
20231019003052
20231019084731
20231019104211
20231019122855
20231019145202
20231019180421
20231019223224
20231020020732
20231020074227
20231020082425
20231020095624
20231020112541
20231020150211
20231020181652
20231023073841
20231023083349
20231023113908
20231023114006
20231023114551
20231023121955
20231023122508
20231023164908
20231024015915
20231024025457
20231024025533
20231024025629
20231024073401
20231024080150
20231024123444
20231024124856
20231024125551
20231024133234
20231024142236
20231024143457
20231024151916
20231024173744
20231024212214
20231025025733
20231025031337
20231025031539
20231025123238
20231025191217
20231026050554
20231026103346
20231026172345
20231026175042
20231027013210
20231027052949
20231027060443
20231027064352
20231027065205
20231027083355
20231027093009
20231029134824
20231029142649
20231030051837
20231030051838
20231030051839
20231030051840
20231030071209