Create new index for removing artifacts with unknown locked status
What does this MR do and why?
This MR adds a new index for use by our Ci::JobArtifacts::UpdateUnknownLockedStatusService
The rationale and index design is laid out in our tracking issue.
Output of Migrations
From the db:check-migrations job
$ scripts/db_tasks db:migrate
== 20220510192117 IndexExpirableUnknownArtifactsForRemoval: migrating =========
-- index_exists?("ci_job_artifacts", [:expire_at, :job_id], {:name=>"tmp_index_ci_job_artifacts_on_expire_at_where_locked_unknown", :where=>"locked = 2 AND expire_at IS NOT NULL", :algorithm=>:concurrently})
-> 0.0138s
-- add_index_options("ci_job_artifacts", [:expire_at, :job_id], {:name=>"tmp_index_ci_job_artifacts_on_expire_at_where_locked_unknown", :where=>"locked = 2 AND expire_at IS NOT NULL", :algorithm=>:concurrently})
-> 0.0005s
== 20220510192117 IndexExpirableUnknownArtifactsForRemoval: migrated (0.0663s)
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by drew stachon