Geo: Secondary-first MRs
This is a more actionable and less hand-waving proposal as a spin-off from https://gitlab.com/gitlab-org/gitlab-ee/issues/8353.
In https://gitlab.com/gitlab-org/gitlab-ce/issues/4013 there is the proposal of cross-server (federated) merge requests. It is something we, and the wider community would like to have, but we cannot commercially justify to work on. So why don't we build it as part of a Geo feature?
Proposal
Geo is a GitLab feature to bring users closer to their code, geographically. But the code they write in feature branches, they still need to push to a primary in a distant location.
So what if we could keep the feature branch close to the user? Or at least the writable SSOT.
This is where cross-server/federated MRs might come in. The user creates all the changes on the Geo secondary, and the secondary federates the changes to the primary.
The ~Geo team can build the federated MR feature (https://gitlab.com/gitlab-org/gitlab-ce/issues/4013), and so give back to the community (also benefit from the improvements the community makes), and then build Geo secondary-first MRs on top of that. It's a win-win!
Problems
Of course there a number of problems we'd need to tackle, including (and probably not limited to):
- We need to determine a method to mark branches read-only on the primary, cause they are writable on one secondary
- For some things we need locking to ensure no duplicates, e.g.
iid
s. Although a simple workaround might be having node-dedicatediid
ranges. - The secondary would need to be capable to write (and read) operational data in the tracking database. This might involve recreating a huge portion of the primary database schema. And then the secondary needs to know to read that data from 2 databases.
Advantages
- User is closer to the remote push target, lowering the latency
- Because it's build on forgefed, being build on ActivityPub, small periods of disconnection to the Geo primary node are handled gracefully
- We also might, in a future stage, have runners on the secondary picking up secondary-first MRs of that node