File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 1+ v3.6.1
2+ - Set a low IO priority for storage moves to lower performance impact
3+
14v3.6.0
25 - Added full support for `git-lfs-authenticate` to properly handle LFS requests and pass them on to Workhorse
36
Original file line number Diff line number Diff line change @@ -316,7 +316,17 @@ def mv_storage
316316
317317 if wait_for_pushes
318318 $logger. info "Syncing project #{ @project_name } from <#{ full_path } > to <#{ new_full_path } >."
319- system ( *%W( rsync -a --delete #{ source_path } #{ new_full_path } ) )
319+
320+ # Set a low IO priority with ionice to not choke the server on moves
321+ rsync_path = 'ionice -c2 -n7 rsync'
322+ result = system ( *%W( #{ rsync_path } -a --delete --rsync-path="#{ rsync_path } " #{ source_path } #{ new_full_path } ) )
323+
324+ unless result
325+ # If the command fails with `ionice` (maybe because we're on a OS X
326+ # development machine), try again without `ionice`.
327+ rsync_path = 'rsync'
328+ system ( *%W( #{ rsync_path } -a --delete --rsync-path="#{ rsync_path } " #{ source_path } #{ new_full_path } ) )
329+ end
320330 else
321331 $logger. error "mv-storage failed: source path <#{ full_path } > is waiting for pushes to finish."
322332 false
Original file line number Diff line number Diff line change 212212
213213 before do
214214 FileUtils . mkdir_p ( tmp_repo_path )
215+ FileUtils . mkdir_p ( File . join ( tmp_repo_path , 'hooks' ) ) # Add some contents to copy
215216 FileUtils . mkdir_p ( alternative_storage_path )
216217 allow_any_instance_of ( GitlabReferenceCounter ) . to receive ( :value ) . and_return ( 0 )
217218 end
222223 File . exists? ( tmp_repo_path ) . should be_true
223224 gl_projects . exec
224225 File . exists? ( new_repo_path ) . should be_true
226+ # Make sure the target directory isn't empty (i.e. contents were copied)
227+ FileUtils . cd ( new_repo_path ) { Dir [ '**/*' ] . length . should_not be ( 0 ) }
225228 end
226229
227230 it "should fail if no destination path is provided" do
You can’t perform that action at this time.
0 commit comments