Skip to content

Resolve "Git LFS: Support for HTTP git push to secondary"

What does this MR do?

  • Adds support for HTTP git-lfs push (batch upload) and locks (verify, lock and unlock) to secondary which are then redirected to the primary
  • Validates git-lfs version of 2.4.2 (or greater) is used as https://github.com/git-lfs/git-lfs/releases/tag/v2.4.2 contains the necessary redirection fixes

Are there points in the code the reviewer needs to double check?

N/A

Why was this MR needed?

Deliver https://gitlab.com/gitlab-org/gitlab-ee/issues/6195

Screenshots (if relevant)

git-lfs

Setup used

$ git remote -v
secondary	http://localhost:3002/twitter/flight.git (fetch)
secondary	http://localhost:3002/twitter/flight.git (push)

http://localhost:3001 is the primary.

Read-only

$ git push secondary master
Tracking "1529388262.lfs"
[master 020dc74] CP
 2 files changed, 4 insertions(+)
 create mode 100644 1529388262.lfs
warning: redirecting to http://localhost:3001/twitter/flight.git/
batch response: You cannot perform write operations on a read-only instance
Uploading LFS objects:   0% (0/3), 0 B | 0 B/s, done
error: failed to push some refs to 'http://localhost:3002/twitter/flight.git'

Redirection

$ git push secondary master
Tracking "1528867645.lfs"
[master f2c6b88] Commit message here
 2 files changed, 4 insertions(+)
 create mode 100644 1528867645.lfs
warning: redirecting to http://localhost:3001/twitter/flight.git/
Uploading LFS objects: 100% (3/3), 3.1 MB | 172 KB/s, done
To http://localhost:3002/twitter/flight.git
   44eb3a2..f2c6b88  master -> master

Outdated git-lfs version

I used git-lfs 2.4.1, where as 2.4.2 (or greater) is required:

$ git push secondary master
Tracking "1528867474.lfs"
[master 8df7116] Commit message here
 2 files changed, 4 insertions(+)
 create mode 100644 1528867474.lfs
warning: redirecting to http://localhost:3001/twitter/flight.git/
batch response: You need git-lfs version 2.4.2 (or greater) to continue.  Please visit https://git-lfs.github.com
Uploading LFS objects:   0% (0/1), 0 B | 0 B/s, done
error: failed to push some refs to 'http://localhost:3002/twitter/flight.git'

Does this MR meet the acceptance criteria?

  • Changelog entry added, if necessary
  • Documentation created/updated
  • [ ] API support added
  • Tests added for this feature/bug
  • Conform by the code review guidelines
    • [ ] Has been reviewed by a UX Designer
    • [ ] Has been reviewed by a Frontend maintainer
    • Has been reviewed by a Backend maintainer
    • [ ] Has been reviewed by a Database specialist
  • EE specific content should be in the top level /ee folder
  • Conform by the merge request performance guides
  • Conform by the style guides
  • If you have multiple commits, please combine them into a few logically organized commits by squashing them
  • [ ] Internationalization required/considered
  • [ ] If paid feature, have we considered GitLab.com plan and how it works for groups and is there a design for promoting it to users who aren't on the correct plan
  • End-to-end tests pass (package-qa manual pipeline job)

What are the relevant issue numbers?

CE portion - https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/19728

Closes #6195 (closed)

Edited by Ash McKenzie

Merge request reports