diff options
author | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2018-12-10 09:31:28 +0100 |
---|---|---|
committer | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2018-12-13 09:00:03 +0100 |
commit | 89a407dc3bea38b60e06eb825991cbea0c87b85a (patch) | |
tree | 811b5f1ee51859599ebabd55e211063540b45a5e /spec/lib/backup | |
parent | 7cb0dd98590e8fdd7483b9f61643a0daa23c2b67 (diff) | |
download | gitlab-ce-89a407dc3bea38b60e06eb825991cbea0c87b85a.tar.gz |
Restore Object Pools when restoring an object pool
Pool repositories are persisted in the database, and when the DB is
restored, the data need to be restored on disk. This is done by
resetting the state machine and rescheduling the object pool creation.
This is not an exact replica of the state like at the time of the
creation of the backup. However, the data is consistent again.
Dumping isn't required as internally GitLab uses git bundles which
bundle all refs and include all objects in the bundle that they require,
reduplicating as more repositories get backed up. This does require more
data to be stored.
Fixes https://gitlab.com/gitlab-org/gitaly/issues/1355
Diffstat (limited to 'spec/lib/backup')
-rw-r--r-- | spec/lib/backup/repository_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/lib/backup/repository_spec.rb b/spec/lib/backup/repository_spec.rb index fdeea814bb2..5ace5c5b1a2 100644 --- a/spec/lib/backup/repository_spec.rb +++ b/spec/lib/backup/repository_spec.rb @@ -67,6 +67,19 @@ describe Backup::Repository do end end end + + context 'restoring object pools' do + it 'schedules restoring of the pool' do + pool_repository = create(:pool_repository, :failed) + pool_repository.delete_object_pool + + subject.restore + + pool_repository.reload + expect(pool_repository).not_to be_failed + expect(pool_repository.object_pool.exists?).to be(true) + end + end end describe '#prepare_directories', :seed_helper do |