Skip to content

xds: generic xds client resource watching e2e #8183

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

Merged

Conversation

purnesh42H
Copy link
Contributor

@purnesh42H purnesh42H commented Mar 19, 2025

This is the change to make generic xDS client do resource watching from xDS management server. The xDS client uses the ADS (Aggregated Data Service) stream transport channel that was created in #8144. The e2e tests are written using the listener resource type from #8144 and grpctransport from #8066.

The PR copies the existing clientimpl, authority, clientimpl_watcher from internal xdsclient code along with the helpers that are part of gRPC and then modify them to use the generic client types and interfaces.

The PR also adds String() and Equal() methods for ServerIdentifierExtension and implements them for grpctransport.ServerIdentifierExtension. It also adds a custom map implementation similar to resolver.AddrMap to re-use existing channels for similar server configurations.

Recommend to review each commit of the PR separately in the order.

Commits with copy prefix are copy paste of internal xdsclient code and are followed by modifications. Review only the modification commit.

RELEASE NOTES: None

Copy link

codecov bot commented Mar 19, 2025

Codecov Report

Attention: Patch coverage is 75.55831% with 197 lines in your changes missing coverage. Please review.

Project coverage is 82.19%. Comparing base (732f3f3) to head (d22c5b7).
Report is 18 commits behind head on master.

Files with missing lines Patch % Lines
xds/internal/clients/xdsclient/authority.go 70.32% 112 Missing and 26 partials ⚠️
xds/internal/clients/xdsclient/xdsclient.go 79.52% 28 Missing and 15 partials ⚠️
...s/internal/clients/grpctransport/grpc_transport.go 86.53% 5 Missing and 2 partials ⚠️
.../internal/clients/xdsclient/clientimpl_watchers.go 83.78% 3 Missing and 3 partials ⚠️
...ds/internal/clients/internal/testutils/wrappers.go 87.50% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8183      +/-   ##
==========================================
+ Coverage   82.09%   82.19%   +0.09%     
==========================================
  Files         412      417       +5     
  Lines       40491    41257     +766     
==========================================
+ Hits        33242    33912     +670     
- Misses       5876     5931      +55     
- Partials     1373     1414      +41     
Files with missing lines Coverage Δ
xds/internal/clients/internal/internal.go 96.00% <ø> (+7.11%) ⬆️
xds/internal/clients/internal/testutils/channel.go 100.00% <100.00%> (ø)
.../clients/internal/testutils/e2e/clientresources.go 92.00% <ø> (-1.94%) ⬇️
xds/internal/clients/xdsclient/logging.go 100.00% <100.00%> (ø)
xds/internal/clients/xdsclient/xdsconfig.go 100.00% <100.00%> (ø)
...ds/internal/clients/internal/testutils/wrappers.go 87.50% <87.50%> (ø)
.../internal/clients/xdsclient/clientimpl_watchers.go 83.78% <83.78%> (ø)
...s/internal/clients/grpctransport/grpc_transport.go 88.77% <86.53%> (-1.80%) ⬇️
xds/internal/clients/xdsclient/xdsclient.go 79.62% <79.52%> (+79.62%) ⬆️
xds/internal/clients/xdsclient/authority.go 70.32% <70.32%> (ø)

... and 62 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@purnesh42H purnesh42H force-pushed the generic-xds-client-resource-watchine-e2e branch from c99ca98 to 02db583 Compare March 19, 2025 19:48
@purnesh42H purnesh42H requested a review from dfawley March 19, 2025 20:07
@purnesh42H purnesh42H added Type: Feature New features or improvements in behavior Area: xDS Includes everything xDS related, including LB policies used with xDS. labels Mar 19, 2025
@purnesh42H purnesh42H added this to the 1.72 Release milestone Mar 19, 2025
@purnesh42H
Copy link
Contributor Author

purnesh42H commented Mar 19, 2025

