Commit 1d704420 authored by Michael Kozono's avatar Michael Kozono

Merge branch '209988-geo-redownloading-repositories-via-snapshot-does-not-work' into 'master'

Geo: Fix not working redownloading of repositories via snapshot

Closes #209988

See merge request gitlab-org/gitlab!38464
parents 2e565228 8e3af644
......@@ -67,7 +67,11 @@ module Geo
def redownload_repository
log_info("Redownloading #{type}")
return if fetch_snapshot
if fetch_snapshot_into_temp_repo
set_temp_repository_as_main
return
end
log_info("Attempting to fetch repository via git")
......@@ -110,7 +114,7 @@ module Geo
# returned in an inconsistent state. However, a subsequent git fetch
# will be enqueued by the log cursor, which should resolve any problems
# it is possible to fix.
def fetch_snapshot
def fetch_snapshot_into_temp_repo
# Snapshots will miss the data that are shared in object pools, and snapshotting should
# be avoided to guard against data loss.
return if project.pool_repository
......
---
title: 'Geo: Fix not working redownloading of repositories via snapshot'
merge_request: 38464
author:
type: fixed
......@@ -125,6 +125,7 @@ RSpec.shared_examples 'sync retries use the snapshot RPC' do
it 'attempts to snapshot' do
expect(repository).to receive_create_from_snapshot
expect(subject).not_to receive(:fetch_geo_mirror).with(repository)
expect(subject).to receive(:set_temp_repository_as_main)
subject.execute
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