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
99ee16b3
Commit
99ee16b3
authored
May 30, 2018
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Geo] Fix: Deleted project events may be skipped on the secondary when selective sync is used
parent
4dc3b309
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
0 deletions
+22
-0
ee/changelogs/unreleased/6011-geo-deleted-project-events-may-be-skipped-on-the-secondary-when-selective-sync-is-used.yml
...-skipped-on-the-secondary-when-selective-sync-is-used.yml
+6
-0
ee/lib/gitlab/geo/log_cursor/daemon.rb
ee/lib/gitlab/geo/log_cursor/daemon.rb
+3
-0
ee/spec/lib/gitlab/geo/log_cursor/events/repository_deleted_event_spec.rb
...ab/geo/log_cursor/events/repository_deleted_event_spec.rb
+13
-0
No files found.
ee/changelogs/unreleased/6011-geo-deleted-project-events-may-be-skipped-on-the-secondary-when-selective-sync-is-used.yml
0 → 100644
View file @
99ee16b3
---
title
:
"
[Geo]
Fix:
Deleted
project
events
may
be
skipped
on
the
secondary
when
selective
sync
is
used"
merge_request
:
author
:
type
:
fixed
ee/lib/gitlab/geo/log_cursor/daemon.rb
View file @
99ee16b3
...
...
@@ -82,6 +82,9 @@ module Gitlab
def
can_replay?
(
event_log
)
return
true
if
event_log
.
project_id
.
nil?
# Always replay events for deleted projects
return
true
unless
Project
.
exists?
(
event_log
.
project_id
)
Gitlab
::
Geo
.
current_node
&
.
projects_include?
(
event_log
.
project_id
)
end
...
...
ee/spec/lib/gitlab/geo/log_cursor/events/repository_deleted_event_spec.rb
View file @
99ee16b3
...
...
@@ -35,6 +35,19 @@ describe Gitlab::Geo::LogCursor::Events::RepositoryDeletedEvent, :postgresql, :c
it
'removes the tracking entry'
do
expect
{
subject
.
process
}.
to
change
(
Geo
::
ProjectRegistry
,
:count
).
by
(
-
1
)
end
context
'when selective sync is enabled'
do
let
(
:secondary
)
{
create
(
:geo_node
,
selective_sync_type:
'namespaces'
,
namespaces:
[
project
.
namespace
])
}
it
'replays delete events when project does not exist on primary'
do
project
.
delete
expect
(
::
GeoRepositoryDestroyWorker
).
to
receive
(
:perform_async
)
.
with
(
project
.
id
,
deleted_project_name
,
deleted_path
,
project
.
repository_storage
)
subject
.
process
end
end
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