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.references unique index on the state table and the FK unique index on the registry (ps_upload alias) to fit the 63-character limit.
  • registry_consistency_worker_spec patch 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

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:

  1. On the primary, enable the feature flag:

    Feature.enable(:geo_personal_snippet_upload_replication)
  2. Create a personal snippet with an attached file (via the snippets UI or in the Rails console).

  3. On the secondary, watch the registry get populated:

    Geo::PersonalSnippetUploadRegistry.last

    Confirm it transitions through `pending → started → synced` and that `verification_state` reaches `succeeded`.

  4. Confirm the file exists on the secondary's object storage / disk at the same path as the primary.

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

Edited by Douglas Barbosa Alexandre

Merge request reports

Loading