Optimize garbage collection process
What does this MR do and why?
Contributes to #429514 (closed)
Enumeration of LFS pointers is likely to be faster when housekeeping ran first in a repository that is in bad state overall. source
Problem
The garbage collection process consists of multiple commands. Currently,
we call ListLFSPointers
RPC before OptimizeRepository
Gitaly RPC.
For large projects with many LFS files, ListLFSPointers
call might take
a significant time. It prevents OptimizeRepository
call from being
executed. As a result, a user cannot run the Housekeeping task for the
project.
Solution
OptimizeRepository
calls can significantly improve the performance of
ListLFSPointers
if we run it first.
This commit changes the order of the Gitaly calls execution to resolve the problem with blocked Housekeeping task.