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
4e942edc
Commit
4e942edc
authored
Mar 18, 2019
by
Douglas Barbosa Alexandre
Committed by
Nick Thomas
Mar 18, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Geo - Store the invalid checksum when we have a mismatch
parent
8573bbb6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
5 deletions
+27
-5
ee/app/models/geo/project_registry.rb
ee/app/models/geo/project_registry.rb
+2
-0
ee/app/services/geo/repository_verification_secondary_service.rb
...services/geo/repository_verification_secondary_service.rb
+4
-3
ee/changelogs/unreleased/5862-geo-store-the-checksum-when-we-have-have-a-checksum-mismatch.yml
...re-the-checksum-when-we-have-have-a-checksum-mismatch.yml
+5
-0
ee/db/geo/migrate/20190314201959_add_checksum_mismatched_columnds_to_project_registry.rb
...9_add_checksum_mismatched_columnds_to_project_registry.rb
+10
-0
ee/db/geo/schema.rb
ee/db/geo/schema.rb
+3
-1
ee/spec/services/geo/repository_verification_secondary_service_spec.rb
...ces/geo/repository_verification_secondary_service_spec.rb
+3
-1
No files found.
ee/app/models/geo/project_registry.rb
View file @
4e942edc
...
...
@@ -17,7 +17,9 @@ class Geo::ProjectRegistry < Geo::BaseRegistry
ignore_column
:wiki_verification_checksum
sha_attribute
:repository_verification_checksum_sha
sha_attribute
:repository_verification_checksum_mismatched
sha_attribute
:wiki_verification_checksum_sha
sha_attribute
:wiki_verification_checksum_mismatched
belongs_to
:project
...
...
ee/app/services/geo/repository_verification_secondary_service.rb
View file @
4e942edc
...
...
@@ -48,7 +48,7 @@ module Geo
checksum
=
calculate_checksum
(
repository
)
if
mismatch?
(
checksum
)
update_registry!
(
mismatch:
true
,
failure:
"
#{
type
.
to_s
.
capitalize
}
checksum mismatch"
)
update_registry!
(
mismatch:
checksum
,
failure:
"
#{
type
.
to_s
.
capitalize
}
checksum mismatch"
)
else
update_registry!
(
checksum:
checksum
)
end
...
...
@@ -56,7 +56,7 @@ module Geo
update_registry!
(
failure:
"Error calculating
#{
type
}
checksum"
,
exception:
e
)
end
def
update_registry!
(
checksum:
nil
,
mismatch:
false
,
failure:
nil
,
exception:
nil
)
def
update_registry!
(
checksum:
nil
,
mismatch:
nil
,
failure:
nil
,
exception:
nil
)
reverify
,
verification_retry_count
=
if
mismatch
||
failure
.
present?
log_error
(
failure
,
exception
,
type:
type
)
...
...
@@ -72,7 +72,8 @@ module Geo
registry
.
update!
(
"
#{
type
}
_verification_checksum_sha"
=>
checksum
,
"
#{
type
}
_checksum_mismatch"
=>
mismatch
,
"
#{
type
}
_verification_checksum_mismatched"
=>
mismatch
,
"
#{
type
}
_checksum_mismatch"
=>
mismatch
.
present?
,
"last_
#{
type
}
_verification_ran_at"
=>
Time
.
now
,
"last_
#{
type
}
_verification_failure"
=>
failure
,
"
#{
type
}
_verification_retry_count"
=>
verification_retry_count
,
...
...
ee/changelogs/unreleased/5862-geo-store-the-checksum-when-we-have-have-a-checksum-mismatch.yml
0 → 100644
View file @
4e942edc
---
title
:
Geo - Store the invalid checksum when we have a mismatch
merge_request
:
10101
author
:
type
:
changed
ee/db/geo/migrate/20190314201959_add_checksum_mismatched_columnds_to_project_registry.rb
0 → 100644
View file @
4e942edc
# frozen_string_literal: true
class
AddChecksumMismatchedColumndsToProjectRegistry
<
ActiveRecord
::
Migration
[
5.0
]
DOWNTIME
=
false
def
change
add_column
:project_registry
,
:repository_verification_checksum_mismatched
,
:binary
add_column
:project_registry
,
:wiki_verification_checksum_mismatched
,
:binary
end
end
ee/db/geo/schema.rb
View file @
4e942edc
...
...
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
201
81213184140
)
do
ActiveRecord
::
Schema
.
define
(
version:
201
90314201959
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
...
...
@@ -81,6 +81,8 @@ ActiveRecord::Schema.define(version: 20181213184140) do
t
.
integer
"wiki_verification_retry_count"
t
.
datetime_with_timezone
"last_repository_verification_ran_at"
t
.
datetime_with_timezone
"last_wiki_verification_ran_at"
t
.
binary
"repository_verification_checksum_mismatched"
t
.
binary
"wiki_verification_checksum_mismatched"
t
.
index
[
"last_repository_successful_sync_at"
],
name:
"idx_project_registry_synced_repositories_partial"
,
where:
"((resync_repository = false) AND (repository_retry_count IS NULL) AND (repository_verification_checksum_sha IS NOT NULL))"
,
using: :btree
t
.
index
[
"last_repository_successful_sync_at"
],
name:
"index_project_registry_on_last_repository_successful_sync_at"
,
using: :btree
t
.
index
[
"last_repository_synced_at"
],
name:
"index_project_registry_on_last_repository_synced_at"
,
using: :btree
...
...
ee/spec/services/geo/repository_verification_secondary_service_spec.rb
View file @
4e942edc
...
...
@@ -79,7 +79,7 @@ describe Geo::RepositoryVerificationSecondaryService, :geo do
context
'when the checksum mismatch'
do
before
do
allow
(
repository
).
to
receive
(
:checksum
).
and_return
(
'
other_checksum
'
)
allow
(
repository
).
to
receive
(
:checksum
).
and_return
(
'
99fc1ec4ce60
'
)
end
it
'keeps track of failures'
do
...
...
@@ -87,6 +87,7 @@ describe Geo::RepositoryVerificationSecondaryService, :geo do
expect
(
registry
).
to
have_attributes
(
"
#{
type
}
_verification_checksum_sha"
=>
nil
,
"
#{
type
}
_verification_checksum_mismatched"
=>
'99fc1ec4ce60'
,
"
#{
type
}
_checksum_mismatch"
=>
true
,
"last_
#{
type
}
_verification_ran_at"
=>
be_within
(
1
.
minute
).
of
(
Time
.
now
),
"last_
#{
type
}
_verification_failure"
=>
"
#{
type
.
to_s
.
capitalize
}
checksum mismatch"
,
...
...
@@ -120,6 +121,7 @@ describe Geo::RepositoryVerificationSecondaryService, :geo do
expect
(
registry
).
to
have_attributes
(
"
#{
type
}
_verification_checksum_sha"
=>
nil
,
"
#{
type
}
_verification_checksum_mismatched"
=>
nil
,
"
#{
type
}
_checksum_mismatch"
=>
false
,
"last_
#{
type
}
_verification_ran_at"
=>
be_within
(
1
.
minute
).
of
(
Time
.
now
),
"last_
#{
type
}
_verification_failure"
=>
"Error calculating
#{
type
}
checksum"
,
...
...
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