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

Use Node instead of D2Node and D2URIMap instead of NodeMap for xDS flow #944

Merged
merged 13 commits into from
Nov 13, 2023

Conversation

PapaCharlie
Copy link
Member

The initial intent of using D2Node was to pre-deserialize the JSON, but because there is no way for the rest.li client to actually leverage this, it simply re-serializes the JSON then deserializes it again. This causes memory pressure along with validation errors as numerical typesa get mungled.

The initial intent of using D2Node was to pre-deserialize the JSON, but because
there is no way for the rest.li client to actually leverage this, it simply
re-serializes the JSON then deserializes it again. This causes memory pressure
along with validation errors as numerical typesa get mungled.
Copy link
Contributor

@ZoabKapoor ZoabKapoor left a comment

Choose a reason for hiding this comment

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

Overall looks good, 1 question before merging: will this work with the existing Observer implementation today? It seems like we are expecting type.googleapis.com/indis.NodeMap instead of "type.googleapis.com/indis.D2NodeMap" (and similar for the other types), but as far as I know the Observer only serves these types today:

envoy.config.cluster.v3.Cluster
envoy.config.core.v3.TypedExtensionConfig
envoy.config.endpoint.v3.ClusterLoadAssignment
envoy.config.listener.v3.Listener
envoy.config.route.v3.RouteConfiguration
envoy.config.route.v3.ScopedRouteConfiguration
envoy.config.route.v3.VirtualHost
envoy.extensions.transport_sockets.tls.v3.Secret
envoy.service.runtime.v3.Runtime
indis.D2Node
indis.D2NodeMap
indis.D2SymlinkNode
indis.Stat

Copy link
Contributor

@nizarm nizarm left a comment

Choose a reason for hiding this comment

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

Done a high level pass, overall LGTM except the backward compatibility related comment

… JSON data

Additionally introduce a D2URI type which has a proper schema instead of being a
Struct. This will significantly decrease the resource size sent by the observer
and significantly decrease the cost of deserialization on the client.
Copy link

@logstashbugreporter logstashbugreporter left a comment

Choose a reason for hiding this comment

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

LGTM, some minor comments inlined, which we talked about offline.

d2/src/main/proto/XdsD2.proto Outdated Show resolved Hide resolved
Copy link

@logstashbugreporter logstashbugreporter left a comment

Choose a reason for hiding this comment

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

thanks for adding more comments. some quick comments on [XdsD2.proto] are inlined:

d2/src/main/proto/XdsD2.proto Outdated Show resolved Hide resolved
d2/src/main/proto/XdsD2.proto Show resolved Hide resolved
d2/src/main/proto/XdsD2.proto Show resolved Hide resolved
Copy link
Contributor

@shivamgupta1 shivamgupta1 left a comment

Choose a reason for hiding this comment

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

Can we test this locally with corresponding changes on the observer side too, and add a testing done section? May also need to update the changelog.

d2/src/main/proto/XdsD2.proto Outdated Show resolved Hide resolved
Copy link

@logstashbugreporter logstashbugreporter left a comment

Choose a reason for hiding this comment

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

LGTM, some nitpick clarification questions inlined:

d2/src/main/java/com/linkedin/d2/xds/XdsClientImpl.java Outdated Show resolved Hide resolved
d2/src/main/java/com/linkedin/d2/xds/XdsClient.java Outdated Show resolved Hide resolved
d2/src/main/java/com/linkedin/d2/xds/XdsClient.java Outdated Show resolved Hide resolved
This is causing all sorts of validation issues due to integers being interpreted
as floats and vice versa
Copy link
Contributor

@nizarm nizarm left a comment

Choose a reason for hiding this comment

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

LGTM

CHANGELOG.md Outdated
@@ -14,6 +14,9 @@ and what APIs have changed, if applicable.

## [Unreleased]

## [29.47.0] - 2023-11-13
- Use Node(Map) instead of D2node(Map)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: to be more specific so people know it's about indis change, how about "Use Node and D2UriMap for observer flow"?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops, yeah let me update the PR title as well

@PapaCharlie PapaCharlie changed the title Use Node(Map) instead of D2node(Map) Use Node instead of D2Node and D2URIMap instead of NodeMap Nov 13, 2023
@PapaCharlie PapaCharlie changed the title Use Node instead of D2Node and D2URIMap instead of NodeMap Use Node instead of D2Node and D2URIMap instead of NodeMap for xDS flow Nov 13, 2023
@PapaCharlie PapaCharlie merged commit a33a1e1 into master Nov 13, 2023
2 checks passed
@PapaCharlie PapaCharlie deleted the pchesnai/node branch November 13, 2023 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants