Skip to content

Ensure backup restores clears storages before restoring

James Fargher requested to merge jf_gitaly_backup_remove_all_repositories into master

What does this MR do and why?

gitaly#4748 (closed)

This MR tells gitaly-backup which storages should be cleared out before starting a full restore. This prevents a timing issue as described in #300974 (comment 506439725)

How to set up and validate locally

These instructions should work through praefect or just gitaly - basically it shouldn't matter how your GDK is setup.

  1. Ensure this branch is checked-out, and restart GDK.
    $ git switch jf_gitaly_backup_remove_all_repositories
    $ gdk restart
    $ bundle exec rails db:migrate RAILS_ENV=development
  2. Create a backup:
    $ bundle exec rake gitlab:backup:create
    ...
    2023-03-29 23:48:42 UTC -- Backup 1680133628_2023_03_29_15.11.0-pre is done.
    2023-03-30 12:48:42 +1300 -- Deleting backup and restore lock file
  3. Create a new project with repository.
  4. Restore from the backup:
    $ bundle exec rake gitlab:backup:restore BACKUP=1680133628_2023_03_29_15.11.0-pre
    ...
  5. Create a new project with repository. If this works without error, then the bug has been fixed.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Hordur Freyr Yngvason

Merge request reports

Loading