mirror of https://github.com/status-im/consul.git
b527e77850
The main fix here is to always union the `primary-gateways` list with the list of mesh gateways in the primary returned from the replicated federation states list. This will allow any replicated (incorrect) state to be supplemented with user-configured (correct) state in the config file. Eventually the game of random selection whack-a-mole will pick a winning entry and re-replicate the latest federation states from the primary. If the user-configured state is actually the incorrect one, then the same eventual correct selection process will work in that case, too. The secondary fix is actually to finish making wanfed-via-mgws actually work as originally designed. Once a secondary datacenter has replicated federation states for the primary AND managed to stand up its own local mesh gateways then all of the RPCs from a secondary to the primary SHOULD go through two sets of mesh gateways to arrive in the consul servers in the primary (one hop for the secondary datacenter's mesh gateway, and one hop through the primary datacenter's mesh gateway). This was neglected in the initial implementation. While everything works, ideally we should treat communications that go around the mesh gateways as just provided for bootstrapping purposes. Now we heuristically use the success/failure history of the federation state replicator goroutine loop to determine if our current mesh gateway route is working as intended. If it is, we try using the local gateways, and if those don't work we fall back on trying the primary via the union of the replicated state and the go-discover configuration flags. This can be improved slightly in the future by possibly initializing the gateway choice to local on startup if we already have replicated state. This PR does not address that improvement. Fixes #7339 |
||
---|---|---|
.. | ||
file | ||
semaphore | ||
cluster.go | ||
cluster_test.go | ||
eof.go | ||
json.go | ||
map_walker.go | ||
map_walker_test.go | ||
math.go | ||
math_test.go | ||
patch_hcl.go | ||
patch_hcl_test.go | ||
path.go | ||
rand.go | ||
retry.go | ||
retry_test.go | ||
rtt.go | ||
rtt_test.go | ||
serf.go | ||
slice.go | ||
slice_test.go | ||
stop_context.go | ||
string.go | ||
string_test.go | ||
telemetry.go | ||
telemetry_test.go | ||
testing_httpserver.go | ||
translate.go | ||
translate_test.go | ||
useragent.go | ||
useragent_test.go | ||
uuid.go |