Commit 57373d44 authored by Nick Thomas's avatar Nick Thomas

Do git gc, not repack, after moving a repository between shards

parent a4f730c5
...@@ -92,13 +92,14 @@ module Projects ...@@ -92,13 +92,14 @@ module Projects
end end
# The underlying FetchInternalRemote call uses a `git fetch` to move data # The underlying FetchInternalRemote call uses a `git fetch` to move data
# to the new repository, which leaves it in a less-well-packed state and # to the new repository, which leaves it in a less-well-packed state,
# lacking bitmaps. Housekeeping will boost performance significantly. # lacking bitmaps and commit graphs. Housekeeping will boost performance
# significantly.
def enqueue_housekeeping def enqueue_housekeeping
return unless Gitlab::CurrentSettings.housekeeping_enabled? return unless Gitlab::CurrentSettings.housekeeping_enabled?
return unless Feature.enabled?(:repack_after_shard_migration, project) return unless Feature.enabled?(:repack_after_shard_migration, project)
Projects::HousekeepingService.new(project, :full_repack).execute Projects::HousekeepingService.new(project, :gc).execute
rescue Projects::HousekeepingService::LeaseTaken rescue Projects::HousekeepingService::LeaseTaken
# No action required # No action required
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment