Geo: Replicate Group uploads (namespace_uploads)
> **📋 Phase 2: High-Volume Core Partitions** | Risk: **High** | [View Epic &20933](https://gitlab.com/groups/gitlab-org/-/work_items/20933) > > ⚠️ **Group-level uploads** - high usage --- ## Replicate Group Uploads - Blob This issue is for implementing Geo replication and verification of Group Uploads. **Model:** `Group` **Table Name:** `namespace_uploads` **Sharding Key:** `namespace_id` For more background, see [Geo self-service framework](https://docs.gitlab.com/ee/development/geo/framework.html). In order to implement and test this feature, you need to first [set up Geo locally](https://gitlab.com/gitlab-org/gitlab-development-kit/blob/main/doc/howto/geo.md). ### Modify database schemas to prepare to add Geo support #### Add the registry table to track replication and verification state - [ ] Create the migration file in `ee/db/geo/migrate` - [ ] Add the new table to the database dictionary in `ee/db/geo/docs/` - [ ] Run Geo tracking database migrations - [ ] Commit changes in `ee/db/geo/structure.sql` #### Add verification state fields on the Geo primary site - [ ] Create the states table migration file in `db/migrate` - [ ] Add the new table to the database dictionary in `db/docs/` - [ ] Run database migrations - [ ] Commit changes in `db/structure.sql` ### Implement Geo support behind a feature flag #### Step 1. Implement replication and verification - [ ] Add `Geo::ReplicableModel` and `Geo::VerifiableModel` to the model - [ ] Implement `selective_sync_scope` method - [ ] Add model specs with shared examples - [ ] Create the Replicator class in `ee/app/replicators/geo/` - [ ] Generate the feature flag definition file - [ ] Add replicator class to `REPLICATOR_CLASSES` in `ee/lib/gitlab/geo.rb` - [ ] Create replicator specs - [ ] Create the Registry model in `ee/app/models/geo/` - [ ] Update `REGISTRY_CLASSES` in `ee/app/workers/geo/secondary/registry_consistency_worker.rb` - [ ] Create registry factory and specs - [ ] Create the State model in `ee/app/models/geo/` #### Step 2. Implement metrics gathering - [ ] Add fields to Geo Node Status in `doc/api/geo_nodes.md` - [ ] Add fields to API schema fixtures - [ ] Add Sidekiq metrics to documentation - [ ] Run `geo:dev:ssf_metrics` rake task #### Step 3. Implement the GraphQL API - [ ] Add field to `GeoNodeType` - [ ] Create resolver, finder, and type classes - [ ] Add integration tests - [ ] Update GraphQL reference documentation #### Step 4. Handle batch destroy - [ ] Ensure batch destroy is replicated to secondary sites - [ ] Add specs for `Geo::Event` creation on destroy ### Release Geo support - [ ] Set `default_enabled: true` in feature flag - [ ] Remove `alpha` option from GraphQL type - [ ] Update documentation ## Related - Parent epic: &20933 - MR: !221773
issue