Validate NOT NULL on merge_request_blocks sharding key
What does this MR do and why?
Validate the NOT NULL constraint for the sharding key on merge_request_blocks
- Async validation is verified to be complete on postgres.ai via
\d+ merge_request_blocks(no shareable link) - No
presence: truevalidation on the model because the column is also populated with a "BEFORE INSERT OR UPDATE" trigger.- Trigger: https://gitlab.com/gitlab-org/gitlab/blob/f4d36df20b63a03ad05013e18f553ba9846c8467/db/structure.sql#L1499-L1513
- We have no well-defined plan yet on the removal of triggers but we will make sure that the application code is setting a the value on the column BEFORE removing the trigger.
- Applied pipeline:skip-check-migrations as reverting this migration is intended to be #no-op. Rolling back wouldn't restore structure.sql to its previous state.
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 set up and validate locally
N/A
Edited by Shane Maglangit