Future-proofing Git repository maintenance
Mar 20, 2023Patrick Steinhardt11 min read
Opens about.gitlab.comWhat the post covers
This post details the revamp of GitLab's repository housekeeping strategy within Gitaly.
- It explains the limitations of the previous client-driven RPC-based approach, especially for monorepositories, and introduces the new `OptimizeRepository` RPC.
- This RPC acts as a black-box, analyzing the repository's on-disk state to intelligently perform maintenance tasks like packing objects, pruning objects, packing references, and updating auxiliary data structures.
- The post also covers the rollout of this new strategy to GitLab.com, highlighting performance improvements and the iterative nature of refining the heuristics.

