Skip to content

Commit

Permalink
Revert "Fix for the SDS update failure (#615)" as no longer needed on…
Browse files Browse the repository at this point in the history
… top of #559 (#657)

* Set safe directory in CI script to fix build issue related to VCS stamping in binaries

Signed-off-by: Valerian Roche <valerian.roche@datadoghq.com>

* Revert "Fix for the SDS update failure (#615)"

This reverts commit 0e0f25d.

Signed-off-by: Valerian Roche <valerian.roche@datadoghq.com>
  • Loading branch information
valerian-roche authored Mar 20, 2023
1 parent 7c5489e commit 5efe59d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
3 changes: 3 additions & 0 deletions build/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
set -e
set -x

# Needed to avoid issues with go version stamping in CI build
git config --global --add safe.directory /go-control-plane

go install golang.org/x/tools/cmd/goimports@latest

cd /go-control-plane
Expand Down
20 changes: 1 addition & 19 deletions pkg/server/delta/v3/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,26 +119,8 @@ 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() {
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

0 comments on commit 5efe59d

Please sign in to comment.