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

xds: remove support for v2 Transport API #6013

Merged
merged 7 commits into from Feb 14, 2023
Merged

Conversation

arvindbr8
Copy link
Member

We need to remove support for xDS transport API v2 in gRPC. This diff does it.

Fixes #5718

RELEASE NOTES:

  • xds: remove support for xds v2 Transport API

@arvindbr8 arvindbr8 added the Type: Behavior Change Behavior changes not categorized as bugs label Feb 8, 2023
@arvindbr8 arvindbr8 added this to the 1.54 Release milestone Feb 8, 2023
NodeProto proto.Message
// NodeProto contains the Node proto to be used in xDS requests. This will be
// of type *v3corepb.Node.
NodeProto *v3corepb.Node
Copy link
Contributor

Choose a reason for hiding this comment

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

We should move NodeProto out of ServerConfig and into Config.

NodeProto was part of ServerConfig (even though it contains information about the local node and not the remote management server) because we had to support servers which spoke different transport protocols (v2/v3). Hence we used to marshal the node information in the appropriate version of the NodeProto corresponding to the transport protocol version spoken by the server.

Now that we are going to use v3 for all servers, there is no need to store node information per server. I don't know off the top of my head if this change will be more involved. So, I'm OK if you want to make that change as a follow up PR. If you plan on doing that, please add a TODO here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure. Actually I think it makes sense to include that in this PR. Adding it in the update

case version.TransportV3:
c.XDSServer.NodeProto = v3
}
c.XDSServer.NodeProto = v3
Copy link
Contributor

Choose a reason for hiding this comment

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

We could completely get rid of this method (or simplify it greatly) if we move the NodeProto out of ServerConfig into Config.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds good 👍

// TestNewConfigV2ProtoSuccess exercises the functionality in NewConfig with
// different bootstrap file contents. It overrides the fileReadFunc by returning
// bootstrap file contents defined in this test, instead of reading from a file.
func TestNewConfigV2ProtoSuccess(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here. We need to ensure that we don't lose any test coverage.

if node, ok := config.XDSServer.NodeProto.(interface{ GetId() string }); ok {
nodeID = node.GetId()
}
nodeID := config.XDSServer.NodeProto.GetId()
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: inline this in the log statement.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@easwars easwars assigned arvindbr8 and unassigned easwars Feb 10, 2023
@arvindbr8 arvindbr8 assigned easwars and unassigned arvindbr8 Feb 11, 2023
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.

Could you also please grep the whole codebase for something like "v2*pb" to ensure that we are not using any v2 protos anywhere. If you do find some, you can also fix them in a follow up PR, based on how many occurrences you see.

@@ -292,6 +261,9 @@ type Config struct {
// In any of those cases, it is an error if the specified authority is
// not present in this map.
Authorities map[string]*Authority
// NodeProto contains the Node proto to be used in xDS requests. This will be
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this comment This will be of type *v3corepb.Node.? Given that the field is defined to be of that type now.

@@ -143,6 +143,9 @@ type Options struct {
Backoff func(retries int) time.Duration
// Logger does logging with a prefix.
Logger *grpclog.PrefixLogger
// NodeProto contains the Node proto to be used in xDS requests. This will be
// of type *v3corepb.Node.
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment about the comment here.

@easwars easwars assigned arvindbr8 and unassigned easwars Feb 14, 2023
@arvindbr8 arvindbr8 added Type: Feature New features or improvements in behavior and removed Type: Behavior Change Behavior changes not categorized as bugs labels Feb 14, 2023
@arvindbr8
Copy link
Member Author

Issue states that this is a feature and not a behavior change.. Also need to close and re-open to run new tests in github actions

@arvindbr8 arvindbr8 closed this Feb 14, 2023
@arvindbr8 arvindbr8 reopened this Feb 14, 2023
@arvindbr8 arvindbr8 merged commit 081499f into grpc:master Feb 14, 2023
1 check passed
@arvindbr8 arvindbr8 deleted the remove-v2 branch February 14, 2023 21:35
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Feature New features or improvements in behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

xds: remove support for xDS v2 transport protocol
2 participants