Skip to content
Snippets Groups Projects
Commit 489994fc authored by Bala Kumar's avatar Bala Kumar :two:
Browse files

Change batch size

parent 406850a9
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !163088. Comments created here will be created in the context of that merge request.
...@@ -6,9 +6,9 @@ class QueueBackfillIdentifierNamesOfVulnerabilityReads < Gitlab::Database::Migra ...@@ -6,9 +6,9 @@ class QueueBackfillIdentifierNamesOfVulnerabilityReads < Gitlab::Database::Migra
restrict_gitlab_migration gitlab_schema: :gitlab_main restrict_gitlab_migration gitlab_schema: :gitlab_main
MIGRATION = "BackfillIdentifierNamesOfVulnerabilityReads" MIGRATION = "BackfillIdentifierNamesOfVulnerabilityReads"
DELAY_INTERVAL = 2.minutes DELAY_INTERVAL = 160.seconds
BATCH_SIZE = 5000 BATCH_SIZE = 15000
SUB_BATCH_SIZE = 100 SUB_BATCH_SIZE = 40 # Total number of sub-batches: 375
def up def up
queue_batched_background_migration( queue_batched_background_migration(
......
...@@ -19,7 +19,7 @@ class VulnerabilitiesRead < ::ApplicationRecord ...@@ -19,7 +19,7 @@ class VulnerabilitiesRead < ::ApplicationRecord
def perform def perform
each_sub_batch do |sub_batch| each_sub_batch do |sub_batch|
cte = Gitlab::SQL::CTE.new(:batched_relation, sub_batch.limit(100)) cte = Gitlab::SQL::CTE.new(:batched_relation, sub_batch.limit(40))
filtered_results = cte filtered_results = cte
.apply_to(VulnerabilitiesRead.all) .apply_to(VulnerabilitiesRead.all)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment