Allow partially migrated repositories to continue migration
Previously we verified if the projecthave at least migrated their repository to hashed storage and prevented the migration command to start a new migration. The new version checks for the latest storage version available (fully migrated), otherwise it allows migration to be triggered again.
This commit is contained in:
parent
bf31bd0d82
commit
f208f4c236
3 changed files with 14 additions and 1 deletions
|
@ -1968,7 +1968,7 @@ class Project < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def migrate_to_hashed_storage!
|
||||
return if hashed_storage?(:repository)
|
||||
return unless storage_upgradable?
|
||||
|
||||
update!(repository_read_only: true)
|
||||
|
||||
|
|
5
changelogs/unreleased/53700-hashed-storagemigration.yml
Normal file
5
changelogs/unreleased/53700-hashed-storagemigration.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: 'Hashed Storage: allow migration to be retried in partially migrated projects'
|
||||
merge_request: 23087
|
||||
author:
|
||||
type: fixed
|
|
@ -3087,6 +3087,14 @@ describe Project do
|
|||
it 'does not flag as read-only' do
|
||||
expect { project.migrate_to_hashed_storage! }.not_to change { project.repository_read_only }
|
||||
end
|
||||
|
||||
context 'when partially migrated' do
|
||||
it 'returns true' do
|
||||
project = create(:project, storage_version: 1, skip_disk_validation: true)
|
||||
|
||||
expect(project.migrate_to_hashed_storage!).to be_truthy
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue