Geo - Replicate PersonalSnippet uploads
What does this MR do and why?
Add Geo SSF (self-service framework) replication and verification for the snippet_uploads partition table (PersonalSnippet model), so personal snippet attachments are mirrored from the primary to secondary Geo sites alongside other upload types.
Generated with scripts/geo/generate-blob-replicator and adjusted for PersonalSnippet specifics:
- Shorten Postgres identifiers for the
t.referencesunique index on the state table and the FK unique index on the registry (ps_uploadalias) to fit the 63-character limit. registry_consistency_worker_specpatch fixed to use the correct factory name:geo_personal_snippet_upload(generator emitted:geo_personal_snippet).
Selective sync uses the organization_id sharding key directly via the parent factory's organization: keyword — no parent-hierarchy workaround needed (unlike #589912 (closed) and #589904 (closed)).
Replication is gated by the ops feature flag geo_personal_snippet_upload_replication (default disabled); flipping it on for general availability is tracked separately under the parent epic.
Changelog: added EE: true
References
- Relates to #589914 (closed)
- Parent epic: gitlab-org#20933 (per-upload-partition Geo replication)
How to set up and validate locally
Validation requires a local Geo setup (primary + secondary), and make sure you run geo migrations with: rails db:migrate:geo. Then:
-
On the primary, enable the feature flag:
Feature.enable(:geo_personal_snippet_upload_replication) -
Create a personal snippet with an attached file (via the snippets UI or in the Rails console).
-
On the secondary, watch the registry get populated:
Geo::PersonalSnippetUploadRegistry.lastConfirm it transitions through `pending → started → synced` and that `verification_state` reaches `succeeded`.
-
Confirm the file exists on the secondary's object storage / disk at the same path as the primary.
-
Spot-check the GraphQL API:
{ geoNode(name: "<secondary-name>") { personalSnippetUploadRegistries { nodes { id state } } } }
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.