Clean up and revalidate web_hook_logs_daily sharding key
What does this MR do and why?
Clean up and revalidate the web_hook_logs_daily sharding key constraint (check_19dc80d658).
ValidateWebHookLogsDailyShardingKeyConstraint (19.0) was turned into a no-op in !244166 (merged) because orphan web_hook_logs_daily rows whose sharding keys are all NULL could still violate check_19dc80d658, leaving the constraint NOT VALID on affected self-managed instances.
This MR removes those orphan rows in batches, then validates the constraint. The delete is a data migration restricted to gitlab_main_org; validating the constraint is DDL, so the two steps are separate migrations. Both skip GitLab.com, which validated the constraint long ago and has no orphan rows.
Related work
- Offending behavior / tracking issue: #603303
- Preceding fix that neutralized the problematic 19.0 validation migration (made it a no-op, leaving the constraint
NOT VALID): !244166 (merged)- Backport to 19.2: !245679 (merged)
- Backport to 19.1: !245680 (merged)
- Backport to 19.0: !245682 (merged)
- This MR completes the fix on
master(19.3) by cleaning up the orphan rows and re-validating the constraint.
Changelog: fixed
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.