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.

貢獻者指南