Flush internal_id records on unique violations
What does this MR do and why?
This flushes relevant records from the internal_ids
table when unique id violations are raised during ci pipeline creation. It fixes an issue with possible race conditions when resetting iid tracking after importing projects.
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.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
This is tricky to validate as the error occurs due to a race condition.
One way to check the error is raised and the InternalId
is flushed is to:
- In the rails console, manually added an
InternalId
withusage: "ci_pipelines"
for an imported project that doesn't already have an internal_id - In the UI run a pipeline in the project. It should failed with the error message added in this MR:
- Re-run the pipeline. It should not fail this time.
Related to #352382 (closed)
Edited by Carla Drago