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
2c191849
Commit
2c191849
authored
Aug 26, 2020
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename count_synced_missing_on_primary method
Refactor code to make the finder class closer to a Geo replicator.
parent
23ff6196
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
12 deletions
+12
-12
ee/app/finders/geo/file_registry_finder.rb
ee/app/finders/geo/file_registry_finder.rb
+2
-2
ee/app/models/geo_node_status.rb
ee/app/models/geo_node_status.rb
+3
-3
ee/spec/finders/geo/attachment_registry_finder_spec.rb
ee/spec/finders/geo/attachment_registry_finder_spec.rb
+2
-2
ee/spec/finders/geo/job_artifact_registry_finder_spec.rb
ee/spec/finders/geo/job_artifact_registry_finder_spec.rb
+2
-2
ee/spec/finders/geo/lfs_object_registry_finder_spec.rb
ee/spec/finders/geo/lfs_object_registry_finder_spec.rb
+2
-2
ee/spec/support/shared_examples/finders/geo/file_registry_finders_shared_examples.rb
...ples/finders/geo/file_registry_finders_shared_examples.rb
+1
-1
No files found.
ee/app/finders/geo/file_registry_finder.rb
View file @
2c191849
...
...
@@ -2,10 +2,10 @@
module
Geo
class
FileRegistryFinder
<
RegistryFinder
# @!method
count_synced_missing_on_primary
# @!method
synced_missing_on_primary_count
# Return a count of the registry records for the tracked file_type(s)
# that are synced and missing on the primary
def
count_synced_missing_on_primary
def
synced_missing_on_primary_count
registry_class
.
synced
.
missing_on_primary
.
count
end
...
...
ee/app/models/geo_node_status.rb
View file @
2c191849
...
...
@@ -483,7 +483,7 @@ class GeoNodeStatus < ApplicationRecord
self
.
lfs_objects_synced_count
=
lfs_objects_finder
.
synced_count
self
.
lfs_objects_failed_count
=
lfs_objects_finder
.
failed_count
self
.
lfs_objects_registry_count
=
lfs_objects_finder
.
registry_count
self
.
lfs_objects_synced_missing_on_primary_count
=
lfs_objects_finder
.
count_synced_missing_on_primary
self
.
lfs_objects_synced_missing_on_primary_count
=
lfs_objects_finder
.
synced_missing_on_primary_count
end
def
load_job_artifacts_data
...
...
@@ -493,7 +493,7 @@ class GeoNodeStatus < ApplicationRecord
self
.
job_artifacts_synced_count
=
job_artifacts_finder
.
synced_count
self
.
job_artifacts_failed_count
=
job_artifacts_finder
.
failed_count
self
.
job_artifacts_registry_count
=
job_artifacts_finder
.
registry_count
self
.
job_artifacts_synced_missing_on_primary_count
=
job_artifacts_finder
.
count_synced_missing_on_primary
self
.
job_artifacts_synced_missing_on_primary_count
=
job_artifacts_finder
.
synced_missing_on_primary_count
end
def
load_attachments_data
...
...
@@ -503,7 +503,7 @@ class GeoNodeStatus < ApplicationRecord
self
.
attachments_synced_count
=
attachments_finder
.
synced_count
self
.
attachments_failed_count
=
attachments_finder
.
failed_count
self
.
attachments_registry_count
=
attachments_finder
.
registry_count
self
.
attachments_synced_missing_on_primary_count
=
attachments_finder
.
count_synced_missing_on_primary
self
.
attachments_synced_missing_on_primary_count
=
attachments_finder
.
synced_missing_on_primary_count
end
def
load_container_registry_data
...
...
ee/spec/finders/geo/attachment_registry_finder_spec.rb
View file @
2c191849
...
...
@@ -75,7 +75,7 @@ RSpec.describe Geo::AttachmentRegistryFinder, :geo do
end
end
describe
'#
count_synced_missing_on_primary
'
do
describe
'#
synced_missing_on_primary_count
'
do
it
'counts registries that have been synced and are missing on the primary, excluding not synced ones'
do
create
(
:geo_upload_registry
,
:attachment
,
:failed
,
file_id:
upload_1
.
id
)
create
(
:geo_upload_registry
,
:attachment
,
file_id:
upload_2
.
id
,
missing_on_primary:
true
)
...
...
@@ -86,7 +86,7 @@ RSpec.describe Geo::AttachmentRegistryFinder, :geo do
create
(
:geo_upload_registry
,
:attachment
,
file_id:
upload_7
.
id
,
missing_on_primary:
true
)
create
(
:geo_upload_registry
,
:attachment
,
:never_synced
,
file_id:
upload_8
.
id
)
expect
(
subject
.
count_synced_missing_on_primary
).
to
eq
3
expect
(
subject
.
synced_missing_on_primary_count
).
to
eq
3
end
end
...
...
ee/spec/finders/geo/job_artifact_registry_finder_spec.rb
View file @
2c191849
...
...
@@ -75,7 +75,7 @@ RSpec.describe Geo::JobArtifactRegistryFinder, :geo do
end
end
describe
'#
count_synced_missing_on_primary
'
do
describe
'#
synced_missing_on_primary_count
'
do
it
'counts registries that have been synced and are missing on the primary, excluding not synced ones'
do
create
(
:geo_job_artifact_registry
,
:failed
,
artifact_id:
ci_job_artifact_1
.
id
)
create
(
:geo_job_artifact_registry
,
artifact_id:
ci_job_artifact_2
.
id
,
missing_on_primary:
true
)
...
...
@@ -86,7 +86,7 @@ RSpec.describe Geo::JobArtifactRegistryFinder, :geo do
create
(
:geo_job_artifact_registry
,
artifact_id:
ci_job_artifact_remote_2
.
id
,
missing_on_primary:
true
)
create
(
:geo_job_artifact_registry
,
:never_synced
,
artifact_id:
ci_job_artifact_remote_3
.
id
)
expect
(
subject
.
count_synced_missing_on_primary
).
to
eq
3
expect
(
subject
.
synced_missing_on_primary_count
).
to
eq
3
end
end
...
...
ee/spec/finders/geo/lfs_object_registry_finder_spec.rb
View file @
2c191849
...
...
@@ -65,7 +65,7 @@ RSpec.describe Geo::LfsObjectRegistryFinder, :geo do
end
end
describe
'#
count_synced_missing_on_primary
'
do
describe
'#
synced_missing_on_primary_count
'
do
it
'counts registries that have been synced and are missing on the primary, excluding not synced ones'
do
create
(
:geo_lfs_object_registry
,
:failed
,
lfs_object_id:
lfs_object_1
.
id
)
create
(
:geo_lfs_object_registry
,
lfs_object_id:
lfs_object_2
.
id
,
missing_on_primary:
true
)
...
...
@@ -76,7 +76,7 @@ RSpec.describe Geo::LfsObjectRegistryFinder, :geo do
create
(
:geo_lfs_object_registry
,
lfs_object_id:
lfs_object_remote_2
.
id
,
missing_on_primary:
true
)
create
(
:geo_lfs_object_registry
,
:never_synced
,
lfs_object_id:
lfs_object_remote_3
.
id
)
expect
(
subject
.
count_synced_missing_on_primary
).
to
eq
3
expect
(
subject
.
synced_missing_on_primary_count
).
to
eq
3
end
end
...
...
ee/spec/support/shared_examples/finders/geo/file_registry_finders_shared_examples.rb
View file @
2c191849
...
...
@@ -7,7 +7,7 @@ RSpec.shared_examples 'a file registry finder' do
registry_count
synced_count
failed_count
count_synced_missing_on_primary
synced_missing_on_primary_count
find_retryable_failed_registries
find_retryable_synced_missing_on_primary_registries
}
...
...
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