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
3ab1648e
Commit
3ab1648e
authored
Aug 03, 2018
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove max verification attempts check
parent
53be07e0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
32 deletions
+4
-32
ee/app/models/geo/project_registry.rb
ee/app/models/geo/project_registry.rb
+0
-5
ee/app/services/geo/repository_verification_secondary_service.rb
...services/geo/repository_verification_secondary_service.rb
+4
-9
ee/spec/services/geo/repository_verification_secondary_service_spec.rb
...ces/geo/repository_verification_secondary_service_spec.rb
+0
-18
No files found.
ee/app/models/geo/project_registry.rb
View file @
3ab1648e
...
...
@@ -4,7 +4,6 @@ class Geo::ProjectRegistry < Geo::BaseRegistry
include
::
IgnorableColumn
include
::
ShaAttribute
MAX_VERIFICATION_RETRIES
=
5
REGISTRY_TYPES
=
%i{repository wiki}
.
freeze
RETRIES_BEFORE_REDOWNLOAD
=
5
...
...
@@ -155,10 +154,6 @@ class Geo::ProjectRegistry < Geo::BaseRegistry
retry_count
(
type
)
>
RETRIES_BEFORE_REDOWNLOAD
end
def
should_be_reverified?
(
type
)
verification_retry_count
(
type
)
<=
MAX_VERIFICATION_RETRIES
end
def
verification_retry_count
(
type
)
public_send
(
"
#{
type
}
_verification_retry_count"
).
to_i
# rubocop:disable GitlabSecurity/PublicSend
end
...
...
ee/app/services/geo/repository_verification_secondary_service.rb
View file @
3ab1648e
...
...
@@ -32,13 +32,6 @@ module Geo
registry
.
public_send
(
"resync_
#{
type
}
"
)
# rubocop:disable GitlabSecurity/PublicSend
end
def
reverify?
# We can have stale checksums in the database, in this case, even resyncing
# the project the checksum will not match. This guard clause prevents us to
# retry the verification for the same projects over and over.
registry
.
should_be_reverified?
(
type
)
end
def
primary_checksum
project
.
repository_state
.
public_send
(
"
#{
type
}
_verification_checksum"
)
# rubocop:disable GitlabSecurity/PublicSend
end
...
...
@@ -67,7 +60,9 @@ module Geo
reverify
,
verification_retry_count
=
if
mismatch
||
failure
.
present?
log_error
(
failure
,
exception
,
type:
type
)
[
reverify?
,
registry
.
verification_retry_count
(
type
)
+
1
]
[
true
,
registry
.
verification_retry_count
(
type
)
+
1
]
else
[
false
,
nil
]
end
resync_retry_at
,
resync_retry_count
=
...
...
@@ -80,7 +75,7 @@ module Geo
"
#{
type
}
_checksum_mismatch"
=>
mismatch
,
"last_
#{
type
}
_verification_failure"
=>
failure
,
"
#{
type
}
_verification_retry_count"
=>
verification_retry_count
,
"resync_
#{
type
}
"
=>
reverify
.
present?
,
"resync_
#{
type
}
"
=>
reverify
,
"
#{
type
}
_retry_at"
=>
resync_retry_at
,
"
#{
type
}
_retry_count"
=>
resync_retry_count
)
...
...
ee/spec/services/geo/repository_verification_secondary_service_spec.rb
View file @
3ab1648e
...
...
@@ -94,24 +94,6 @@ describe Geo::RepositoryVerificationSecondaryService, :geo do
)
end
it
"does not mark
#{
type
}
to be resynced when max retry attempts reached"
do
stub_const
(
'Geo::ProjectRegistry::MAX_VERIFICATION_RETRIES'
,
1
)
registry
.
update
(
"
#{
type
}
_verification_retry_count"
=>
2
)
service
.
execute
expect
(
registry
).
to
have_attributes
(
"
#{
type
}
_verification_checksum_sha"
=>
nil
,
"
#{
type
}
_checksum_mismatch"
=>
true
,
"last_
#{
type
}
_verification_failure"
=>
"
#{
type
.
to_s
.
capitalize
}
checksum mismatch"
,
"
#{
type
}
_verification_retry_count"
=>
3
,
"resync_
#{
type
}
"
=>
false
,
"
#{
type
}
_retry_at"
=>
nil
,
"
#{
type
}
_retry_count"
=>
nil
)
end
it
'ensures the next retry time is capped properly'
do
registry
.
update
(
"
#{
type
}
_retry_count"
=>
30
)
...
...
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