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_upl prefix) 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 its id, since the parent uploads table has a composite primary key.
  • Override Geo::VulnerabilityExportUploadRegistry.model_updated_last to :created_at because partition tables don't carry updated_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

How to set up and validate locally

  1. Run migrations on a primary + secondary Geo setup:

    bin/rake db:migrate db:migrate:geo
  2. In the primary's rails console, enable replication:

    Feature.enable(:geo_vulnerability_export_upload_replication)
  3. Create a Vulnerabilities::Export with an attached file on the primary (e.g. via Vulnerabilities::Exports::ExportService or by triggering a vulnerability export from the UI).

  4. On the secondary, confirm the registry row is created and synced:

    Geo::VulnerabilityExportUploadRegistry.last
    # => state: 'synced', verification_state: 'succeeded'
  5. Confirm the file is present at the secondary's upload path and that verification_checksum matches the primary's checksum.

  6. 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.

Merge request reports

Loading