-
Notifications
You must be signed in to change notification settings - Fork 547
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
Conversation
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.
There was a problem hiding this 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
There was a problem hiding this 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
d2/src/main/java/com/linkedin/d2/discovery/stores/zk/SymlinkAwareZooKeeper.java
Show resolved
Hide resolved
… 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.
There was a problem hiding this 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/java/com/linkedin/d2/balancer/properties/UriPropertiesJsonSerializer.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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:
There was a problem hiding this 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.
There was a problem hiding this 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:
This is causing all sorts of validation issues due to integers being interpreted as floats and vice versa
There was a problem hiding this 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) |
There was a problem hiding this comment.
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"?
There was a problem hiding this comment.
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
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.