Allow admin to run garbage collection with zero downtime
# :warning: This epic covered automatic, online garbage collection for `GitLab.com`. For the introduction of this (and other features) to self manged, see this epic: https://gitlab.com/groups/gitlab-org/-/epics/5521+ # :warning: ## Problem to solve The current implementation of the Container Registry requires that the registry is set to read-only mode or down completely. This is problematic for organizations that operate on a large scale and can result in the overuse of object storage. This epic is focused on adding support for online garbage collection, which will remove the need to schedule any downtime. ## Tasks These are the high-level actions we expect to be required. There will be sub-tasks not yet listed here, as well as planning/discussion tasks that should precede some of them. We'll be creating issues for these as the plan matures and the discussion tasks complete. 1. [x] [Define metadata database schema](https://gitlab.com/gitlab-org/gitlab/-/issues/207147) 1. [x] [Create database migrations](https://gitlab.com/gitlab-org/container-registry/-/issues/53) 1. [x] [Create CRUD service layer for database entities](https://gitlab.com/gitlab-org/container-registry/-/issues/63) 1. [x] [Create a tool to scan and mirror filesystem metadata to the database](https://gitlab.com/gitlab-org/container-registry/-/issues/56) 1. [x] [Estimate database size requirements](https://gitlab.com/gitlab-org/container-registry/-/issues/61) 1. [x] [Mirror API write operations to the database](&3006) 1. [x] [Switch API read operations from the filesystem to the database](&3007) 1. [x] [Estimate database rate requirements](https://gitlab.com/gitlab-org/container-registry/-/issues/94) 1. [x] [Discussion/review of the database schema and migrations](https://gitlab.com/gitlab-org/container-registry/-/issues/104) 1. [x] [Discussion of the database and application deployment strategy](https://gitlab.com/gitlab-com/gl-infra/delivery/-/issues/1058) 1. [x] [Implement schema improvements to allow for partitioning and greater efficiency](https://gitlab.com/gitlab-org/container-registry/-/issues/206) 1. [x] [Add support for background database migrations](https://gitlab.com/gitlab-org/container-registry/-/issues/221) 1. [x] [Implement online garbage collection](https://gitlab.com/groups/gitlab-org/-/epics/5024) ## Cross-group dependencies 1. [x] Database schema review/improvement with Database team: https://gitlab.com/gitlab-org/container-registry/-/issues/104
epic