Skip to content

Use gitaly-backup for repository backups by default

James Fargher requested to merge enable_gitaly_backup into master

What does this MR do?

#333034 (closed)

  • Swaps out the ruby implementation of repository backups that calls gitaly RPCs (GitalyRPCBackup) with an executable maintained by gitaly called gitaly-backup (GitalyBackup).
  • backup.rake is only used for on-prem. So we cannot use feature rollouts on gitlab.com. Instead we're enabling it by default.

This can be disabled in the rails console:

Feature.disable :gitaly_backup

Testing (GDK)

  1. Make sure GDK is up-to-date and reconfigured. There's a new configuration for gitlab.yml to locate gitaly-backup that GDK needs to set up.

    $ gdk update
    $ gdk reconfigure
  2. Checkout this branch

    $ git checkout enable_gitaly_backup
  3. Make sure the feature is removed (rails console):

    Feature.remove :gitaly_backup
  4. Create a backup (shell):

    $ bundle exec rake gitlab:backup:create
    2021-07-23 13:40:29 +1200 -- Dumping database ... 
    Dumping PostgreSQL database gitlabhq_development ... [DONE]
    2021-07-23 13:40:32 +1200 -- done
    2021-07-23 13:40:32 +1200 -- Dumping repositories ...
    time="2021-07-23T13:40:32+12:00" level=info msg="started backup" gl_project_path=gitlab-org.wiki relative_path=@groups/78/5f/785f3ec7eb32f30b90cd0fcf3657d388b5ff4297f2f9716ff66e9b69c05ddd09.wiki.git storage_name=default
    time="2021-07-23T13:40:32+12:00" level=warning msg="skipped backup" error="repository skipped" gl_project_path=gitlab-org.wiki relative_path=@groups/78/5f/785f3ec7eb32f30b90cd0fcf3657d388b5ff4297f2f9716ff66e9b69c05ddd09.wiki.git storage_name=default
    ...

If the repository backups start, this is enough to know the feature flag is working correctly.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by James Fargher

Merge request reports

Loading