Geo: Replicate Vulnerabilities::Export uploads
What does this MR do and why?
Add Geo SSF (self-service framework) replication and verification for the vulnerability_export_uploads partition table, so vulnerability export attachments are mirrored from the primary to secondary Geo sites alongside other upload types.
Generated with scripts/geo/generate-blob-replicator and adjusted to match the upload-partition pattern established in !229718 (merged):
- Shorten Postgres identifiers (
ve_uplprefix) to fit the 63-character limit on the registry, state, and partition indexes. - Point the upload-states foreign key at the partition table (
vulnerability_export_uploads) and add a unique index on itsid, since the parentuploadstable has a composite primary key. - Override
Geo::VulnerabilityExportUploadRegistry.model_updated_lastto:created_atbecause partition tables don't carryupdated_at.
Replication is gated by the ops feature flag geo_vulnerability_export_upload_replication (default disabled); flipping it on for general availability is tracked separately under the parent epic.
References
- Related to #589921 (closed).
- Generator updates: !233498 (merged) (Update Geo SSF Blob Generator script).
- Parent epic: &20933 (per-upload-partition Geo replication).
How to set up and validate locally
-
Run migrations on a primary + secondary Geo setup:
bin/rake db:migrate db:migrate:geo -
In the primary's rails console, enable replication:
Feature.enable(:geo_vulnerability_export_upload_replication) -
Create a
Vulnerabilities::Exportwith an attached file on the primary (e.g. viaVulnerabilities::Exports::ExportServiceor by triggering a vulnerability export from the UI). -
On the secondary, confirm the registry row is created and synced:
Geo::VulnerabilityExportUploadRegistry.last # => state: 'synced', verification_state: 'succeeded' -
Confirm the file is present at the secondary's upload path and that
verification_checksummatches the primary's checksum. -
Optionally, force a re-verification:
Geo::VulnerabilityExportUploadRegistry.last.verification_pending!
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.