Geo: Replicate AbuseReport uploads (abuse_report_uploads)

📋 Phase 1: Foundation & First Replicator (POC) | Risk: Low | View Epic &20933

🎯 First replicator - validates the pattern for remaining 22 partitions


Replicate AbuseReport Uploads - Blob

This issue is for implementing Geo replication and verification of AbuseReport Uploads.

Model: AbuseReport Table Name: abuse_report_uploads Sharding Key: organization_id

For more background, see Geo self-service framework.

In order to implement and test this feature, you need to first set up Geo locally.

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
Edited by 🤖 GitLab Bot 🤖