Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-03-09 15:15:54 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-03-09 15:15:54 +0300
commit0c1344a7c19635e387e6f7af20591ad73f46ddff (patch)
tree2b92f62ea6e4e901127f6247a910d8f7b6f2c7c1 /lib/gitlab/database
parenta74ca2457e7c8a26ff5e12211d741b473c86c0b8 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/database')
-rw-r--r--lib/gitlab/database/migrations/batched_background_migration_helpers.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/gitlab/database/migrations/batched_background_migration_helpers.rb b/lib/gitlab/database/migrations/batched_background_migration_helpers.rb
index e958ce2aba4..ded7ce251be 100644
--- a/lib/gitlab/database/migrations/batched_background_migration_helpers.rb
+++ b/lib/gitlab/database/migrations/batched_background_migration_helpers.rb
@@ -12,6 +12,7 @@ module Gitlab
# For now, these migrations are not considered ready for general use, for more information see the tracking epic:
# https://gitlab.com/groups/gitlab-org/-/epics/6751
module BatchedBackgroundMigrationHelpers
+ NonExistentMigrationError = Class.new(StandardError)
BATCH_SIZE = 1_000 # Number of rows to process per job
SUB_BATCH_SIZE = 100 # Number of rows to process per sub-batch
BATCH_CLASS_NAME = 'PrimaryKeyBatchingStrategy' # Default batch class for batched migrations
@@ -213,6 +214,10 @@ module Gitlab
job_arguments: job_arguments
}
+ if ENV['DBLAB_ENVIRONMENT'] && migration.nil?
+ raise NonExistentMigrationError, 'called ensure_batched_background_migration_is_finished with non-existent migration name'
+ end
+
return Gitlab::AppLogger.warn "Could not find batched background migration for the given configuration: #{configuration}" if migration.nil?
return if migration.finished?