consul/lib
R.B. Boyer b527e77850 agent: handle re-bootstrapping in a secondary datacenter when WAN federation via mesh gateways is configured (#7931)
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
2020-05-27 16:32:22 +00:00
..
file cli: improve the file safety of 'consul tls' subcommands (#7186) 2020-01-31 10:12:36 -06:00
semaphore connect: tame thundering herd of CSRs on CA rotation (#5228) 2019-01-22 17:19:36 +00:00
cluster.go Update cluster.go 2017-10-30 16:51:28 -07:00
cluster_test.go Integer division rounding to zero for rate scaling 2017-10-30 16:46:11 -07:00
eof.go Makes RPC handling more robust when rolling servers. (#3561) 2017-10-10 15:19:50 -07:00
json.go Add Namespace support to the API module and the CLI commands (#6874) 2019-12-06 11:14:56 -05:00
map_walker.go Allow MapWalk to handle []interface{} elements that are []uint8 (#5800) 2019-05-07 11:40:48 -04:00
map_walker_test.go Allow MapWalk to handle []interface{} elements that are []uint8 (#5800) 2019-05-07 11:40:48 -04:00
math.go Filter wildcard gateway services to match listener protocol 2020-05-06 15:06:13 -05:00
math_test.go Filter wildcard gateway services to match listener protocol 2020-05-06 15:06:13 -05:00
patch_hcl.go Make PatchSliceOfMaps case insensitive 2020-01-31 09:56:02 -05:00
patch_hcl_test.go Make PatchSliceOfMaps case insensitive 2020-01-31 09:56:02 -05:00
path.go Adds basic support for node IDs. 2017-01-17 22:47:59 -08:00
rand.go Use a cryptographically secure seed 2016-05-02 23:52:37 -07:00
retry.go Implement config entry replication (#5706) 2019-04-26 13:38:39 -04:00
retry_test.go Implement config entry replication (#5706) 2019-04-26 13:38:39 -04:00
rtt.go remove golint warnings 2018-01-28 22:40:13 +04:00
rtt_test.go remove golint warnings 2018-01-28 22:40:13 +04:00
serf.go agent: fewer file local differences between enterprise and oss (#6820) (#6898) 2019-12-06 21:35:58 +01:00
slice.go agent: handle re-bootstrapping in a secondary datacenter when WAN federation via mesh gateways is configured (#7931) 2020-05-27 16:32:22 +00:00
slice_test.go agent: handle re-bootstrapping in a secondary datacenter when WAN federation via mesh gateways is configured (#7931) 2020-05-27 16:32:22 +00:00
stop_context.go fix typos reported by golangci-lint:misspell (#5434) 2019-03-06 11:13:28 -06:00
string.go Cull unused function and its unit test. 2016-02-01 22:40:19 -08:00
string_test.go Cull unused function and its unit test. 2016-02-01 22:26:57 -08:00
telemetry.go Simplified code in various places (#6176) 2019-07-20 09:37:19 -04:00
telemetry_test.go Refactor to use embedded struct. 2018-06-25 12:25:39 -07:00
testing_httpserver.go cli: fix usage of gzip.Reader to better detect corrupt snapshots during save/restore (#7697) 2020-04-24 17:18:56 -05:00
translate.go connect: remove managed proxies (#6220) 2019-08-09 15:19:30 -04:00
translate_test.go Make a few config entry endpoints return 404s and allow for snake_case and lowercase key names. (#5748) 2019-04-30 18:19:19 -04:00
useragent.go Add a helper for generating Consul's user-agent string 2018-05-25 15:50:18 -04:00
useragent_test.go Add a helper for generating Consul's user-agent string 2018-05-25 15:50:18 -04:00
uuid.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00