Commit 9c60f6b5 authored by Sean Arnold's avatar Sean Arnold Committed by Douglas Barbosa Alexandre

Reduce batch size, add tracking, add schema ver

parent 853e6391
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
class BackfillIncidentIssueEscalationStatuses < Gitlab::Database::Migration[1.0] class BackfillIncidentIssueEscalationStatuses < Gitlab::Database::Migration[1.0]
MIGRATION = 'BackfillIncidentIssueEscalationStatuses' MIGRATION = 'BackfillIncidentIssueEscalationStatuses'
DELAY_INTERVAL = 2.minutes DELAY_INTERVAL = 2.minutes
BATCH_SIZE = 10_000 BATCH_SIZE = 1_000
disable_ddl_transaction! disable_ddl_transaction!
...@@ -19,7 +19,7 @@ class BackfillIncidentIssueEscalationStatuses < Gitlab::Database::Migration[1.0] ...@@ -19,7 +19,7 @@ class BackfillIncidentIssueEscalationStatuses < Gitlab::Database::Migration[1.0]
relation = Issue.incidents relation = Issue.incidents
queue_background_migration_jobs_by_range_at_intervals( queue_background_migration_jobs_by_range_at_intervals(
relation, MIGRATION, DELAY_INTERVAL, batch_size: BATCH_SIZE) relation, MIGRATION, DELAY_INTERVAL, batch_size: BATCH_SIZE, track_jobs: true)
end end
def down def down
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe Gitlab::BackgroundMigration::BackfillIncidentIssueEscalationStatuses do RSpec.describe Gitlab::BackgroundMigration::BackfillIncidentIssueEscalationStatuses, schema: 20211214012507 do
let(:namespaces) { table(:namespaces) } let(:namespaces) { table(:namespaces) }
let(:projects) { table(:projects) } let(:projects) { table(:projects) }
let(:issues) { table(:issues) } let(:issues) { table(:issues) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment