Skip to content

Add CleanAction to clean up unused repositories

John Cai requested to merge jc-clean-unused-repos into master

Currently, in the internal/praefect/repocleaner package, there is a Runner that periodically crawls through each gitaly node's repositories and checks if they are tracked by praefect. If not, that means it's not in use at all and can be cleaned up.

In !4449 (merged), we added a grace period so that we don't accidentally mark repositories that have just created and are in flight as unmanaged by praefect

We now would like to actually quarantine those unused repositories to another location so sysadmins can go in and clean them up. This MR makes several changes. ted a record in the database.

  1. Add a CleanRepos RPC that takes care of moving old repositories into a folder lost+found under the storage root.
  2. Add an CleanAction that will call CleanRepos

NOTE: This MR does not make use of the CleanAction just yet. We'll just continue to log the repositories that are not managed by praefect.

Edited by John Cai

Merge request reports