Skip to content

Switch repository backups to use manifests only

James Fargher requested to merge repository_backup_manifest_only into master

What does this MR do and why?

Fixes gitaly#5490 (closed)

Manifests have been generated for repository backups since gitaly!6391 (merged)

This change means that we no longer generate pointer layout backups and instead use manifest files alone. See https://gitlab.com/gitlab-org/gitaly/-/blob/master/doc/gitaly-backup.md#manifest-layout

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Remove any existing backups. This just helps prevent any cross-pollination.
    $ rm -rf tmp/backups/*
  2. Switch to master and generate a backup. Skip db to make this less intrusive.
    $ git switch master
    $ bundle exec rake gitlab:backup:create SKIP=db
    ...
    2024-02-13 22:16:30 UTC -- Backup 1707862589_2024_02_13_16.9.0-pre is done.
  3. Make some obvious changes to a repository (this is so we can detect that restoring did something).
  4. Switch to repository_backup_manifest_only and restore from the just created backup. If there are no repository restores that say "completed restore", i.e. they're all skipped, then something has gone wrong.
    $ git switch repository_backup_manifest_only
    $ bundle exec rake gitlab:backup:restore BACKUP=1707862589_2024_02_13_16.9.0-pre
    ...
    {"command":"restore","gl_project_path":"snippets/19","level":"info","msg":"completed restore","pid":414426,"relative_path":"@snippets/94/00/9400f1b21cb527d7fa3d3eabba93557a18ebe7a2ca4e471cfe5e4c5b4ca7f767.git","storage_name":"default","time":"2024-02-13T22:19:22.446Z"}
    ...
    2024-02-13 22:19:44 UTC -- Restore task is done.
  5. Repeat the above process but instead of creating a backup in master, create a backup in repository_backup_manifest_only.
  6. 🎉 🎉 🎉 🎉 🎉
Edited by James Fargher

Merge request reports