Skip to content

Geo: Remove push_from_secondary route

Why are we doing this work

Still relevant to Geo and more so due to Unified URL

Copied from the related ticket:

When a Geo secondary receives a Git fetch request, and it redirects it to the Geo primary, it should use a URL that is agnostic of the "push"/"pull" action.

$ git clone http://gdk.test:3001/snippets/21.git
Cloning into '21'...
warning: redirecting to http://gdk.test:3000/-/push_from_secondary/2/snippets/21.git/
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 6 (delta 0), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (6/6), done.

See: warning: redirecting to http://gdk.test:3000/-/push_from_secondary/2/snippets/21.git/

push_from_secondary may be confusing to developers since they only "cloned".

Relevant links

#292690 (closed) -> Adds and uses the route from_secondary

Non-functional requirements

  • Documentation:
  • Feature flag:
  • Performance:
  • Testing:

Implementation plan

Remove push_from_secondary route.

For backward compatibility, this change must land in the release after #292690 (closed), or later.

Verification steps

Steps to reproduce

The example in the description will not be reproducible after #292688 (closed) is fixed. So here is another way:

  1. SSH into Geo secondary
  2. gitlab-ctl stop geo-logcursor
  3. gitlab-ctl stop sidekiq
  4. Create a project with a repo on the Geo primary
  5. Copy the Git clone URL from the primary
  6. Wait long enough to ensure the Postgres DB is replicated (should be instant with test instances)
  7. git clone <Git clone URL but edit it to request the secondary>

Since the project repo is not yet replicated, the request to the secondary will be redirected to the primary. Git will tell you you are being

Edited by Michael Hofer