Commit Graph

618 Commits

Author SHA1 Message Date
Chengyuan Zhang 7b09056aa4
xds: use a standalone Context for xDS control plane RPCs (#8153)
Control plane RPCs are independent of application RPCs, they can stand for completely different lifetime. So the context for making application RPCs should not be propagated to control plane RPCs. This change makes control plane RPCs use the ROOT Context.
2021-05-07 18:00:47 -07:00
sanjaypujare c9e327d42f
xds: extend SslContextProviderSupplier to DowmstreamTlsContext for server side (#8146) 2021-05-04 22:19:15 -07:00
yifeizhuang 27b1641653
xds: import envoy (#8145) 2021-05-04 16:20:44 -07:00
Chengyuan Zhang fcaf9a9583
xds: ignore balancing state update from downstream after LB shutdown (#8134)
LoadBalancers should not propagate balancing state updates after itself being shutdown.

For LB policies that maintain a group of child LB policies with each having its independent lifetime, balancing state update propagations from each child LB policy can go out of the lifetime of its parent easily, especially for cases that balancing state update is put to the back of the queue and not propagated up inline.

For LBs that are simple pass-through in the middle of the LB tree structure, it isn't a big issue as its lifecycle would be the same as its child. Transitively, It would behave correctly as long as its downstream is doing in the right way.

This change is a sanity cleanup for LB policies that maintain multiple child LB policies to preserve the invariant that further balancing state updates from their child policies will not get propagated.
2021-05-04 15:56:56 -07:00
Chengyuan Zhang ee000f0dc1
xds: throw away subchannel references after ring_hash is shutdown (#8140)
Similar to 368c43aec4. 

Clean up subchannels after the RingHashLoadBalancer itself is shutdown to prevent further balancing state updates being propagated to the upstream.

Note this should not be considered as a fix for any problem anybody is noticing. Upstreams of RingHashLoadBalancer should not rely on this, it should still have its own logic for maintaining the lifecycle of downstream LB and ignore invalid upcalls when necessary.
2021-05-04 13:35:37 -07:00
Eric Anderson 16eb5a47ec Stabilize ChannelCredentials
Some of the experimental API annotations were changed to other issues or
became `@Internal` to match their related APIs.

Fixes #7479
2021-05-03 16:22:43 -07:00
Eric Anderson d42f3b8fcb Stabilize ServerCredentials
Some of the experimental API annotations were changed to other issues or
became @Internal to match their related APIs.

Fixes #7621
2021-05-03 16:10:24 -07:00
Chengyuan Zhang 4a339e41ba
xds: fix URI creation used to instantiate DNS name resolver (#8129)
When creating the URI using Channel authority for instantiating a DNS resolver in the cluster_resolver LB policy, a "dns" scheme needs to be manually attached and the Channel authority would be used as the URI path (same as creating Channel with target). Otherwise, the Channel authority will just be used as the scheme and causing name resolver not found.

The change also handles name resolver lookup more defensively. Although it should not happen, if there does have bug causing DNS resolver not being able to be loaded, the cluster_resolver LB policy propagates the INTERNAL error to upstream.
2021-04-30 18:10:40 -07:00
sanjaypujare 02ff64fa21
xds: use singleton XdsClient for server side (#8130) 2021-04-30 09:52:56 -07:00
Chengyuan Zhang 5d99bb07b8
xds: pretty print ClusterConfig message (#8128)
Adds ClusterConfig message descriptor to message printer.
2021-04-29 18:04:03 -07:00
Chengyuan Zhang 42d7fba1b8
xds: implement toString() for pickers to visualize selectable hosts (#8123)
Implements toString() for the wrapping SubchannelPickers so that we are able to see how hosts are selected when sending out RPCs.
2021-04-28 15:16:30 -07:00
yifeizhuang 6755cfed34
tsan, xds: fix XdsClientWrapperForServerSds data races (#8107) 2021-04-26 14:37:11 -07:00
yifeizhuang 8468b5c42f
tsan, xds: fix data races in ServerWrapperForXds (#8114) 2021-04-26 11:58:32 -07:00
Chengyuan Zhang b4fe07d22d
xds: support ring_hash as the endpoint-level LB policy (#7991)
Update LB policy config generation to support ring hash policy as the endpoint-level LB policy.

- Changed the CDS LB policy to accept RING_HASH as the endpoint LB policy from CDS updates. This configuration is directly passed to its child policy (aka, ClusterResolverLoadBalancer) in its config.

- Changed ClusterResolverLoadBalancer to generate different LB configs for its downstream LB policies, depending on the endpoint-level LB policies.
  - If the endpoint-level LB policy is ROUND_ROBIN, the downstream LB policy hierarchy is: PriorityLB -> ClusterImplLB -> WeightedTargetLB -> RoundRobinLB
  - If the endpoin-level LB policy is RNIG_HASH, the downstream LB policy hierarchy is: PriorityLB -> ClusterImplLB -> RingHashLB.
2021-04-16 12:46:55 -07:00
Chengyuan Zhang 9614738a7d
core, grpclb, xds: let leaf LB policies explicitly refresh name resolution when subchannel connection is broken (#8048)
Currently each subchannel implicitly refreshes the name resolution when its state changes to IDLE or TRANSIENT_FAILURE. That is, this feature is built into subchannel's internal implementation. Although it eliminates the burden of having LB implementations refreshing the resolver when connections to backends are broken, this is gives LB policies no chance to disable or override this refresh (e.g., in some complex load balancing hierarchy like xDS, LB policies may embed a resolver inside for resolving backends so the refreshing resolution operation should be hooked to the resolver embedded in the LB policy instead of the one in Channel).

In order to make this transition smoothly, we add a check to SubchannelImpl that checks if the LoadBalancer has explicitly called Helper.refreshNameResolution for broken subchannels created by it. If not, it logs a warning and do the refresh.

A temporary LoadBalancer.Helper API ignoreRefreshNameResolution() is added to avoid false-positive warnings for xDS that intentionally does not want a refresh. Once the migration is done, this should be deleted.
2021-04-16 10:49:06 -07:00
Chengyuan Zhang d4fa0ecc07
xds: reduce the size of ring for testing pick distributions (#8079)
In the ring hash LB policy, building the ring is computationally heavy. Although using a larger ring can make the RPC distribution closer to the actual weights of hosts, it takes long time to finish the test.

Internally, each test class is expected to finish within 1 minute, while each of the test cases for testing pick distribution takes about 30 sec. By reducing the ring size by a factor of 10, the time spent for those test cases reduce to 1-2 seconds. Now we need larger tolerance for the distribution (three hosts with weights 1:10:100):

- With a ring size of 100000, the 10000 RPCs distribution is close to 91 : 866 : 9043
- With a ring size of 10000, the 10000 RPCs distribution is close to 104 : 808 : 9088

Roughly, this is still acceptable.
2021-04-12 14:55:31 -07:00
Chengyuan Zhang 95adf96848
xds: implement ring_hash load balancing policy (#7943)
Implementation for the ring hash LB policy. A LoadBalancer that provides consistent hashing based load balancing to upstream hosts, with the "Ketama" hashing that maps hosts onto a circle (the "ring") by hashing its addresses. Each request is routed to a host by hashing some property of the request and finding the nearest corresponding host clockwise around the ring. Each host is placed on the ring some number of times proportional to its weight. With the ring partitioned appropriately, the addition or removal of one host from a set of N hosts will affect only 1/N requests.
2021-04-08 17:58:45 -07:00
Sergii Tkachenko 6ad3f5d9e4 xds: Fix error prone UnnecessaryJavacSuppressWarnings in a test 2021-04-07 21:59:31 -04:00
sanjaypujare 1a3b02b44b
xds: cache bootstrapInfo in the SslContextProviderFactory to prevent rereading (#8051) 2021-04-05 16:26:29 -07:00
sanjaypujare d9956a53df
xds: Fix validation of HCM filter and Router httpFilter (#8039)
* add 1 more check that works with TD now
2021-04-02 09:48:13 -07:00
sanjaypujare ac6461dfe5
xds: expose bootstrap through XdsClient interface (#8041) 2021-04-01 18:45:46 -07:00
sanjaypujare 4896a0fee8
xds: move the state check logic to delegate and eliminate boilerplate code (#8018) 2021-03-25 16:52:15 -07:00
Sergii Tkachenko 828b03da27 xds: add CsdsService 2021-03-25 16:20:30 -04:00
Sergii Tkachenko b417b70db1 xds: add csds.proto (v3) with dependencies, generated code 2021-03-25 16:20:30 -04:00
Chengyuan Zhang ad2b26436c
xds: update (local) configurations atomically for each LDS/RDS resource update (#8011)
Fixes inconsistent state of XdsNameResolver with most recently received xDS configurations. The full suite of configurations should always be updated whenever receiving new resource updates, including updates that revoke currently in-use resources. Reference counts for currently in-use clusters should also be cleaned up properly. Otherwise, re-receiving (after being revoked) the same resource can be treated as if the configuration never changed.
2021-03-24 17:06:03 -07:00
ZHANG Dapeng ccedd85418
xds: enforce non-null overrideConfigs field for http filters 2021-03-24 17:05:17 -07:00
ZHANG Dapeng 3ccc6792d5
xds: enable circuit breaking, timeout, fault injection by default 2021-03-24 14:50:59 -07:00
sanjaypujare b7afbc30d1
xds: remove syncContext and just use the executorService (#8006) 2021-03-24 12:41:58 -07:00
sanjaypujare c4dec7517f
xds: add/enhance Javadoc comments for XdsServerBuilder. (#8007) 2021-03-23 10:53:21 -07:00
Sergii Tkachenko 8ff0b23c2e
xds: ADS parsing: collect parsing errors on NACK; cache resources on ACK 2021-03-22 20:34:03 -04:00
apolcyn ccd43b64e3
xds: enable v3 API in bootstrap generated by cloud-to-prod resolver (#7995) 2021-03-19 15:26:15 -07:00
apolcyn ab216a1720
interop-testing, xds: Allow using TestServiceClient for making Traffic Director RPCs (#7994)
Updates TestServiceClient to support creating channel without target port (mostly useful for xDS that uses the channel target as the resource name).

Adds an env var for overriding the TD URI used in cloud-to-prod test.
2021-03-19 12:44:52 -07:00
yifeizhuang 043c9d6407
xds: weightedTargetLB collect all failure child pickers to log more error details (#7989) 2021-03-18 17:39:48 -07:00
Chengyuan Zhang f0512db060
xds: delete redundant hash function configuration (#7950)
Initially we were about to support both xx_hash and murmur_hash. But later we decided to support xx_hash only. So for any hashing we are using in xDS, it's going to be xx_hash. Therefore, we do not need to define and carry this configuration around.
2021-03-18 11:48:25 -07:00
sanjaypujare a460f784c6
xds: fix filterChainMatch for multiple matchers, 0-length prefixLength and empty prefixRange list (#7985) 2021-03-18 10:22:35 -07:00
sanjaypujare cd3b0c4412
xds: clean up to remove the cert-instance-override related code (#7986) 2021-03-18 10:22:04 -07:00
Penn (Dapeng) Zhang e8d935e5c9 xds: pretty print http filters 2021-03-18 10:13:36 -07:00
Penn (Dapeng) Zhang 9950d30881 xds: import envoy router.proto 2021-03-18 10:13:36 -07:00
ZHANG Dapeng 3ebb3e1924
xds: HttpFilter support 2021-03-17 16:37:13 -07:00
sanjaypujare 69587c5239
xds: use the correct resource id template as per xDS server gRFC (#7978) 2021-03-17 08:22:59 -07:00
sanjaypujare 224247cf02
xds: implement xDS server validations (#7972) 2021-03-16 15:24:04 -07:00
yifeizhuang 71c4ef730e
xds:fix cdsLoadBalancer2 childLb shutdown (#7971) 2021-03-16 12:37:05 -07:00
sanjaypujare be6192e82a
xds: replace ServerXdsClient with ClientXdsClient (#7969) 2021-03-16 11:23:41 -07:00
ZHANG Dapeng 3f7aa8c592
xds: fix Node.toBuilder() bug 2021-03-12 14:06:00 -08:00
Chengyuan Zhang 8e1c9b6948
xds: change system property for reading bootstrap config (#7961)
Changes from "io.grpc.xds.bootstrapValue" to "io.grpc.xds.bootstrapConfig".
2021-03-12 13:54:58 -08:00
sanjaypujare afe883119d
xds: add server side Listener processing to ClientXdsClient (#7955)
* xds: add server side Listener processing to ClientXdsClient

* address review comments

* minor fixes for review comments
2021-03-11 16:23:50 -08:00
yifeizhuang 528ef63c58
core: Move negotiationLogger from channel attributes to GrpcHttp2ConnectionHandler (#7933) 2021-03-10 16:43:56 -08:00
Sergii Tkachenko c8d3cf23e6
xds: Simplify ClientXdsClientTestBase by reusing test resources 2021-03-08 09:14:22 -08:00
Chengyuan Zhang 4b52639aa1
xds: implement per-RPC hash generation (#7922)
Generates a hash value for each RPC based on the HashPolicies configured for the Route that the RPC is routed to.
2021-03-05 10:51:42 -08:00
Sergii Tkachenko cf99e8a7b2
xds: add helper to unpack compatible com.google.protobuf.Any messages 2021-03-03 14:46:44 -08:00
sanjaypujare 46a136d62b
xds: implement listener deletion/re-add and server serving/not-serving logic (#7919) 2021-03-02 10:47:50 -08:00
Chengyuan Zhang a3ca6321ba
xds: fix typo in handling malformed cluster config (#7930) 2021-03-01 16:58:23 -08:00
ZHANG Dapeng 14432dfe67
xds: import udpa/type/v1/typed_struct.proto 2021-02-26 12:22:04 -08:00
Chengyuan Zhang 7a92de619b
xds: add env var protection for google-c2p resolver (#7918) 2021-02-25 17:55:05 -08:00
Chengyuan Zhang 2bfa0037ad
xds: implement cloud-to-prod resolver (#7900)
Implemented CloudToProdNameResolver, which will be used for DirectPath with URI scheme "google-c2p". The resolver is only a wrapper that delegates name resolution either to DNS or xDS resolver depending on the environment. If it is delegating to the xDS resolver, it will send HTTP requests (to a local HTTP server) to fetch metadata that is used to generate a bootstrap config. The self-generated bootstrap will be used for xDS.
2021-02-23 12:27:47 -08:00
sanjaypujare bfc67bfcf4
xds: remove the env var GRPC_XDS_EXPERIMENTAL_NEW_SERVER_API (#7914) 2021-02-23 11:15:22 -08:00
Chengyuan Zhang 22d1af0c89
xds: implement simple safe and allocation-free xx_hash (#7912)
Implement a simple allocation-free xx_hash utility class without using sun.misc.Unsafe. The hash function mainly targets on xDS use case, which is mostly small strings (endpoint address, headers, etc) and primitive types.

In gRPC's use case, string characters need to be treated as ASCIIs to make the produced hash values match other implementations (Envoy, gRPC-Go, C-core, etc) would produce.

The hashing implementation and tests are borrowed from OpenHFT's XxHash implementation (https://github.com/OpenHFT/Zero-Allocation-Hashing/blob/master/src/main/java/net/openhft/hashing/XxHash.java, see commit 658079a50903c32c54f2ab5c86243244b3ac60ed), which is under Apache 2.0 license. For more details, see https://github.com/OpenHFT/Zero-Allocation-Hashing.

The code is made to be in third_party directory with LISENCE and NOTICE files.
2021-02-22 11:07:25 -08:00
sanjaypujare 6a581f282b
xds: implement the new filterChainMatch algorithm (#7910) 2021-02-19 15:29:27 -08:00
ZHANG Dapeng 132a40a1cf
xds: implement fault injection interceptor in XdsNameResolver 2021-02-18 14:35:45 -08:00
Sergii Tkachenko e5e9c7a714 xds: sync envoy proto to commit ac9a2637336decdcc52c24add5e8fc39edebb962 2021-02-18 16:11:04 -05:00
ZHANG Dapeng 29864f4fad
xds: gate HttpFilter parsing by env flag 2021-02-17 18:55:43 -08:00
yifeizhuang 97b705614b
xds: add proto leakage check at gradle build (#7899) 2021-02-16 16:19:06 -08:00
sanjaypujare 8030c3a11d
xds: Implement XdsServingStatusListener as per the new xDS server gRFC (#7876) 2021-02-12 09:22:26 -08:00
Chengyuan Zhang 7b70161eef
xds: XdsClient support for hashing based load balancing (#7859)
This change adds two parts to XdsClient for receiving configurations that support hashing based load balancing policies:

- Each Route contains a list of HashPolicys, which specifies the hash value generation for requests routed to that Route.
- Each Cluster resource can specify lb policy other than "round_robin". If it is "ring_hash", it contains the configuration for mapping each RPC's hash value to one of the endpoints.
2021-02-11 23:54:28 -08:00
ZHANG Dapeng b1daad6f30
xds: remove GRPC_XDS_EXPERIMENTAL_V3_SUPPORT env flag 2021-02-08 13:42:43 -08:00
Chengyuan Zhang 14332d294c
xds: be tolerant for unspecified locality fields in bootstrap (#7872) 2021-02-05 17:30:07 -08:00
Chengyuan Zhang 01ed082281
xds: clean up value-typed classes (#7863)
This change cleans up most value-typed classes in EnvoyProtoData, which represent immutable xDS configurations used in gRPC. This introduces AutoValue for reducing the amount of boilerplate code for pure data classes.

Not all value-typed classes in xDS have been migrated, some would need more invasive refactoring and would be done next. This change is a pure no-op refactoring. No behavior change should be introduced.

For more details, see PR description.
2021-02-05 12:48:38 -08:00
Chengyuan Zhang 0dc37ab77d
xds: reimplement stats management (#7848)
This change reimplements stats recording for the client side:

1. Implemented the new stats objects: ClusterDropStats and ClusterLocalityStats, which match C-core's implementation. The XdsClient APIs for accessing stats objects are

- addClusterDropStats(String clusterName, String edsServiceName)
- addClusterLocalityStats(String clusterName, String edsServiceName, Locality locality)

2. Eliminated the LRS LB policy and incorporate locality load recording in ClusterImplLoadBalancer. The endpoint addresses resolved in ClusterResolverLoadBalancer will attach the locality in each address attributes. In ClusterImplLoadBalancer, its helper's createSubchannel() will populate the address locality and then call XdsClient.addClusterLocalityStats(...) to obtain the per-locality stats object for recording RPCs. This stats object is attached to the created subchannel's attribute. Therefore, ClusterImplLoadBalancer receives Picker update from its child LB policy, the Picker's subchannel will always have the per-locality stats object attached. Helper.pickSubchannel(...) will populate the per-locality stats object and wrap it into the stream tracer for counting RPCs. Note the subchannel's shutdown() is wrapped to call the stats object's Release().
2021-02-03 10:45:59 -08:00
Sergii Tkachenko 7f3ddca30f xds: sort FILES in import.sh scripts alphabetically 2021-02-01 18:43:41 -05:00
sanjaypujare 64676198c5
xds: implement all string matcher types for SAN list matching (#7801) 2021-01-29 08:32:17 +05:30
ZHANG Dapeng a6df2b2ff4
xds: parse HttpFault filter from LDS/RDS response 2021-01-27 20:45:18 -08:00
Chengyuan Zhang 09869528f8
xds: fix bug of missing cluster_service_name conversion in v2 ClusterStats (#7849) 2021-01-27 18:18:22 -08:00
Chengyuan Zhang 92364c89c7
xds: support reading bootstrap config directly from env var or system property values (#7826)
This change supports reading the bootstrap config from the following places (in order):

- If GRPC_XDS_BOOTSTRAP exists then use its value as the name of the bootstrap file. If the file is missing or the contents of the file are malformed, return an error.

- Else, if io.grpc.xds.bootstrap exists then use its value as the name of the bootstrap file. If the file is missing or the contents are malformed, return an error.

- Else, if GRPC_XDS_BOOTSTRAP_CONFIG exists then use its value as the bootstrap config. If the value is malformed, return an error.

- Else, if io.grpc.xds.bootstrapValue exists then use its value as the bootstrap config. If the value is malformed, return an error.
2021-01-22 00:26:45 -08:00
ZHANG Dapeng ae82c41032
xds: import fault proto 2021-01-21 09:56:57 -08:00
Chengyuan Zhang a857b5c911
xds: refactor Bootstrapper (#7810)
Split Bootstrapper into Bootstrapper interface and BootstrapperImpl for the concrete implementation. The implementation is cleaned up for better readability and testing. 

Note after this change, the environment variable/system property for setting the path to bootstrap file will be read statically at the time BootstrapImpl class is loaded, instead of when bootstrap() is called. Since in either case the bootstrap file is read for at most once (when the first Channel is created and its resolver starts), the change shouldn't have behavior change from the gRPC client's perspective.
2021-01-19 19:00:15 -08:00
Chengyuan Zhang 1b23cf4f39
xds: fix lint warnings (#7817) 2021-01-15 17:03:39 -08:00
Chengyuan Zhang 4130c5a1b8
alts, xds: backend handshake protocol selection support for xDS in directpath (#7783)
Attaches an attribute on endpoint addresses resolved/discovered using xDS plugin. The attribute indicates whether the endpoint address is a direct Google service endpoint or a CFE. This lets the GoogleDefault credentials choose between ALTS (direct Google service endpoint) and TLS (CFE).

Due to dependency relation between grpc-xds and grpc-alts, GoogleDefault credentials will use the attribute key defined in grpc-xds reflectively.
2021-01-15 16:51:57 -08:00
Chengyuan Zhang 9016cf55d7
xds: make XdsAttributes really public internal (#7815)
Change XdsAttributes to InternalXdsAttributes. It is public internal and may be accessed out of grpc-xds.
2021-01-15 12:54:00 -08:00
Chengyuan Zhang 458b0e4447
xds: throw UnsupportedOperation for unimplemented XdsClient interface methods (#7814)
Letting unimplemented XdsClient methods throw avoids misuses.
2021-01-15 11:26:34 -08:00
Chengyuan Zhang 727b17bbcb
xds: delete old CDS and EDS LB policies (#7811)
Deleted old CDS and EDS LB policies as we've migrated to new LB hierachy support new fetures.
2021-01-15 00:06:26 -08:00
Chengyuan Zhang b01dfb9d3c
xds: promote CdsLoadBalancer2 (#7807)
This change migrates to the new LB hierarchy of CDS -> cluster_resolver -> priority -> cluster_impl -> ...
2021-01-14 15:45:18 -08:00
Chengyuan Zhang a584baf86a
xds: implement new CDS LB policy for supporting aggregate clusters (#7722)
The new CDS LB policy supports discovering aggregate clusters and logical DNS clusters. If the cluster given by its config is an aggregate cluster, it recursively resolves into a list of underlying clusters. It creates a cluster_resolver LB policy as its child policy that receives a list of DiscoveryMechanisms with each containing cluster-level configurations for a single non-aggregate cluster.
2021-01-14 13:17:55 -08:00
Chengyuan Zhang b66d182bb9
api: delete LoadBalancer.Helper APIs that had been deprecated for a long time (#7793) 2021-01-11 15:25:35 -08:00
Chengyuan Zhang ca7f1e4cee
xds: slightly refactor and improve tests for cluster_manager LB policy (#7773) 2021-01-11 10:49:39 -08:00
Chengyuan Zhang 18772e2470
xds: wire up re-resolution requests from LB policies for DNS clusters and bypass requests from LB policies for EDS clusters (#7769)
This change wires up the refreshNameResolution() API for triggering DNS re-resolution in ClusterResolverLoadBalancer, which provides a way for downstream LB policies to request a resolution refresh and only re-resolution requests from LB policies for the DNS cluster should trigger the DNS refresh.
2021-01-08 01:08:13 -08:00
Chengyuan Zhang 2755afeaa5
xds: clean up verbose getters and builders on XdsClient interface (#7784)
Eliminate getters and builders for xDS resource data. They are (should be effectively) immutable and mostly only used for internal implementations. Cleaning up getters and builders significantly reduces the verbosity.
2021-01-07 14:55:05 -08:00
Chengyuan Zhang 70dd45ae70
xds: fix LB policy address and balancing state update propagations (#7772)
Delaying handleResolvedAddresses() for propagating configs to the child LB policy can be problematic. For example, if channel shutdown has been enqueued when calling child policy's handleResolvedAddresses() is being enqueued (e.g., receiving updates from XdsClient), it should not be executed. Otherwise, subchannels may be created by LBs that have already been shut down.

This change fixes LB config propagations in LB policies that manage a group of child LBs and delay the propagation for avoiding reentrancy. LB policies will always directly propagate child LB config/addresses updates directly. On the other hand, upcalls from child LB policies for balancing state updates will be queued and executed later.
2021-01-06 18:25:03 -08:00
sanjaypujare f788eec9e0
xds: multiple changes needed for PSM security GA as discussed (#7777)
* xds: multiple changes needed for GA:
- check to allow XdsServerBuilder.build() only once
- add transportBuilder() to XdsServerBuilder
- remove "grpc/server" hardcoding
- reorder the shutdown of delegate and xdsClient as per new design
2021-01-06 16:44:34 -08:00
Chengyuan Zhang 4548cc5632
xds: fix regression for deleting EDS resources referenced by unchanged CDS resources (#7778)
A bug was introduced in the previous change for processing CDS responses. It mistakenly deleted EDS resources valid still referenced by CDS resources. EDS resource names either appear as the edsServiceName for CDS resources or has the same name as the CDS resources whose edsServiceName is null.

In the previous change, EDS resources having the same name as CDS resources are not retained. This caused LB subtrees for those EDS resources are shut down mistakenly, leading to RPC fails.
2021-01-05 12:08:40 -08:00
Chengyuan Zhang 73fe68eeca
xds: support getting logical DNS and aggregate cluster configurations from CDS responses (#7696)
This change adds support for receiving and extracting configurations for logical DNS clusters and aggregate clusters.
2020-12-30 16:30:35 -08:00
Eric Anderson 8359d0b710
netty: Upgrade to Netty 4.1.52 and tcnative 2.0.34
The tiny cache size was removed from the bytebuf allocator and so was
deprecated. TLSv1.3 was enabled by the upgrade, which fails mTLS
connections at different times. Conscrypt is incompatible with the
default TrustManager when TLSv1.3 is enabled so we explicitly disable
TLSv1.3 when Conscrypt is used for the moment.
2020-12-29 15:20:46 -08:00
Chengyuan Zhang cddc1a500c
xds: decouple xds channel creation and bootstrapping (#7764)
This change fixes the problem of mismatched lifecycle of the xDS channel and XdsClient. Reading the bootstrap will determine and create the ChannelCredentials for each specified xDS server. An exception will be thrown if any xDS server specifies some channel_creds type that is not supported, not just for the first server (which is the only one to be used now). Reading the bootstrap also determines the xDS protocol version. The xDS channel will have the same lifecycle as the XdsClient instance: an xDS channel is created at the first call of getObject() and is shut down at the same time as the XdsClient is shutting down. A new xDS channel will be created when the ObjectPool creates a new XdsClient instance.
2020-12-28 18:39:14 -08:00
sanjaypujare 67ad78608c
xds: fix typo in a log message (#7762) 2020-12-27 18:10:45 -08:00
sanjaypujare a4aa955d66
xds: don't add ServerTlsHandler if current handler is removed - also fix logging. (#7755) 2020-12-23 12:58:53 -08:00
ZHANG Dapeng 7d77f64773
compiler: remove some of the static imports in codegen (#7751)
Resolves #7741 
Some of the static methods in generated code have the same method name but different package name, such `ClientCalls.asyncClientStreamingCall` and `ServerCalls.asyncClientStreamingCall`. It's less readable using static import than using full-qualified method name in-place.
2020-12-23 11:28:03 -08:00
sanjaypujare e530e10648
xds: import latest envoy and udpa protos to get new fields (#7747) 2020-12-22 12:22:40 -08:00
Chengyuan Zhang 5212e3c6df
xds: implement xds_cluster_resolver LB policy (#7685)
Implementation of the xDS cluster_resolver LB policy. It will replace the existing EdsLoadBalancer2.

The cluster_resolver LB policy supports discovering endpoints for aggregate clusters. Its config contains a list of DiscoveryMechanisms for each underlying cluster (the CDS LB policy will flatten an aggregate cluster to a list of underlying clusters), with each represents the mechanism (via EDS or DNS) to be used for resolving endpoints of each underlying cluster. Endpoints in underlying cluster will be resolved independently, but endpoint addresses and the priority/locality structure for each underlying cluster will be combined together before passing down to the child LB policy (aka, Priority LB policy).
2020-12-22 12:16:30 -08:00
Eric Anderson ec70b64610
Bump Gradle and plugin versions
Android plugins weren't touched, since they will need a lot more testing
when doing so.
2020-12-17 15:02:27 -08:00
Chengyuan Zhang 9ead2c7c28
xds: move subchannel TLS context attaching code to cluster_impl LB policy (#7709)
This change moves the xDS security implementation that attaches an SSLContextProviderSupplier as EAG attributes from CDS LB policy to cluster_impl LB policy. It is similar to how DropOverload and circuit breakers work. This change assumes the UpstreamTlsContext in an CDS response is configured for underlying clusters in the context of supporting aggregate clusters. The UpstreamTlsContext configuration is obtained from CdsUpdate, then it is passed to the child EDS LB policy, where it is embedded into the cluster_impl LB policy config that the EDS LB policy generates.
2020-12-14 17:08:51 -08:00
sanjaypujare 20fc907b21
xds: fix ServerXdsClient to return subscribed resources only for LDS (#7689) 2020-12-09 17:42:12 -08:00