@dfawley could you do a pass on the implementation? For now, I have removed the metrics from client as it requires some more thought. It can be added in separate commit or PR. Otherwise the main implementation can be reviewed to make sure we are following the right approach and do the changes (if needed) before we go further. Also, I will be adding more e2e tests in subsequent commits

@purnesh42H purnesh42H requested a review from dfawley March 20, 2025 20:21
@purnesh42H purnesh42H force-pushed the generic-xds-client-resource-watchine-e2e branch 6 times, most recently from aeb32c1 to 7064881 Compare March 23, 2025 19:36
@purnesh42H purnesh42H changed the title Generic xds client resource watchine e2e xds: Generic xds client resource watchine e2e Mar 24, 2025
@purnesh42H purnesh42H changed the title xds: Generic xds client resource watchine e2e xds: generic xds client resource watchine e2e Mar 24, 2025
@dfawley dfawley assigned purnesh42H and unassigned dfawley Mar 26, 2025
@purnesh42H purnesh42H force-pushed the generic-xds-client-resource-watchine-e2e branch 2 times, most recently from 4a038d9 to 3bacb44 Compare March 28, 2025 18:27
@purnesh42H purnesh42H requested a review from dfawley March 28, 2025 18:31
@purnesh42H purnesh42H assigned dfawley and unassigned purnesh42H Mar 28, 2025
@dfawley dfawley changed the title xds: generic xds client resource watchine e2e xds: generic xds client resource watching e2e Mar 28, 2025
@purnesh42H
Copy link
Contributor Author

purnesh42H commented Mar 28, 2025

@dfawley i have made the change to use ServerConfig and ServerIdentifier as map key for xdsclient and transport respectively. Now we don't need equal. Only thing is for grpcTransport, we return runtime error if extensions are not *ServerIdentifierExtension. Though I was testing and found that if the two extensions pointing to same address but have different values, they are still considered equal. Is that okay since that's our transport?

Could you do the pass on last commit and confirm if we can finalize this approach?

@purnesh42H purnesh42H force-pushed the generic-xds-client-resource-watchine-e2e branch 2 times, most recently from 03adc89 to 5bcc906 Compare March 28, 2025 18:57
@purnesh42H purnesh42H force-pushed the generic-xds-client-resource-watchine-e2e branch from 153bdce to 81711cb Compare April 15, 2025 10:45
@dfawley dfawley assigned purnesh42H and unassigned dfawley Apr 15, 2025
@easwars
Copy link
Contributor

easwars commented Apr 17, 2025

Apologies for the delay.

@easwars easwars removed their assignment Apr 17, 2025
@purnesh42H
Copy link
Contributor Author

Apologies for the delay.

thanks @easwars. I have addressed all the comments. Could you please do another pass?

@purnesh42H purnesh42H requested a review from easwars April 18, 2025 10:53
@purnesh42H purnesh42H assigned easwars and unassigned purnesh42H Apr 18, 2025
@purnesh42H purnesh42H force-pushed the generic-xds-client-resource-watchine-e2e branch from d7c3bb2 to 6a422d7 Compare April 18, 2025 18:13
Copy link
Contributor

@easwars easwars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly LGTM.

Just a couple of open comments that needs addressing.


// DumpResources returns the status and contents of all xDS resources being
// watched by the xDS client.
func (c *XDSClient) DumpResources() ([]byte, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we were going to require byte slices for the send and recv functionalities on the transport. But why do we need to return a byte slice here? We are marshaling the proto to bytes here and the caller would do exactly the opposite. So, I'm not seeing the reason. Maybe I'm missing something?

@easwars easwars assigned purnesh42H and unassigned easwars Apr 22, 2025
@purnesh42H purnesh42H requested a review from easwars April 22, 2025 12:45
@purnesh42H purnesh42H assigned easwars and unassigned purnesh42H Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: xDS Includes everything xDS related, including LB policies used with xDS. Type: Feature New features or improvements in behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants