Geo: Replicate Organizations::OrganizationDetail uploads
What does this MR do and why?
Adds Geo SSF (self-service framework) replication and verification for the organization_detail_uploads partition table so Organizations::OrganizationDetail attachments (organization avatars) are mirrored from the primary to secondary Geo sites alongside the other upload partitions.
Generated with scripts/geo/generate-blob-replicator:
scripts/geo/generate-blob-replicator \
--replicable-name=organization_detail_upload \
--model-class=Organizations::OrganizationDetail \
--table-name=organization_detail_uploads \
--sharding-key=organization_id \
--milestone=19.2 \
--upload-partitionTwo adaptations were made on top of the generated output:
- 1:1 ownership.
Organizations::OrganizationDetailis 1:1 withOrganization(organization_idis its primary key), so the factory and selective-sync fixtures reuse a single detail per organization and setavatar: nil, ensuring the sharedGeo Framework selective sync behaviorexamples assert only on the tracked uploads. - Index name length. Registry and state index names are shortened to the
idx_od_upl_*convention to stay within PostgreSQL's 63-character identifier limit, matching the siblingvulnerability_export_uploadtables.
Selective sync uses the organization-only scope (parity with Geo::VulnerabilityExportUpload), since OrganizationDetail#uploads_sharding_key only ever sets organization_id.
References
- Closes #589913 (closed).
- Parent epic: &20933
How to set up and validate locally
Requires a primary + secondary Geo setup (e.g. two GDKs).
-
On both sites, run migrations:
bin/rake db:migrate db:migrate:geo -
On the primary, enable replication:
Feature.enable(:geo_organization_detail_upload_replication) -
Create an organization detail upload on the primary (UI: set an organization's avatar under Organization settings, or attach an upload to an
Organizations::OrganizationDetaildirectly). -
On the secondary, confirm the registry row was created and replication + verification succeeded:
Geo::OrganizationDetailUploadRegistry.last=> state:'synced', verification_state:'succeeded' -
Confirm the file is present at the secondary's upload path and that
verification_checksummatches the primary's. -
Optionally re-verify:
Geo::OrganizationDetailUploadRegistry.last.verification_pending!
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist.