Reschedule pending RecalculateVulnerabilitiesOccurrencesUuid jobs
Why are we doing this work?
With !68200 (merged) we rescheduled UUID recalculation background migrations due to a bug which got fixed in !67578 (merged).
According to our background_migration_jobs
table we still 1700 jobs that are pending.
Query results from gprd-db-archive-console
gitlabhq_production=> SELECT COUNT(*) FROM background_migration_jobs WHERE class_name = 'RecalculateVulnerabilitiesOccurrencesUuid' AND status = 0;
count
-------
1700
(1 row)
We tried to investigate the failure but Kibana had no logs for the job in that period. We also investigated to see if there are any exceptions in Sentry but also failed to find anything.
There are 895 records that still have UUIDv4 which is another pain point for us.
Query results from gprd-db-archive-console
gitlabhq_production=> SELECT COUNT(*) FROM vulnerability_occurrences WHERE uuid ~* '^[0-9A-F]{8}-[0-9A-F]{4}-[4][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$'; count
-------
895
In addition there are some old records for the UUID recalculation so we need to drop them before rescheduling.
Implementation plan
Edited by Michał Zając