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
path: root/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-05-24 12:09:17 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-05-24 12:09:17 +0300
commit43c14d2d9245aea5964d52d3e4915be1126977cb (patch)
tree769e314e13e40059f6b5ff228e670e278d201e06 /lib
parentecf2b5b6048d8f289d085b5d7951381c1ef4dca0 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/database/consistency_checker.rb6
-rw-r--r--lib/gitlab/git/diff.rb2
-rw-r--r--lib/tasks/gitlab/pages.rake54
3 files changed, 4 insertions, 58 deletions
diff --git a/lib/gitlab/database/consistency_checker.rb b/lib/gitlab/database/consistency_checker.rb
index e398fef744c..bf60c76a085 100644
--- a/lib/gitlab/database/consistency_checker.rb
+++ b/lib/gitlab/database/consistency_checker.rb
@@ -3,9 +3,9 @@
module Gitlab
module Database
class ConsistencyChecker
- BATCH_SIZE = 1000
- MAX_BATCHES = 25
- MAX_RUNTIME = 30.seconds # must be less than the scheduling frequency of the ConsistencyCheck jobs
+ BATCH_SIZE = 500
+ MAX_BATCHES = 20
+ MAX_RUNTIME = 5.seconds # must be less than the scheduling frequency of the ConsistencyCheck jobs
delegate :monotonic_time, to: :'Gitlab::Metrics::System'
diff --git a/lib/gitlab/git/diff.rb b/lib/gitlab/git/diff.rb
index c473fe6973d..003cc87d65a 100644
--- a/lib/gitlab/git/diff.rb
+++ b/lib/gitlab/git/diff.rb
@@ -44,7 +44,7 @@ module Gitlab
else
# Only show what is new in the source branch
# compared to the target branch, not the other way
- # around. The linex below with merge_base is
+ # around. The line below with merge_base is
# equivalent to diff with three dots (git diff
# branch1...branch2) From the git documentation:
# "git diff A...B" is equivalent to "git diff
diff --git a/lib/tasks/gitlab/pages.rake b/lib/tasks/gitlab/pages.rake
index c3828e7eba4..e6fde28e38f 100644
--- a/lib/tasks/gitlab/pages.rake
+++ b/lib/tasks/gitlab/pages.rake
@@ -4,60 +4,6 @@ require 'logger'
namespace :gitlab do
namespace :pages do
- desc "GitLab | Pages | Migrate legacy storage to zip format"
- task migrate_legacy_storage: :gitlab_environment do
- logger.info('Starting to migrate legacy pages storage to zip deployments')
-
- result = ::Pages::MigrateFromLegacyStorageService.new(logger,
- ignore_invalid_entries: ignore_invalid_entries,
- mark_projects_as_not_deployed: mark_projects_as_not_deployed)
- .execute_with_threads(threads: migration_threads, batch_size: batch_size)
-
- logger.info("A total of #{result[:migrated] + result[:errored]} projects were processed.")
- logger.info("- The #{result[:migrated]} projects migrated successfully")
- logger.info("- The #{result[:errored]} projects failed to be migrated")
- end
-
- desc "GitLab | Pages | DANGER: Removes data which was migrated from legacy storage on zip storage. Can be used if some bugs in migration are discovered and migration needs to be restarted from scratch."
- task clean_migrated_zip_storage: :gitlab_environment do
- destroyed_deployments = 0
-
- logger.info("Starting to delete migrated pages deployments")
-
- ::PagesDeployment.migrated_from_legacy_storage.each_batch(of: batch_size) do |batch|
- destroyed_deployments += batch.count
-
- # we need to destroy associated files, so can't use delete_all
- batch.destroy_all # rubocop: disable Cop/DestroyAll
-
- logger.info("#{destroyed_deployments} deployments were deleted")
- end
- end
-
- def logger
- @logger ||= Logger.new($stdout)
- end
-
- def migration_threads
- ENV.fetch('PAGES_MIGRATION_THREADS', '3').to_i
- end
-
- def batch_size
- ENV.fetch('PAGES_MIGRATION_BATCH_SIZE', '10').to_i
- end
-
- def ignore_invalid_entries
- Gitlab::Utils.to_boolean(
- ENV.fetch('PAGES_MIGRATION_IGNORE_INVALID_ENTRIES', 'false')
- )
- end
-
- def mark_projects_as_not_deployed
- Gitlab::Utils.to_boolean(
- ENV.fetch('PAGES_MIGRATION_MARK_PROJECTS_AS_NOT_DEPLOYED', 'false')
- )
- end
-
namespace :deployments do
task migrate_to_object_storage: :gitlab_environment do
logger = Logger.new($stdout)