xdstp/cleanup: correctly track server sent resources in DeltaSubscriptionState for glob matching subscriptions
#18 361 ouverte le 30 sept. 2021
Métriques du dépôt
- Stars
- (27 997 stars)
- Métriques de merge PR
- (Merge moyen 8j) (378 PRs mergées en 30 j)
Description
Title: correctly track server sent resources in DeltaSubscriptionState for glob matching subscriptions
Description: See related PR: https://github.com/envoyproxy/envoy/pull/18295
To correctly track resources from Server, in DeltaSubscriptionState, on receiving a response from the Server, Envoy only tracks a resource (put it into resource_state_) if the resource is already been "watched" (i.e., either it's a wildcard watch or the resource is been explicitly watched). otherwise an "unwatched" resource will be sent to Server again on reconnection, it's "leaked", and could cause problem on the server side as the leaking continues.
But with xdstp glob subscriptions, there isn't a clear way to tell if there are subscriptions interested in a resource from with inside of DeltaSubscriptionState. e.g. xdstp/cluster/* is matching "xdstp/cluster/foo" and "xdstp/cluster/bar".
Adi and I had discussed of this problem, and we agreed it might be better to make watchmap the source of truth for what is "tracked/subscribed" instead of keeping the resource list/set at DeltaSubscriptionState.
With the ongoing work of unifying SotW and Delta-xDS subscription implementation, it might be a good chance to consolidate the two "watching" layers into one.