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
0a93fe5d
Commit
0a93fe5d
authored
Mar 23, 2018
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Geo: Recovery from temporary directory doesn't work if the namespace directory doesn't exist
parent
2e8135d0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
ee/app/services/geo/base_sync_service.rb
ee/app/services/geo/base_sync_service.rb
+2
-0
ee/spec/services/geo/repository_sync_service_spec.rb
ee/spec/services/geo/repository_sync_service_spec.rb
+11
-4
No files found.
ee/app/services/geo/base_sync_service.rb
View file @
0a93fe5d
...
...
@@ -211,6 +211,8 @@ module Geo
raise
Gitlab
::
Shell
::
Error
,
'Can not move original repository out of the way'
end
gitlab_shell
.
add_namespace
(
project
.
repository_storage_path
,
repository
.
disk_path
)
unless
gitlab_shell
.
mv_repository
(
project
.
repository_storage_path
,
disk_path_temp
,
repository
.
disk_path
)
raise
Gitlab
::
Shell
::
Error
,
'Can not move temporary repository'
end
...
...
ee/spec/services/geo/repository_sync_service_spec.rb
View file @
0a93fe5d
...
...
@@ -254,14 +254,21 @@ describe Geo::RepositorySyncService do
expect
(
subject
).
to
receive
(
:sync_repository
).
with
(
true
).
and_call_original
expect
(
subject
.
gitlab_shell
).
to
receive
(
:mv_repository
).
exactly
(
2
).
times
.
and_call_original
expect
(
subject
.
gitlab_shell
).
to
receive
(
:add_namespace
).
with
(
project
.
repository_storage_path
,
"@failed-geo-sync/
#{
repository
.
disk_path
}
"
).
and_call_original
expect
(
subject
.
gitlab_shell
).
to
receive
(
:add_namespace
).
with
(
project
.
repository_storage_path
,
repository
.
disk_path
).
and_call_original
expect
(
subject
.
gitlab_shell
).
to
receive
(
:remove_repository
).
exactly
(
2
).
times
.
and_call_original
subject
.
execute
# gitlab-shell always appends .git to the end of the repository, so
# we're relying on the fact that projects can't contain + in the name
deleted_dir
=
File
.
join
(
project
.
repository_storage_path
,
project
.
path
)
+
"+failed-geo-sync.git"
expect
(
File
.
directory?
(
deleted_dir
)).
to
be
false
expect
(
File
.
directory?
(
project
.
repository
.
path
)).
to
be
true
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