Implement Geo support of Nuget Symbols behind a feature flag
What does this MR do and why?
This MR implements Geo replication and verification support for NuGet symbol files, enabling GitLab Geo secondary sites to replicate and verify NuGet debugging symbols across distributed installations.
Background:
NuGet symbol files (.pdb files) are debugging symbols that developers use to debug NuGet packages. Currently, these files are not replicated to Geo secondary sites, which means:
- Developers on secondary sites cannot access debugging symbols
- Symbol files are not verified for data integrity across Geo nodes
- Selective sync by namespace or shard doesn't work for symbol files
What this MR does:
-
Adds Geo replication infrastructure for
Packages::Nuget::Symbol:- Creates
Geo::PackagesNugetSymbolRegistryto track replication state - Creates
Geo::PackagesNugetSymbolStateto track verification state - Implements
Geo::PackagesNugetSymbolReplicatorusing the blob replication strategy
- Creates
-
Enables verification of NuGet symbols:
- Adds checksum calculation and verification for symbol files
- Tracks verification state (pending, succeeded, failed)
- Supports both local and object storage locations
-
Supports selective sync:
- Symbols can be selectively synced by namespace (group/project)
- Symbols can be selectively synced by storage shard
- Respects object storage sync settings
-
Feature flags for safe rollout:
-
geo_packages_nuget_symbol_replication- Controls replication functionality -
geo_packages_nuget_symbol_force_primary_checksumming- Controls verification on primary
-
Why this is needed:
This brings NuGet symbols to feature parity with other package files in Geo, ensuring developers on secondary sites have the same debugging capabilities as those on primary sites, while maintaining data integrity through verification.
References
Screenshots or screen recordings
N/A
How to set up and validate locally
Prerequisites
- Set up a local Geo environment with a primary and secondary node. Follow the Geo development setup guide.
Testing Replication
On the Primary Node:
-
Enable the feature flags in Rails console:
Feature.enable(:geo_packages_nuget_symbol_replication) Feature.enable(:geo_packages_nuget_symbol_force_primary_checksumming) -
Create a NuGet symbol file:
symbol = FactoryBot.create(:nuget_symbol) -
Verify the symbol was created and verification started:
symbol.reload symbol.packages_nuget_symbol_state # Should show verification_state as 'pending' or 'verification_succeeded'
On the Secondary Node:
-
Check that the registry entry was created:
Geo::PackagesNugetSymbolRegistry.count # Should be > 0 registry = Geo::PackagesNugetSymbolRegistry.last registry.packages_nuget_symbol_id # Should match the symbol ID from primary -
Trigger replication:
Geo::PackagesNugetSymbolReplicator.new(model_record_id: symbol.id).execute -
Verify the symbol was replicated:
registry.reload registry.state # Should be 'synced' registry.verification_state # Should be 'verification_succeeded'
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 #574044 (closed)