Commit 9116be1d authored by Stan Hu's avatar Stan Hu

Merge branch 'mk/resolve-sticky-failures-when-missing-on-primary' into 'master'

Geo: Resolve sticky failures when attachments are missing on primary

Closes gitlab-com/migration#458

See merge request gitlab-org/gitlab-ee!6991
parents 039c3571 75b2166a
......@@ -67,7 +67,7 @@ module Geo
if retry_later
# We don't limit the amount of retries
registry.retry_count = (registry.retry_count || 0) + 1
registry.retry_at = Time.now + delay(registry.retry_count).seconds
registry.retry_at = next_retry_time(registry.retry_count)
else
registry.retry_count = 0
registry.retry_at = nil
......
---
title: 'Geo: Resolve sticky failures when attachments are missing on primary'
merge_request: 6991
author:
type: fixed
......@@ -220,6 +220,16 @@ describe Geo::FileDownloadService do
expect(registry_entry.retry_at > Time.now).to be_truthy
end
end
it 'sets a retry date with a maximum of about 7 days' do
registry_entry.update!(retry_count: 100, retry_at: 7.days.from_now)
Timecop.freeze do
execute!
expect(registry_entry.reload.retry_at < 8.days.from_now).to be_truthy
end
end
end
context 'when the file is not missing on the primary' do
......@@ -249,6 +259,16 @@ describe Geo::FileDownloadService do
expect(registry_entry.retry_at > Time.now).to be_truthy
end
end
it 'sets a retry date with a maximum of about 7 days' do
registry_entry.update!(retry_count: 100, retry_at: 7.days.from_now)
Timecop.freeze do
execute!
expect(registry_entry.reload.retry_at < 8.days.from_now).to be_truthy
end
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