mirror of https://github.com/hashicorp/consul
c029b20615
The new controller caches are initialized before the DependencyMappers or the Reconciler run, but importantly they are not populated. The expectation is that when the WatchList call is made to the resource service it will send an initial snapshot of all resources matching a single type, and then perpetually send UPSERT/DELETE events afterward. This initial snapshot will cycle through the caching layer and will catch it up to reflect the stored data. Critically the dependency mappers and reconcilers will race against the restoration of the caches on server startup or leader election. During this time it is possible a mapper or reconciler will use the cache to lookup a specific relationship and not find it. That very same reconciler may choose to then recompute some persisted resource and in effect rewind it to a prior computed state. Change - Since we are updating the behavior of the WatchList RPC, it was aligned to match that of pbsubscribe and pbpeerstream using a protobuf oneof instead of the enum+fields option. - The WatchList rpc now has 3 alternating response events: Upsert, Delete, EndOfSnapshot. When set the initial batch of "snapshot" Upserts sent on a new watch, those operations will be followed by an EndOfSnapshot event before beginning the never-ending sequence of Upsert/Delete events. - Within the Controller startup code we will launch N+1 goroutines to execute WatchList queries for the watched types. The UPSERTs will be applied to the nascent cache only (no mappers will execute). - Upon witnessing the END operation, those goroutines will terminate. - When all cache priming routines complete, then the normal set of N+1 long lived watch routines will launch to officially witness all events in the system using the primed cached. |
||
---|---|---|
.. | ||
testing | ||
delete.go | ||
delete_ce.go | ||
delete_test.go | ||
list.go | ||
list_by_owner.go | ||
list_by_owner_test.go | ||
list_test.go | ||
mock_ACLResolver.go | ||
mock_Backend.go | ||
mock_Registry.go | ||
mock_TenancyBridge.go | ||
mutate_and_validate.go | ||
mutate_and_validate_test.go | ||
read.go | ||
read_test.go | ||
server.go | ||
server_ce.go | ||
server_ce_test.go | ||
server_test.go | ||
watch.go | ||
watch_test.go | ||
write.go | ||
write_mav_common_test.go | ||
write_status.go | ||
write_status_test.go | ||
write_test.go |