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
a3431a26
Commit
a3431a26
authored
Sep 21, 2020
by
Valery Sizov
Committed by
Mike Kozono
Sep 22, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: [Geo] Blob removal doesn't work for SSF blobs
Fix consume method
parent
b08db6eb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
11 deletions
+15
-11
ee/changelogs/unreleased/254248-geo-blob-removal-doesn-t-work-for-ssf-blobs-2.yml
.../254248-geo-blob-removal-doesn-t-work-for-ssf-blobs-2.yml
+5
-0
ee/lib/gitlab/geo/replicator.rb
ee/lib/gitlab/geo/replicator.rb
+0
-5
ee/spec/support/shared_examples/models/concerns/blob_replicator_strategy_shared_examples.rb
...dels/concerns/blob_replicator_strategy_shared_examples.rb
+10
-6
No files found.
ee/changelogs/unreleased/254248-geo-blob-removal-doesn-t-work-for-ssf-blobs-2.yml
0 → 100644
View file @
a3431a26
---
title
:
'
Fix:
[Geo]
Blob
removal
doesn'
'
t
work
for
SSF
blobs'
merge_request
:
42891
author
:
type
:
fixed
ee/lib/gitlab/geo/replicator.rb
View file @
a3431a26
...
@@ -241,11 +241,6 @@ module Gitlab
...
@@ -241,11 +241,6 @@ module Gitlab
consume_method
=
"consume_event_
#{
event_name
}
"
.
to_sym
consume_method
=
"consume_event_
#{
event_name
}
"
.
to_sym
raise
NotImplementedError
,
"Consume method not implemented: '
#{
consume_method
}
'"
unless
self
.
methods
.
include?
(
consume_method
)
raise
NotImplementedError
,
"Consume method not implemented: '
#{
consume_method
}
'"
unless
self
.
methods
.
include?
(
consume_method
)
# Inject model_record based on included class
if
model_record
event_data
[
:model_record
]
=
model_record
end
send
(
consume_method
,
**
event_data
)
# rubocop:disable GitlabSecurity/PublicSend
send
(
consume_method
,
**
event_data
)
# rubocop:disable GitlabSecurity/PublicSend
end
end
...
...
ee/spec/support/shared_examples/models/concerns/blob_replicator_strategy_shared_examples.rb
View file @
a3431a26
...
@@ -106,7 +106,7 @@ RSpec.shared_examples 'a blob replicator' do
...
@@ -106,7 +106,7 @@ RSpec.shared_examples 'a blob replicator' do
end
end
end
end
describe
'
#consume_event_created
'
do
describe
'
created event consumption
'
do
context
"when the blob's project is in replicables for this geo node"
do
context
"when the blob's project is in replicables for this geo node"
do
it
'invokes Geo::BlobDownloadService'
do
it
'invokes Geo::BlobDownloadService'
do
expect
(
replicator
).
to
receive
(
:in_replicables_for_geo_node?
).
and_return
(
true
)
expect
(
replicator
).
to
receive
(
:in_replicables_for_geo_node?
).
and_return
(
true
)
...
@@ -115,7 +115,7 @@ RSpec.shared_examples 'a blob replicator' do
...
@@ -115,7 +115,7 @@ RSpec.shared_examples 'a blob replicator' do
expect
(
service
).
to
receive
(
:execute
)
expect
(
service
).
to
receive
(
:execute
)
expect
(
::
Geo
::
BlobDownloadService
).
to
receive
(
:new
).
with
(
replicator:
replicator
).
and_return
(
service
)
expect
(
::
Geo
::
BlobDownloadService
).
to
receive
(
:new
).
with
(
replicator:
replicator
).
and_return
(
service
)
replicator
.
consume
_event_created
replicator
.
consume
(
:created
)
end
end
end
end
...
@@ -125,12 +125,16 @@ RSpec.shared_examples 'a blob replicator' do
...
@@ -125,12 +125,16 @@ RSpec.shared_examples 'a blob replicator' do
expect
(
::
Geo
::
BlobDownloadService
).
not_to
receive
(
:new
)
expect
(
::
Geo
::
BlobDownloadService
).
not_to
receive
(
:new
)
replicator
.
consume
_event_created
replicator
.
consume
(
:created
)
end
end
end
end
end
end
describe
'#consume_event_deleted'
do
describe
'deleted event consumption'
do
before
do
model_record
.
save!
end
let!
(
:model_record_id
)
{
replicator
.
model_record_id
}
let!
(
:model_record_id
)
{
replicator
.
model_record_id
}
let!
(
:blob_path
)
{
replicator
.
blob_path
}
let!
(
:blob_path
)
{
replicator
.
blob_path
}
let!
(
:deleted_params
)
{
{
model_record_id:
model_record_id
,
blob_path:
blob_path
}
}
let!
(
:deleted_params
)
{
{
model_record_id:
model_record_id
,
blob_path:
blob_path
}
}
...
@@ -145,7 +149,7 @@ RSpec.shared_examples 'a blob replicator' do
...
@@ -145,7 +149,7 @@ RSpec.shared_examples 'a blob replicator' do
# replicator does not hold an instance of ActiveRecord::Base, which helps
# replicator does not hold an instance of ActiveRecord::Base, which helps
# avoid a regression of
# avoid a regression of
# https://gitlab.com/gitlab-org/gitlab/-/issues/233040
# https://gitlab.com/gitlab-org/gitlab/-/issues/233040
let
(
:secondary_side_replicator
)
{
replicator
.
class
.
new
(
model_record
:
nil
,
model_record
_id:
model_record_id
)
}
let
(
:secondary_side_replicator
)
{
replicator
.
class
.
new
(
model_record_id:
model_record_id
)
}
it
'invokes Geo::FileRegistryRemovalService'
do
it
'invokes Geo::FileRegistryRemovalService'
do
service
=
double
(
:service
)
service
=
double
(
:service
)
...
@@ -154,7 +158,7 @@ RSpec.shared_examples 'a blob replicator' do
...
@@ -154,7 +158,7 @@ RSpec.shared_examples 'a blob replicator' do
expect
(
::
Geo
::
FileRegistryRemovalService
)
expect
(
::
Geo
::
FileRegistryRemovalService
)
.
to
receive
(
:new
).
with
(
secondary_side_replicator
.
replicable_name
,
model_record_id
,
blob_path
).
and_return
(
service
)
.
to
receive
(
:new
).
with
(
secondary_side_replicator
.
replicable_name
,
model_record_id
,
blob_path
).
and_return
(
service
)
secondary_side_replicator
.
consume
_event_deleted
(
deleted_params
)
secondary_side_replicator
.
consume
(
:deleted
,
deleted_params
)
end
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