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
a878cf13
Commit
a878cf13
authored
Sep 20, 2016
by
Alejandro Rodríguez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set a low IO priority for storage moves to lower performance impact
parent
894d8c16
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
1 deletion
+17
-1
CHANGELOG
CHANGELOG
+3
-0
lib/gitlab_projects.rb
lib/gitlab_projects.rb
+11
-1
spec/gitlab_projects_spec.rb
spec/gitlab_projects_spec.rb
+3
-0
No files found.
CHANGELOG
View file @
a878cf13
v3.6.1
- Set a low IO priority for storage moves to lower performance impact
v3.6.0
- Added full support for `git-lfs-authenticate` to properly handle LFS requests and pass them on to Workhorse
...
...
lib/gitlab_projects.rb
View file @
a878cf13
...
...
@@ -316,7 +316,17 @@ class GitlabProjects
if
wait_for_pushes
$logger
.
info
"Syncing project
#{
@project_name
}
from <
#{
full_path
}
> to <
#{
new_full_path
}
>."
system
(
*
%W(rsync -a --delete
#{
source_path
}
#{
new_full_path
}
)
)
# Set a low IO priority with ionice to not choke the server on moves
rsync_path
=
'ionice -c2 -n7 rsync'
result
=
system
(
*
%W(
#{
rsync_path
}
-a --delete --rsync-path="
#{
rsync_path
}
"
#{
source_path
}
#{
new_full_path
}
)
)
unless
result
# If the command fails with `ionice` (maybe because we're on a OS X
# development machine), try again without `ionice`.
rsync_path
=
'rsync'
system
(
*
%W(
#{
rsync_path
}
-a --delete --rsync-path="
#{
rsync_path
}
"
#{
source_path
}
#{
new_full_path
}
)
)
end
else
$logger
.
error
"mv-storage failed: source path <
#{
full_path
}
> is waiting for pushes to finish."
false
...
...
spec/gitlab_projects_spec.rb
View file @
a878cf13
...
...
@@ -212,6 +212,7 @@ describe GitlabProjects do
before
do
FileUtils
.
mkdir_p
(
tmp_repo_path
)
FileUtils
.
mkdir_p
(
File
.
join
(
tmp_repo_path
,
'hooks'
))
# Add some contents to copy
FileUtils
.
mkdir_p
(
alternative_storage_path
)
allow_any_instance_of
(
GitlabReferenceCounter
).
to
receive
(
:value
).
and_return
(
0
)
end
...
...
@@ -222,6 +223,8 @@ describe GitlabProjects do
File
.
exists?
(
tmp_repo_path
).
should
be_true
gl_projects
.
exec
File
.
exists?
(
new_repo_path
).
should
be_true
# Make sure the target directory isn't empty (i.e. contents were copied)
FileUtils
.
cd
(
new_repo_path
)
{
Dir
[
'**/*'
].
length
.
should_not
be
(
0
)
}
end
it
"should fail if no destination path is provided"
do
...
...
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