diff options
author | Michael Kozono <mkozono@gmail.com> | 2017-09-14 08:57:00 -0700 |
---|---|---|
committer | Michael Kozono <mkozono@gmail.com> | 2017-09-14 14:17:23 -0700 |
commit | 7b7fb754118c7e86f94c4e5efaea632929d293da (patch) | |
tree | 7cf9def11dbe37d0f5ab2db8031c295c5d292f55 /db | |
parent | c9232087218e03a5eb880e4b4fabe7d0f5a23727 (diff) | |
download | gitlab-ce-7b7fb754118c7e86f94c4e5efaea632929d293da.tar.gz |
Reduce batch sizemk-delete-conflicting-redirects-mysql
…to stay within our query timeout of 60s. Also reduce the job interval to keep the same overall migration time of ~3.3 days.
Diffstat (limited to 'db')
-rw-r--r-- | db/post_migrate/20170907170235_delete_conflicting_redirect_routes.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/db/post_migrate/20170907170235_delete_conflicting_redirect_routes.rb b/db/post_migrate/20170907170235_delete_conflicting_redirect_routes.rb index e2e1cddd9e8..3e84b295be4 100644 --- a/db/post_migrate/20170907170235_delete_conflicting_redirect_routes.rb +++ b/db/post_migrate/20170907170235_delete_conflicting_redirect_routes.rb @@ -6,6 +6,8 @@ class DeleteConflictingRedirectRoutes < ActiveRecord::Migration DOWNTIME = false MIGRATION = 'DeleteConflictingRedirectRoutesRange'.freeze + BATCH_SIZE = 200 # At 200, I expect under 20s per batch, which is under our query timeout of 60s. + DELAY_INTERVAL = 12.seconds disable_ddl_transaction! @@ -18,7 +20,7 @@ class DeleteConflictingRedirectRoutes < ActiveRecord::Migration def up say opening_message - queue_background_migration_jobs_by_range_at_intervals(Route, MIGRATION, 1.minute) + queue_background_migration_jobs_by_range_at_intervals(Route, MIGRATION, DELAY_INTERVAL, batch_size: BATCH_SIZE) end def down |