envoyproxy/envoy

xdstp/cleanup: correctly track server sent resources in DeltaSubscriptionState for glob matching subscriptions

Open

#18,361 创建于 2021年9月30日

在 GitHub 查看
 (5 评论) (0 反应) (0 负责人)C++ (5,373 fork)batch import
area/xdsbughelp wanted

仓库指标

Star
 (27,997 star)
PR 合并指标
 (平均合并 8天) (30 天内合并 378 个 PR)

描述

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.

贡献者指南