Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-shell
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
0
Merge Requests
0
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-shell
Commits
32ebd136
Commit
32ebd136
authored
Oct 07, 2016
by
Yorick Peterse
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix-ionice-again' into 'master'
Fix rsync with ionice command building See merge request !97
parents
ca7c80ce
47723a68
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
9 deletions
+11
-9
CHANGELOG
CHANGELOG
+1
-0
lib/gitlab_projects.rb
lib/gitlab_projects.rb
+7
-6
spec/gitlab_projects_spec.rb
spec/gitlab_projects_spec.rb
+3
-3
No files found.
CHANGELOG
View file @
32ebd136
v3.6.4
v3.6.4
- Fix rsync with ionice command building
- Fix short circuit logic between rsync with and without ionice for storage migrations
- Fix short circuit logic between rsync with and without ionice for storage migrations
v3.6.3
v3.6.3
...
...
lib/gitlab_projects.rb
View file @
32ebd136
...
@@ -318,16 +318,12 @@ class GitlabProjects
...
@@ -318,16 +318,12 @@ class GitlabProjects
$logger
.
info
"Syncing project
#{
@project_name
}
from <
#{
full_path
}
> to <
#{
new_full_path
}
>."
$logger
.
info
"Syncing project
#{
@project_name
}
from <
#{
full_path
}
> to <
#{
new_full_path
}
>."
# Set a low IO priority with ionice to not choke the server on moves
# Set a low IO priority with ionice to not choke the server on moves
rsync_path
=
'ionice -c2 -n7 rsync'
if
rsync
(
source_path
,
new_full_path
,
'ionice -c2 -n7 rsync'
)
result
=
system
(
*
%W(
#{
rsync_path
}
-a --delete --rsync-path="
#{
rsync_path
}
"
#{
source_path
}
#{
new_full_path
}
)
)
if
result
true
true
else
else
# If the command fails with `ionice` (maybe because we're on a OS X
# If the command fails with `ionice` (maybe because we're on a OS X
# development machine), try again without `ionice`.
# development machine), try again without `ionice`.
rsync_path
=
'rsync'
rsync
(
source_path
,
new_full_path
)
system
(
*
%W(
#{
rsync_path
}
-a --delete --rsync-path="
#{
rsync_path
}
"
#{
source_path
}
#{
new_full_path
}
)
)
end
end
else
else
$logger
.
error
"mv-storage failed: source path <
#{
full_path
}
> is waiting for pushes to finish."
$logger
.
error
"mv-storage failed: source path <
#{
full_path
}
> is waiting for pushes to finish."
...
@@ -393,4 +389,9 @@ class GitlabProjects
...
@@ -393,4 +389,9 @@ class GitlabProjects
def
gitlab_reference_counter
def
gitlab_reference_counter
@gitlab_reference_counter
||=
GitlabReferenceCounter
.
new
(
full_path
)
@gitlab_reference_counter
||=
GitlabReferenceCounter
.
new
(
full_path
)
end
end
def
rsync
(
src
,
dest
,
rsync_path
=
'rsync'
)
command
=
rsync_path
.
split
+
%W(-a --delete --rsync-path="
#{
rsync_path
}
"
#{
src
}
#{
dest
}
)
system
(
*
command
)
end
end
end
spec/gitlab_projects_spec.rb
View file @
32ebd136
...
@@ -229,7 +229,7 @@ describe GitlabProjects do
...
@@ -229,7 +229,7 @@ describe GitlabProjects do
it
"should attempt rsync with ionice first"
do
it
"should attempt rsync with ionice first"
do
expect
(
gl_projects
).
to
receive
(
:system
).
with
(
expect
(
gl_projects
).
to
receive
(
:system
).
with
(
'ionice
-c2 -n7
rsync'
,
'-a'
,
'--delete'
,
'--rsync-path="ionice -c2 -n7 rsync"'
,
'ionice
'
,
'-c2'
,
'-n7'
,
'
rsync'
,
'-a'
,
'--delete'
,
'--rsync-path="ionice -c2 -n7 rsync"'
,
"
#{
tmp_repo_path
}
/"
,
new_repo_path
"
#{
tmp_repo_path
}
/"
,
new_repo_path
).
and_return
(
true
)
).
and_return
(
true
)
...
@@ -238,7 +238,7 @@ describe GitlabProjects do
...
@@ -238,7 +238,7 @@ describe GitlabProjects do
it
"should attempt rsync without ionice if with ionice fails"
do
it
"should attempt rsync without ionice if with ionice fails"
do
expect
(
gl_projects
).
to
receive
(
:system
).
with
(
expect
(
gl_projects
).
to
receive
(
:system
).
with
(
'ionice
-c2 -n7
rsync'
,
'-a'
,
'--delete'
,
'--rsync-path="ionice -c2 -n7 rsync"'
,
'ionice
'
,
'-c2'
,
'-n7'
,
'
rsync'
,
'-a'
,
'--delete'
,
'--rsync-path="ionice -c2 -n7 rsync"'
,
"
#{
tmp_repo_path
}
/"
,
new_repo_path
"
#{
tmp_repo_path
}
/"
,
new_repo_path
).
and_return
(
false
)
).
and_return
(
false
)
...
@@ -251,7 +251,7 @@ describe GitlabProjects do
...
@@ -251,7 +251,7 @@ describe GitlabProjects do
it
"should fail if both rsync attempts fail"
do
it
"should fail if both rsync attempts fail"
do
expect
(
gl_projects
).
to
receive
(
:system
).
with
(
expect
(
gl_projects
).
to
receive
(
:system
).
with
(
'ionice
-c2 -n7
rsync'
,
'-a'
,
'--delete'
,
'--rsync-path="ionice -c2 -n7 rsync"'
,
'ionice
'
,
'-c2'
,
'-n7'
,
'
rsync'
,
'-a'
,
'--delete'
,
'--rsync-path="ionice -c2 -n7 rsync"'
,
"
#{
tmp_repo_path
}
/"
,
new_repo_path
"
#{
tmp_repo_path
}
/"
,
new_repo_path
).
and_return
(
false
)
).
and_return
(
false
)
...
...
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