Geo: Support syncing over non-publicly accessible URLs
Problem
As mentioned in https://gitlab.com/gitlab-org/gitlab-ee/issues/6306#note_130326757:
A customer has some kind of network configuration or security requirements that, for example, causes them to try to use IPs inaccessible to users as Geo node URLs. So they have working DB replication, but broken syncing. If I recall correctly, we ask them to make the Geo node URLs match the
external_url
, but they can't or don't want to. I've seen this in multiple support calls.
Possible solution
Suggested by @nick.thomas https://gitlab.com/gitlab-org/gitlab-ee/issues/6306#note_78135896:
decouple the Geo node identity from from the
external_url
completely. This may have some accessory benefits during failover.
Possible implementations
Described by @vsizov in https://gitlab.com/gitlab-org/gitlab-ee/issues/6306#note_130316857:
This one is also possible and should be fairly easy to implement. As we decouple identity we will need to provide some alternative. I can think of two options:
- We specify all the possible URLs for Geo secondary node in the Geo node configuration and so secondary can identify itself by matching request_uri with one of those.
- We can identify the node by setting some name in the Geo node configuration (DB) and specify this name in
gitlab.rb
configuration file. So by matching those, the node can identify itself. I don't like this option though because we need to avoid configuration files as much as possible. As you can see both implementation approaches are really similar. Note, we still need to update Doorkeeper application here!