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
f9ae015f
Commit
f9ae015f
authored
Sep 03, 2020
by
Michael Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply 7 suggestion(s) to 4 file(s)
parent
307b425f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
7 deletions
+7
-7
ee/app/finders/geo/project_registry_finder.rb
ee/app/finders/geo/project_registry_finder.rb
+2
-2
ee/app/finders/geo/registry_finder.rb
ee/app/finders/geo/registry_finder.rb
+2
-2
ee/app/models/concerns/geo/replicable_registry.rb
ee/app/models/concerns/geo/replicable_registry.rb
+1
-1
ee/app/workers/geo/container_repository_sync_dispatch_worker.rb
.../workers/geo/container_repository_sync_dispatch_worker.rb
+2
-2
No files found.
ee/app/finders/geo/project_registry_finder.rb
View file @
f9ae015f
...
@@ -2,14 +2,14 @@
...
@@ -2,14 +2,14 @@
module
Geo
module
Geo
class
ProjectRegistryFinder
class
ProjectRegistryFinder
# Returns ProjectRegistry records
that have never have an attempt tp sync
.
# Returns ProjectRegistry records
where sync has never been attempted
.
#
#
# Does not care about selective sync, because it considers the Registry
# Does not care about selective sync, because it considers the Registry
# table to be the single source of truth. The contract is that other
# table to be the single source of truth. The contract is that other
# processes need to ensure that the table only contains records that should
# processes need to ensure that the table only contains records that should
# be synced.
# be synced.
#
#
# Any registries that
have ever been synced
that currently need to be
# Any registries that
this secondary has ever attempted to sync
that currently need to be
# resynced will be handled by other find methods (like
# resynced will be handled by other find methods (like
# #find_registries_needs_sync_again)
# #find_registries_needs_sync_again)
#
#
...
...
ee/app/finders/geo/registry_finder.rb
View file @
f9ae015f
...
@@ -4,14 +4,14 @@ module Geo
...
@@ -4,14 +4,14 @@ module Geo
class
RegistryFinder
class
RegistryFinder
# @!method find_registries_never_attempted_sync
# @!method find_registries_never_attempted_sync
# Return an ActiveRecord::Relation of the registry records for the
# Return an ActiveRecord::Relation of the registry records for the
# tracked
ype that have never have an attempt
to sync.
# tracked
type that this secondary has never attempted
to sync.
#
#
# Does not care about selective sync, because it considers the Registry
# Does not care about selective sync, because it considers the Registry
# table to be the single source of truth. The contract is that other
# table to be the single source of truth. The contract is that other
# processes need to ensure that the table only contains records that should
# processes need to ensure that the table only contains records that should
# be synced.
# be synced.
#
#
# Any registries that
have ever been synced
that currently need to be
# Any registries that
this secondary has ever attempted to sync
that currently need to be
# resynced will be handled by other find methods (like
# resynced will be handled by other find methods (like
# #find_registries_needs_sync_again)
# #find_registries_needs_sync_again)
#
#
...
...
ee/app/models/concerns/geo/replicable_registry.rb
View file @
f9ae015f
...
@@ -37,7 +37,7 @@ module Geo::ReplicableRegistry
...
@@ -37,7 +37,7 @@ module Geo::ReplicableRegistry
scope
:failed
,
->
{
with_state
(
:failed
)
}
scope
:failed
,
->
{
with_state
(
:failed
)
}
scope
:needs_sync_again
,
->
{
failed
.
retry_due
}
scope
:needs_sync_again
,
->
{
failed
.
retry_due
}
scope
:never_attempted_sync
,
->
{
with_state
(
:pending
)
.
where
(
last_synced_at:
nil
)
}
scope
:never_attempted_sync
,
->
{
pending
.
where
(
last_synced_at:
nil
)
}
scope
:ordered
,
->
{
order
(
:id
)
}
scope
:ordered
,
->
{
order
(
:id
)
}
scope
:pending
,
->
{
with_state
(
:pending
)
}
scope
:pending
,
->
{
with_state
(
:pending
)
}
scope
:retry_due
,
->
{
where
(
arel_table
[
:retry_at
].
eq
(
nil
).
or
(
arel_table
[
:retry_at
].
lt
(
Time
.
current
)))
}
scope
:retry_due
,
->
{
where
(
arel_table
[
:retry_at
].
eq
(
nil
).
or
(
arel_table
[
:retry_at
].
lt
(
Time
.
current
)))
}
...
...
ee/app/workers/geo/container_repository_sync_dispatch_worker.rb
View file @
f9ae015f
...
@@ -42,7 +42,7 @@ module Geo
...
@@ -42,7 +42,7 @@ module Geo
if
remaining_capacity
==
0
if
remaining_capacity
==
0
resources
resources
else
else
resources
+
fin_jobs_needs_sync_again
(
batch_size:
remaining_capacity
)
resources
+
fin
d
_jobs_needs_sync_again
(
batch_size:
remaining_capacity
)
end
end
end
end
...
@@ -52,7 +52,7 @@ module Geo
...
@@ -52,7 +52,7 @@ module Geo
.
pluck_model_foreign_key
.
pluck_model_foreign_key
end
end
def
fin_jobs_needs_sync_again
(
batch_size
:)
def
fin
d
_jobs_needs_sync_again
(
batch_size
:)
registry_finder
registry_finder
.
find_registries_needs_sync_again
(
batch_size:
batch_size
,
except_ids:
scheduled_repository_ids
)
.
find_registries_needs_sync_again
(
batch_size:
batch_size
,
except_ids:
scheduled_repository_ids
)
.
pluck_model_foreign_key
.
pluck_model_foreign_key
...
...
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