Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
af9cb10d
Commit
af9cb10d
authored
Jan 06, 2021
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab master
parents
534082f2
362a96b2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
11 deletions
+21
-11
doc/development/migration_style_guide.md
doc/development/migration_style_guide.md
+4
-2
ee/app/services/geo/file_download_service.rb
ee/app/services/geo/file_download_service.rb
+3
-1
ee/changelogs/unreleased/mk-increase-backoff-cap-for-legacy-blobs.yml
...s/unreleased/mk-increase-backoff-cap-for-legacy-blobs.yml
+5
-0
ee/lib/delay.rb
ee/lib/delay.rb
+3
-2
ee/spec/services/geo/file_download_service_spec.rb
ee/spec/services/geo/file_download_service_spec.rb
+6
-6
No files found.
doc/development/migration_style_guide.md
View file @
af9cb10d
...
...
@@ -516,12 +516,14 @@ class MyMigration < ActiveRecord::Migration[6.0]
disable_ddl_transaction!
INDEX_NAME
=
'index_name'
def
up
add_concurrent_index
:table
,
:column
add_concurrent_index
:table
,
:column
,
name:
INDEX_NAME
end
def
down
remove_concurrent_index
:table
,
:column
,
name:
index_name
remove_concurrent_index
:table
,
:column
,
name:
INDEX_NAME
end
end
```
...
...
ee/app/services/geo/file_download_service.rb
View file @
af9cb10d
...
...
@@ -79,9 +79,11 @@ module Geo
retry_later
=
!
registry
.
success
||
registry
.
missing_on_primary
if
retry_later
custom_max_wait_time
=
missing_on_primary
?
4
.
hours
:
nil
# We don't limit the amount of retries
registry
.
retry_count
=
(
registry
.
retry_count
||
0
)
+
1
registry
.
retry_at
=
next_retry_time
(
registry
.
retry_count
)
registry
.
retry_at
=
next_retry_time
(
registry
.
retry_count
,
custom_max_wait_time
)
else
registry
.
retry_count
=
0
registry
.
retry_at
=
nil
...
...
ee/changelogs/unreleased/mk-increase-backoff-cap-for-legacy-blobs.yml
0 → 100644
View file @
af9cb10d
---
title
:
'
Geo:
Increase
backoff
cap
for
Job
artifacts,
LFS
objects,
and
Uploads
which
are
missing
on
primary'
merge_request
:
50812
author
:
type
:
changed
ee/lib/delay.rb
View file @
af9cb10d
...
...
@@ -8,9 +8,10 @@ module Delay
# To prevent the retry time from storing invalid dates in the database,
# cap the max time to a hour plus some random jitter value.
def
next_retry_time
(
retry_count
)
def
next_retry_time
(
retry_count
,
custom_max_wait_time
=
nil
)
proposed_time
=
Time
.
now
+
delay
(
retry_count
).
seconds
max_future_time
=
1
.
hour
.
from_now
+
delay
(
1
).
seconds
max_wait_time
=
custom_max_wait_time
||
1
.
hour
max_future_time
=
max_wait_time
.
from_now
+
delay
(
1
).
seconds
[
proposed_time
,
max_future_time
].
min
end
...
...
ee/spec/services/geo/file_download_service_spec.rb
View file @
af9cb10d
...
...
@@ -323,13 +323,13 @@ RSpec.describe Geo::FileDownloadService do
end
end
it
'sets a retry date with a maximum of about
7 day
s'
do
registry_entry
.
update!
(
retry_count:
100
,
retry_at:
7
.
days
.
from_now
)
it
'sets a retry date with a maximum of about
4 hour
s'
do
registry_entry
.
update!
(
retry_count:
100
,
retry_at:
1
.
minute
.
ago
)
freeze_time
do
execute!
expect
(
registry_entry
.
reload
.
retry_at
<
8
.
days
.
from_now
).
to
be_truthy
expect
(
registry_entry
.
reload
.
retry_at
).
to
be_within
(
3
.
minutes
).
of
(
4
.
hours
.
from_now
)
end
end
end
...
...
@@ -362,13 +362,13 @@ RSpec.describe Geo::FileDownloadService do
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
)
it
'sets a retry date with a maximum of about
1 hour
'
do
registry_entry
.
update!
(
retry_count:
100
,
retry_at:
1
.
minute
.
ago
)
freeze_time
do
execute!
expect
(
registry_entry
.
reload
.
retry_at
<
8
.
days
.
from_now
).
to
be_truthy
expect
(
registry_entry
.
reload
.
retry_at
).
to
be_within
(
3
.
minutes
).
of
(
1
.
hour
.
from_now
)
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment