Draft: Implement behavior of org migration target cell

Summary

Introduces the concept of an "org migration target cell" - a cell that is receiving an organization via Geo replication during organization migration. This is a key building block for the Org Mover feature.

What's included

Core concept

An org migration target cell:

  • Behaves like a Geo secondary for replication and verification
  • Does NOT proxy requests to the primary (requests go directly to the source cell)
  • Does NOT OAuth against the primary
  • Is identified by: primary = false AND selective_sync_by_organizations?

Key changes

GeoNode model (ee/app/models/geo_node.rb):

  • org_migration_target? - returns true if cell is receiving org migration
  • secondary? - now returns false for org migration targets
  • secondary_or_org_migration_target? - combined check for code that needs both

Gitlab::Geo module (ee/lib/gitlab/geo.rb):

  • Gitlab::Geo.org_migration_target?
  • Gitlab::Geo.secondary_or_org_migration_target?
  • Gitlab::Geo.replica_org?/namespace?/project? - check if data belongs to replica

Various workers/services - Changed secondary? to secondary_or_org_migration_target? where the behavior should apply to both

Design decision

We infer org migration target status from selective sync by organizations rather than adding an explicit org_migration_target column to geo_nodes. This keeps Org Mover as a distinct feature set that leverages Geo's existing selective sync infrastructure.

Bug fixes included

  • Fix EE::ProjectCacheWorker to pass explicit parameters (was using splat but referencing undefined project_id)
  • Fix Geo status update NOT NULL violation for created_at/updated_at

References

MR Status
Org migration target cell: Add foundation (!223454)
Org migration target cell: Core Rails behavior (!225219)
Draft: Implement behavior of org migration target cell (!219850) You are here

How to set up and validate locally

See gitlab-development-kit!5555

Run the end-to-end script which installs GDK from scratch and actually uses the final Rails MR Draft: Implement behavior of org migration target cell (!219850):

# Set your license (required - Premium or Ultimate)
export GITLAB_ACTIVATION_CODE="your-activation-code"
# OR
export GITLAB_LICENSE_FILE="/path/to/license.gitlab-license"

# Optional: customize branches (these are the defaults)
export GDK_BRANCH="mk/gdk-org-configure-replication"
export GITLAB_BRANCH="mk/org-migration-target"

# Run from an empty directory
mkdir org-migration-test && cd org-migration-test

# Download and run the script
curl -fsSL "https://gitlab.com/gitlab-org/gitlab-development-kit/-/raw/mk/gdk-org-configure-replication/support/cells/org-migration-install" -o org-migration-install
chmod +x org-migration-install
./org-migration-install
Edited by Michael Kozono

Merge request reports

Loading