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:
Diffstat (limited to 'lib/backup/gitaly_backup.rb')
-rw-r--r--lib/backup/gitaly_backup.rb18
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/backup/gitaly_backup.rb b/lib/backup/gitaly_backup.rb
index 8ac09e94004..b688ff7f13b 100644
--- a/lib/backup/gitaly_backup.rb
+++ b/lib/backup/gitaly_backup.rb
@@ -9,13 +9,16 @@ module Backup
# @param [StringIO] progress IO interface to output progress
# @param [Integer] max_parallelism max parallelism when running backups
# @param [Integer] storage_parallelism max parallelism per storage (is affected by max_parallelism)
- def initialize(progress, max_parallelism: nil, storage_parallelism: nil)
+ # @param [String] backup_id unique identifier for the backup
+ def initialize(progress, max_parallelism: nil, storage_parallelism: nil, incremental: false, backup_id: nil)
@progress = progress
@max_parallelism = max_parallelism
@storage_parallelism = storage_parallelism
+ @incremental = incremental
+ @backup_id = backup_id
end
- def start(type)
+ def start(type, backup_repos_path)
raise Error, 'already started' if started?
command = case type
@@ -30,6 +33,13 @@ module Backup
args = []
args += ['-parallel', @max_parallelism.to_s] if @max_parallelism
args += ['-parallel-storage', @storage_parallelism.to_s] if @storage_parallelism
+ if Feature.enabled?(:incremental_repository_backup, default_enabled: :yaml)
+ args += ['-layout', 'pointer']
+ if type == :create
+ args += ['-incremental'] if @incremental
+ args += ['-id', @backup_id] if @backup_id
+ end
+ end
@input_stream, stdout, @thread = Open3.popen2(build_env, bin_path, command, '-path', backup_repos_path, *args)
@@ -93,10 +103,6 @@ module Backup
@thread.present?
end
- def backup_repos_path
- File.absolute_path(File.join(Gitlab.config.backup.path, 'repositories'))
- end
-
def bin_path
File.absolute_path(Gitlab.config.backup.gitaly_backup_path)
end