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
94823ff6
Commit
94823ff6
authored
Mar 13, 2018
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Increase minimum mirror update interval from 15 to 30 minutes
parent
f69f6a23
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
10 deletions
+16
-10
ee/changelogs/unreleased/dm-mirror-min-delay-30-minutes.yml
ee/changelogs/unreleased/dm-mirror-min-delay-30-minutes.yml
+5
-0
ee/lib/gitlab/mirror.rb
ee/lib/gitlab/mirror.rb
+4
-3
ee/spec/lib/gitlab/mirror_spec.rb
ee/spec/lib/gitlab/mirror_spec.rb
+1
-1
ee/spec/models/project_mirror_data_spec.rb
ee/spec/models/project_mirror_data_spec.rb
+6
-6
No files found.
ee/changelogs/unreleased/dm-mirror-min-delay-30-minutes.yml
0 → 100644
View file @
94823ff6
---
title
:
Increase minimum mirror update interval from 15 to 30 minutes
merge_request
:
author
:
type
:
other
ee/lib/gitlab/mirror.rb
View file @
94823ff6
...
...
@@ -5,12 +5,13 @@ module Gitlab
PULL_CAPACITY_KEY
=
'MIRROR_PULL_CAPACITY'
.
freeze
JITTER
=
1
.
minute
# TODO: Make MIN_DELAY configurable and MAX_RETRY adjust according to it
# ISSUE: https://gitlab.com/gitlab-org/gitlab-ee/issues/3885
# TODO: Dynamically determine mirror update interval based on total number
# of mirrors, average update time, and available concurrency.
# Issue: https://gitlab.com/gitlab-org/gitlab-ee/issues/5258
MIN_DELAY
=
30
.
minutes
# MAX RETRY value was calculated based on the triangular number with a 15 minutes factor
# https://en.wikipedia.org/wiki/Triangular_number in order to make sure the mirror
# gets retried for a full day before it becomes hard failed
MIN_DELAY
=
15
.
minutes
MAX_RETRY
=
14
class
<<
self
...
...
ee/spec/lib/gitlab/mirror_spec.rb
View file @
94823ff6
...
...
@@ -193,7 +193,7 @@ describe Gitlab::Mirror do
describe
'#min_delay'
do
it
'returns min delay with some jitter'
do
expect
(
described_class
.
min_delay
).
to
be_within
(
1
.
minute
).
of
(
15
.
minutes
)
expect
(
described_class
.
min_delay
).
to
be_within
(
1
.
minute
).
of
(
30
.
minutes
)
end
end
end
ee/spec/models/project_mirror_data_spec.rb
View file @
94823ff6
...
...
@@ -50,12 +50,12 @@ describe ProjectMirrorData, type: :model do
context
'when base delay is lower than mirror_max_delay'
do
before
do
mirror_data
.
last_update_started_at
=
timestamp
-
1
.
minute
mirror_data
.
last_update_started_at
=
timestamp
-
2
.
minutes
end
context
'when retry count is 0'
do
it
'applies transition successfully'
do
expect_next_execution_timestamp
(
mirror_data
,
timestamp
+
26
.
minutes
)
expect_next_execution_timestamp
(
mirror_data
,
timestamp
+
52
.
minutes
)
end
end
...
...
@@ -64,7 +64,7 @@ describe ProjectMirrorData, type: :model do
mirror_data
.
retry_count
=
2
mirror_data
.
increment_retry_count
expect_next_execution_timestamp
(
mirror_data
,
timestamp
+
78
.
minutes
)
expect_next_execution_timestamp
(
mirror_data
,
timestamp
+
156
.
minutes
)
end
end
end
...
...
@@ -78,7 +78,7 @@ describe ProjectMirrorData, type: :model do
context
'when last_update_started_at is nil'
do
it
'applies transition successfully'
do
expect_next_execution_timestamp
(
mirror_data
,
timestamp
+
15
.
minutes
+
mirror_jitter
)
expect_next_execution_timestamp
(
mirror_data
,
timestamp
+
30
.
minutes
+
mirror_jitter
)
end
end
...
...
@@ -89,7 +89,7 @@ describe ProjectMirrorData, type: :model do
context
'when resetting retry count'
do
it
'applies transition successfully'
do
expect_next_execution_timestamp
(
mirror_data
,
timestamp
+
15
.
minutes
+
mirror_jitter
)
expect_next_execution_timestamp
(
mirror_data
,
timestamp
+
30
.
minutes
+
mirror_jitter
)
end
end
...
...
@@ -98,7 +98,7 @@ describe ProjectMirrorData, type: :model do
mirror_data
.
retry_count
=
3
mirror_data
.
increment_retry_count
expect_next_execution_timestamp
(
mirror_data
,
timestamp
+
6
2
.
minutes
)
expect_next_execution_timestamp
(
mirror_data
,
timestamp
+
12
2
.
minutes
)
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