open-consul/agent
Derek Menteer 73b65228f5
Fix issue with peer stream node cleanup. (#17235)
Fix issue with peer stream node cleanup.

This commit encompasses a few problems that are closely related due to their
proximity in the code.

1. The peerstream utilizes node IDs in several locations to determine which
nodes / services / checks should be cleaned up or created. While VM deployments
with agents will likely always have a node ID, agentless uses synthetic nodes
and does not populate the field. This means that for consul-k8s deployments, all
services were likely bundled together into the same synthetic node in some code
paths (but not all), resulting in strange behavior. The Node.Node field should
be used instead as a unique identifier, as it should always be populated.

2. The peerstream cleanup process for unused nodes uses an incorrect query for
node deregistration. This query is NOT namespace aware and results in the node
(and corresponding services) being deregistered prematurely whenever it has zero
default-namespace services and 1+ non-default-namespace services registered on
it. This issue is tricky to find due to the incorrect logic mentioned in #1,
combined with the fact that the affected services must be co-located on the same
node as the currently deregistering service for this to be encountered.

3. The stream tracker did not understand differences between services in
different namespaces and could therefore report incorrect numbers. It was
updated to utilize the full service name to avoid conflicts and return proper
results.
2023-05-08 13:13:25 -05:00
..
ae
auto-config
cache
cache-types
checks
config
configentry peering: ensure that merged central configs of peered upstreams for partitioned downstreams work (#17179) 2023-04-28 12:36:08 -05:00
connect enable auto-tidy expired issuers in vault (as CA) 2023-05-03 20:30:37 +00:00
consul controller: make the `WorkQueue` generic (#16982) 2023-05-05 15:38:22 +01:00
debug
dns
envoyextensions
exec
grpc-external Fix issue with peer stream node cleanup. (#17235) 2023-05-08 13:13:25 -05:00
grpc-internal
grpc-middleware resource: List resources by owner (#17190) 2023-05-08 12:26:19 -05:00
hcp
local
log-drop
metadata
metrics
mock
pool
proxycfg
proxycfg-glue Use auth context when evaluating service read permissions (#17207) 2023-05-02 16:23:42 -04:00
proxycfg-sources
router
routine-leak-checker
rpc
rpcclient
structs
submatview
systemd
token
uiserver
xds fix panic in `injectSANMatcher` when `tlsContext` is `nil` (#17185) 2023-04-28 16:27:57 -04:00
acl.go
acl_endpoint.go
acl_endpoint_test.go
acl_oss.go
acl_test.go
agent.go
agent_endpoint.go
agent_endpoint_oss.go
agent_endpoint_oss_test.go
agent_endpoint_test.go
agent_oss.go
agent_oss_test.go
agent_test.go
apiserver.go
apiserver_test.go
catalog_endpoint.go
catalog_endpoint_oss.go
catalog_endpoint_test.go
check.go
config_endpoint.go
config_endpoint_test.go
connect_auth.go
connect_ca_endpoint.go
connect_ca_endpoint_test.go
coordinate_endpoint.go
coordinate_endpoint_test.go
delegate_mock_test.go
denylist.go
denylist_test.go
discovery_chain_endpoint.go
discovery_chain_endpoint_test.go
dns.go
dns_oss.go
dns_oss_test.go
dns_test.go
enterprise_delegate_oss.go
event_endpoint.go
event_endpoint_test.go
federation_state_endpoint.go
health_endpoint.go
health_endpoint_test.go
http.go
http_decode_test.go
http_oss.go
http_oss_test.go
http_register.go
http_test.go
intentions_endpoint.go
intentions_endpoint_oss_test.go
intentions_endpoint_test.go
keyring.go
keyring_test.go
kvs_endpoint.go
kvs_endpoint_test.go
metrics.go
metrics_test.go
nodeid.go
nodeid_test.go
notify.go
notify_test.go
operator_endpoint.go
operator_endpoint_oss.go
operator_endpoint_oss_test.go
operator_endpoint_test.go
peering_endpoint.go
peering_endpoint_oss_test.go
peering_endpoint_test.go
prepared_query_endpoint.go
prepared_query_endpoint_test.go
proxycfg_test.go
reload.go
remote_exec.go
remote_exec_test.go
retry_join.go
retry_join_test.go
service_checks_test.go
service_manager.go
service_manager_test.go
session_endpoint.go
session_endpoint_test.go
setup.go
setup_oss.go
sidecar_service.go
sidecar_service_test.go
signal_unix.go
signal_windows.go
snapshot_endpoint.go
snapshot_endpoint_test.go
status_endpoint.go
status_endpoint_test.go
streaming_test.go
testagent.go
testagent_test.go
translate_addr.go
txn_endpoint.go
txn_endpoint_test.go
ui_endpoint.go
ui_endpoint_oss_test.go
ui_endpoint_test.go
user_event.go
user_event_test.go
util.go
util_test.go
watch_handler.go
watch_handler_test.go