Skip to content

Add and backfill project_id for approvals

What does this MR do and why?

Add and backfill project_id for approvals.

This table has a desired sharding key configured (view configuration).

This merge request is the first step towards transforming the desired sharding key into a sharding key.

This involves the following changes:

  • Adding a new column that will serve as the sharding key (along with the relevant asynchronous index).
  • Populating the sharding key when new records are created by adding a database function and trigger.
  • Scheduling a batched background migration 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 add a foreign key and not null constraint.

How to verify

We have assigned a random backend engineer from groupcode review to review these changes. 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 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 as instructed by Danger.
  2. 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 @manojmj.

This merge request was generated by a once off keep implemented in !143774

This change was generated by gitlab-housekeeper using the Keeps::BackfillDesiredShardingKeyLargeTable 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.

Edited by Ghost User

Merge request reports

Loading