summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorOswaldo Ferreira <oswaldo@gitlab.com>2018-07-05 17:15:57 -0300
committerOswaldo Ferreira <oswaldo@gitlab.com>2018-07-10 09:43:58 -0300
commit19966e7095fd6357183afb8e009c7f8e78a05591 (patch)
treeacbdf99563af096d49e52fe6e5a0cdd326ef0c3e /db
parent4455904bc154f1a36cedeea574bb0f454f92a9e9 (diff)
downloadgitlab-ce-19966e7095fd6357183afb8e009c7f8e78a05591.tar.gz
Wait postgresql vacuum of deadtuples on merge_request_diff_files deletion
Diffstat (limited to 'db')
-rw-r--r--db/post_migrate/20180619121030_enqueue_delete_diff_files_workers.rb15
1 files changed, 3 insertions, 12 deletions
diff --git a/db/post_migrate/20180619121030_enqueue_delete_diff_files_workers.rb b/db/post_migrate/20180619121030_enqueue_delete_diff_files_workers.rb
index df30991737c..9e96aaf50a0 100644
--- a/db/post_migrate/20180619121030_enqueue_delete_diff_files_workers.rb
+++ b/db/post_migrate/20180619121030_enqueue_delete_diff_files_workers.rb
@@ -2,24 +2,15 @@ class EnqueueDeleteDiffFilesWorkers < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
- SCHEDULER = 'ScheduleDiffFilesDeletion'.freeze
- TMP_INDEX = 'tmp_partial_diff_id_with_files_index'.freeze
+ MIGRATION = 'DeleteDiffFiles'.freeze
disable_ddl_transaction!
def up
- unless index_exists_by_name?(:merge_request_diffs, TMP_INDEX)
- add_concurrent_index(:merge_request_diffs, :id, where: "(state NOT IN ('without_files', 'empty'))", name: TMP_INDEX)
- end
-
- # We keep the index since this will be used async.
- # Ideally we should remove it in an upcoming release.
- BackgroundMigrationWorker.perform_async(SCHEDULER)
+ BackgroundMigrationWorker.perform_async(MIGRATION)
end
def down
- if index_exists_by_name?(:merge_request_diffs, TMP_INDEX)
- remove_concurrent_index_by_name(:merge_request_diffs, TMP_INDEX)
- end
+ # no-op
end
end