Schedule workers to delete non-latest diffs in post-migration
What does this MR do?
This MR schedules workers for deleting non-latest MR diff files. It's part of https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/19670.
PG query plans on staging were commented directly on the code
Migration output
== 20180619121030 EnqueueDeleteDiffFilesWorkers: migrating ====================
-- indexes(:merge_request_diffs)
-> 0.0018s
-- transaction_open?()
-> 0.0000s
-- execute("SET statement_timeout TO 0")
-> 0.0002s
-- index_exists?(:merge_request_diffs, :id, {:where=>"(state NOT IN ('without_files', 'empty'))", :name=>"tmp_partial_diff_id_with_files_index", :algorithm=>:concurrently})
-> 0.0009s
-- add_index(:merge_request_diffs, :id, {:where=>"(state NOT IN ('without_files', 'empty'))", :name=>"tmp_partial_diff_id_with_files_index", :algorithm=>:concurrently})
-> 0.0196s
-- transaction_open?()
-> 0.0000s
-- select_one("SELECT current_setting('server_version_num') AS v")
-> 0.0005s
-- execute("SET statement_timeout TO 0")
-> 0.0002s
-- indexes(:merge_request_diffs)
-> 0.0013s
-- remove_index(:merge_request_diffs, {:algorithm=>:concurrently, :name=>"tmp_partial_diff_id_with_files_index"})
-> 0.0031s
== 20180619121030 EnqueueDeleteDiffFilesWorkers: migrated (0.0801s) ===========
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added -
Tests added for this feature/bug - Conform by the code review guidelines
-
Has been reviewed by a Backend maintainer -
Has been reviewed by a Database specialist
-
-
Conform by the merge request performance guides -
Conform by the style guides -
If you have multiple commits, please combine them into a few logically organized commits by squashing them -
Internationalization required/considered -
End-to-end tests pass ( package-and-qa
manual pipeline job)
What are the relevant issue numbers?
Part of https://gitlab.com/gitlab-org/gitlab-ce/issues/37639
Edited by Oswaldo Ferreira