Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for the SDS update failure #615

Merged
merged 1 commit into from
Dec 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 19 additions & 1 deletion pkg/server/delta/v3/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,26 @@ func (s *server) processDelta(str stream.DeltaStream, reqCh <-chan *discovery.De

watch := watches.deltaWatches[typ]
watch.nonce = nonce
// As per XDS protocol, for the non wildcard resources, management server should only respond to the resources
// requested by the client. Since we were replacing (instead of updating) the complete state resource version
// map after responding to the client, it was overriding/removing the resources subscribed by the client intermittently.
// As a result, the update of the such resources was never sent to the client.
// In order to address the issue, started updating the resources hash in the existing map instead of replacing
// the completed map.
// In case of wildcard resources, client never subscribes for the resources, replacing the state resource version based
// on the response by the management server is not an issue. Hence, the fix is only applicable for the non wildcard resources.
if !watch.state.IsWildcard() {
AmitKatyal-Sophos marked this conversation as resolved.
Show resolved Hide resolved
for k, hash := range resp.GetNextVersionMap() {
if currHash, found := watch.state.GetResourceVersions()[k]; found {
if currHash != hash {
watch.state.GetResourceVersions()[k] = hash
}
}
}
} else {
watch.state.SetResourceVersions(resp.GetNextVersionMap())
}

watch.state.SetResourceVersions(resp.GetNextVersionMap())
watches.deltaWatches[typ] = watch
case req, more := <-reqCh:
// input stream ended or errored out
Expand Down