Container: redo partitioning of virtual_registries_container_cache_entries
Goals: * rename table `virtual_registries_container_cache_entries` into `virtual_registries_container_cache_remote_entries`. * switch the partition key to `group_id`. * switch the primary key to `[group_id, iid]`. * `iid` is a unique column across partitions. In all partitions, it needs to be connected to the single same sequence. Implementation plan: * milestone _m_ * (MR 1) Create the table `virtual_registries_container_cache_remote_entries` with the correct partitioning. * (MR 1) Add the unique indexes (for example the object storage key). * (MR 2) Create the new ~backend model class to point to the new table. * (MR 2) Update the ~backend queries to make sure that a `group_id` condition is actually used in the queries. * (MR 2) Add any necessary index required by queries. * (MR 3) Orphan entries cleanup worker / cron worker to handle `status: pending_destruction` from `virtual_registries_container_cache_remote_entries` / the old model class. * (MR 3) Make sure to handle all todos (`TODO: uncomment when https://gitlab.com/gitlab-org/gitlab/-/work_items/583726 is done`) added in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/216700 * milestone _m+2 or more_ (we use a full milestone to make sure that the orphan cleanup worker remove all rows from the old table) * (Sanity check) Make sure that `virtual_registries_container_cache_entries` is empty. * (MR 4) Drop the `virtual_registries_container_cache_entries` table in a post deployment migration (https://docs.gitlab.com/development/migration_style_guide/#dropping-a-database-table). * (MR 4) Remove the old model class pointing to `virtual_registries_container_cache_entries`. * (MR 4) Update orphan entries cleanup worker and/or parent cron worker to no longer support the old table/model class.
task