Create remote cache entries table for Maven virtual registry
Context
This MR implements the first step of repartitioning the Maven virtual registry cache by creating a new table virtual_registries_packages_maven_cache_remote_entries to replace the existing virtual_registries_packages_maven_cache_entries table.
What does this MR do and why?
- Creates the new table
virtual_registries_packages_maven_cache_remote_entrieswith improved partitioning strategy - Switches the partition key from the current setup to
group_id - Updates the primary key to
[group_id, iid] - Implements
iidas a unique column across partitions connected to a single sequence - Adds some basic indexes (more will follow)
References
Screenshots or screen recordings
N/A
How to set up and validate locally
Run the migration locally and in rails console you can test inserting rows into the new table:
# select or create an upstream
upstream = VirtualRegistries::Packages::Maven::Upstream.last || FactoryBot.create(:virtual_registries_packages_maven_upstream)
VirtualRegistries::Packages::Maven::Cache::Remote::Entry.create(group: upstream.group, upstream: upstream, size: 1024, relative_path: 'test/path.txt', file: 'dummy', object
_storage_key: 'dummy', file_sha1: 'abcdefghijklmnqrstuv')
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #583723
Edited by Moaz Khalifa