Validate NOT NULL on packages_build_infos sharding key
What does this MR do and why?
Validate the NOT NULL constraint on packages_build_infos sharding key which was added asynchronously.
This table has a desired sharding key configured (view configuration).
This merge request is the last step towards transforming the desired sharding key into a sharding key.
This involves the following changes:
- Synchrounously validating the foreign key and not null constraints that were validated asynchronously in the
previous merge request.
- Async validation verified to be completed in postgres.ai (internal).
- Setting
project_idassharding_keyofpackages_build_infos.
Note: We do not add presence: true check because we're relying on "BEFORE INSERT OR UPDATE" trigger to populate
the column from its parent table. We have no defined plan yet for the removal of these triggers but we will ensure
that application code is writing the value first removing them.
pipeline:skip-check-migrations is applied because rolling this back is meant to be a no-op and we currently have a bug in the pipeline
References
- Organization Isolation and Sharding Keys: https://handbook.gitlab.com/handbook/engineering/architecture/design-documents/organization/isolation/
- Sharding Key (Cells) Development Guide: https://docs.gitlab.com/ee/development/cells/#defining-a-sharding-key-for-all-cell-local-tables
- Related to #493768 (closed)
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.
Screenshots or screen recordings
N/A
How to verify
The main thing we are looking to verify is that the async validation has completed by running d+ packages_build_infos in postgres.ai and that the constraint matches the column specified by the desired sharding key
configuration.
This change was generated by gitlab-housekeeper using the Keeps::ValidateNotNullConstraintShardingKey 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.