diff --git a/config/feature_flags/development/gitaly_backup.yml b/config/feature_flags/development/gitaly_backup.yml index 4f7a0a4baf9fb7053ffaab699973f48fad9e5b3e..67552d39d9206891499ef54b4e00b1a4beed3d35 100644 --- a/config/feature_flags/development/gitaly_backup.yml +++ b/config/feature_flags/development/gitaly_backup.yml @@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/333034 milestone: '14.0' type: development group: group::gitaly -default_enabled: false +default_enabled: true diff --git a/doc/raketasks/backup_restore.md b/doc/raketasks/backup_restore.md index b393be189107eaf68f8f9e18a072a107b70cfe49..02afe8da6d7cd742ad905adff8c59bf379fd8dbb 100644 --- a/doc/raketasks/backup_restore.md +++ b/doc/raketasks/backup_restore.md @@ -1472,3 +1472,47 @@ If this happens, examine the following: - Confirm there is sufficient disk space for the Gzip operation. - If NFS is being used, check if the mount option `timeout` is set. The default is `600`, and changing this to smaller values results in this error. + +### `gitaly-backup` for repository backup and restore **(FREE SELF)** + +> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/333034) in GitLab 14.2. +> - [Deployed behind a feature flag](../user/feature_flags.md), enabled by default. +> - Recommended for production use. +> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#disable-or-enable-gitaly-backup). + +There can be +[risks when disabling released features](../user/feature_flags.md#risks-when-disabling-released-features). +Refer to this feature's version history for more details. + +`gitaly-backup` is used by the backup Rake task to create and restore repository backups from Gitaly. +`gitaly-backup` replaces the previous backup method that directly calls RPCs on Gitaly from GitLab. + +The backup Rake task must be able to find this executable. It can be configured in Omnibus GitLab packages: + +1. Add the following to `/etc/gitlab/gitlab.rb`: + + ```ruby + gitlab_rails['backup_gitaly_backup_path'] = '/path/to/gitaly-backup' + ``` + +1. [Reconfigure GitLab](../administration/restart_gitlab.md#omnibus-gitlab-reconfigure) + for the changes to take effect + +#### Disable or enable `gitaly-backup` + +`gitaly-backup` is under development but ready for production use. +It is deployed behind a feature flag that is **enabled by default**. +[GitLab administrators with access to the GitLab Rails console](../administration/feature_flags.md) +can opt to disable it. + +To disable it: + +```ruby +Feature.disable(:gitaly_backup) +``` + +To enable it: + +```ruby +Feature.enable(:gitaly_backup) +``` diff --git a/lib/tasks/gitlab/backup.rake b/lib/tasks/gitlab/backup.rake index ed74dd472ff9462ae88ca018998a123e89b8c650..1a65be04d09c86039964dd531567ce7953356a0b 100644 --- a/lib/tasks/gitlab/backup.rake +++ b/lib/tasks/gitlab/backup.rake @@ -297,7 +297,7 @@ namespace :gitlab do end def repository_backup_strategy - if Feature.enabled?(:gitaly_backup) + if Feature.enabled?(:gitaly_backup, default_enabled: :yaml) max_concurrency = ENV['GITLAB_BACKUP_MAX_CONCURRENCY'].presence max_storage_concurrency = ENV['GITLAB_BACKUP_MAX_STORAGE_CONCURRENCY'].presence Backup::GitalyBackup.new(progress, parallel: max_concurrency, parallel_storage: max_storage_concurrency)