Commit 2cd8473c authored by Sean McGivern's avatar Sean McGivern

Merge branch 'zj-move-repository-storages-pool-repo' into 'master'

Repos leave object pool when moving to a new shard

Closes #9094

See merge request gitlab-org/gitlab-ee!9070
parents 72f47c4e 1c1fdc02
......@@ -19,6 +19,7 @@ module Projects
mark_old_paths_for_archive
project.update(repository_storage: new_repository_storage_key, repository_read_only: false)
project.leave_pool_repository
project.track_project_repository
else
project.update(repository_read_only: false)
......
---
title: Moving repository across shards leaves the pool
merge_request:
author:
type: added
......@@ -46,7 +46,7 @@ describe Projects::UpdateRepositoryStorageService do
end
end
context 'with wiki', :disable_gitaly do
context 'with wiki' do
let(:project) { create(:project, :repository, repository_read_only: true, wiki_enabled: true) }
let(:repository_double) { double(:repository) }
let(:wiki_repository_double) { double(:repository) }
......@@ -105,5 +105,18 @@ describe Projects::UpdateRepositoryStorageService do
end
end
end
context 'when a object pool was joined' do
let(:project) { create(:project, :repository, wiki_enabled: false, repository_read_only: true) }
let(:pool) { create(:pool_repository, :ready, source_project: project) }
it 'leaves the pool' do
allow_any_instance_of(Gitlab::Git::Repository).to receive(:fetch_repository_as_mirror).and_return(true)
subject.execute('test_second_storage')
expect(project.reload_pool_repository).to be_nil
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment