Commit Graph

4317 Commits

Author SHA1 Message Date
Chengyuan Zhang 6a7e47b8a5
core, grpclb: change policy selection strategy for Grpclb policy (take two: move logic of querying SRV into Grpclb's own resolver) (#6723)
Eliminated the code path of resolving Grpclb balancer addresses in grpc-core and moved it into GrpclbNameResolver, which is a subclass of DnsNameResolver. Main changes:

- Slightly changed ResourceResolver and its JNDI implementation. ResourceResolver#resolveSrv(String) returns a list of SrvRecord so that it only parse SRV records and does nothing more. It's gRPC's name resolver's logic to use information parsed from SRV records.

- Created a GrpclbNameResolver class that extends DnsNameResolver. Logic of using information from SRV records to set balancer addresses as ResolutionResult attributes is implemented in GrpclbNameResolver only.

- Refactored DnsNameResolver, mainly the resolveAll(...) method. Logics for resolving backend addresses and service config are modularized into resolveAddresses() and resolveServiceConfig() methods respectively. They are shared implementation for subclasses (i.e., GrpclbNameResolver).
2020-03-02 01:03:25 -08:00
Jihun Cho 8f6ad67429
all: remove deprecated internal attribute NAME_RESOLVER_SERVICE_CONFIG (#6705) 2020-02-28 22:31:53 -08:00
Jihun Cho 0fd4975d4c
rls: add proto and converter (#6743) 2020-02-28 21:41:19 -08:00
ZHANG Dapeng 37b231348e
xds: implement XdsRouting config parser
Implement xds_routing config part of go/grpc-xds-traffic-splitting-and-path-matching
2020-02-28 17:50:17 -08:00
Jihun Cho 2162ad0436
service: HealthCheckingLoadBalancerFactory using its own attribute (#6704) 2020-02-28 17:11:20 -08:00
ZHANG Dapeng e29561fbca
core: fix javadoc warnings
Fixes #6755

```
> Task :grpc-core:javadoc
core/src/main/java/io/grpc/util/GracefulSwitchLoadBalancer.java:43: warning - Tag @link: can't find switchTo(Factory) in io.grpc.util.GracefulSwitchLoadBalancer
1 warning
```
2020-02-28 13:07:22 -08:00
Elliotte Rusty Harold 3aa27b69c7
Upgrade guava to 8.2-android (#6772) 2020-02-28 10:51:38 -08:00
ZHANG Dapeng 9cb277d7af
bom: publish grpc-xds to bom 2020-02-28 10:46:15 -08:00
ZHANG Dapeng c5f48b8e38
all: let interop test use shaded dependency correctly (#6780) 2020-02-28 10:04:46 -08:00
Ran 3cd59c0b02
android: Annotate tests to use Robolectric's LEGACY LooperMode. bump roboletric to 4.3.1, truth to 1.0.1 and sdk to 28. (#6773) 2020-02-27 17:00:15 -08:00
Chengyuan Zhang 67397042b9
xds: set disable overprovisioning client feature and user agent in node identifier (#6766)
Add "envoy.lb.does_not_support_overprovisioning" to xDS node identifier client features. Set the new user_agent_name and user_agent_version fields for build version.
2020-02-27 13:19:21 -08:00
ZHANG Dapeng 5677a0b723
api,netty: fix MethodDescriptor and InternalKnownTransport for netty-shaded
Resolves #6765
2020-02-27 12:53:11 -08:00
chrisschek bf2a66c8a2
okhttp: fix incorrect connection-level flow control handling at beginning of connection
Specifically, this addresses bugs that occur when the `OkHttpChannelBuilder.flowControlWindow(int)` setting is increased from its default value.

Two changes:
1. On starting a connection, ensure the value of `OkHttpChannelBuilder.flowControlWindow(int)` is sent via Settings.INITIAL_WINDOW_SIZE. Also send a WINDOW_UPDATE after Settings to update the connection-level window.
2. Always initialize the `OutboundFlowController` with an initialWindowSize of 65335 bytes per the [http2 spec](https://http2.github.io/http2-spec/#InitialWindowSize) instead of using the inbound window size.

Fixes #6685
2020-02-27 12:34:23 -08:00
Jihun Cho 2eab291928
RELEASING.md: update mac build version (#6770) 2020-02-27 09:22:12 -08:00
Chengyuan Zhang 3ccf32ff29
xds: update envoy proto and udpa proto (#6764)
Update envoy proto to c0ab3a4374144728c1e193fc2d43951ed36ccdb7 and udpa proto to edbea6a78f6d1ba34edc69c53a396b1d88d59651.
2020-02-26 16:51:03 -08:00
Chengyuan Zhang 3955e4e184
api: fix Javadoc warnings. (#6763) 2020-02-26 11:51:01 -08:00
Elliotte Rusty Harold 159632c234
Update truth version to 1.0.1 (#6754) 2020-02-26 11:17:42 -08:00
Jihun Cho 3e9f3964c4 Start 1.29.0 development cycle 2020-02-26 09:37:27 -08:00
Jihun Cho df1b678698
Update readme to v1.27.2 (#6758) 2020-02-25 18:32:32 -08:00
Chengyuan Zhang e8066ccf4a
xds: improve logging for xDS workflow (#6748)
This PR tries to improve observability of xDS workflow for some extent. Users can configure Java logger `io.grpc.xds` (or `io.grpc.xds.XdsLogger`) level to enable different verbosities of log messages.

Verbosity of logging:
- FINE: mostly nothing useless there is something abnormal happens such xDS RPC stream closed.
- FINER: informative log messages showing the main xDS workflow happening under the hood.
- FINEST: verbose log messages for debugging purposes, original RPC messages and data types are printed.
2020-02-25 18:04:28 -08:00
Chengyuan Zhang 5b36caa4c2
xds: clean up xDS fallback balancer's logic for filtering out grpclb balancer addresses. (#6752)
Previously, the internal prod test name resolver will give grpclb balancer addresses in `ResolutionResult.addresses`. So we have this filtering code to avoid those addresses being used. We've changed the internal resolver, it will never mix grpclb balancer addresses with normal backend addresses. Therefore, we no longer need this piece of code.
2020-02-25 17:00:16 -08:00
ZHANG Dapeng 936515d2a7
xds: Improve grpc-xds javadoc and make it publishable
- Improve package-info.java and make minor changes to other javadoc.
- Make Orca API non-public for the moment.
- Make grpc-xds publishable.
2020-02-25 15:45:43 -08:00
Jihun Cho 4b201267c6
grpclb: add description to lb sends no backends status (#6751) 2020-02-25 11:05:36 -08:00
Jihun Cho 47c0b0b792
complier: fix typo in comment (#6747) 2020-02-24 14:32:26 -08:00
Sourabh Sarvotham Parkala e5d1244004
okhttp: updating okhttp version from 2.5.0 to 2.7.4 2020-02-24 12:23:11 -08:00
Jihun Cho 3b1af27073
compiler: add std:: qualifications to all references to std::string 2020-02-24 11:34:19 -08:00
Chengyuan Zhang a98db126e2
xds: update LRS protocol and fix usage of cluster name in ClusterStats (#6737)
Fixes load reporting integration due to LRS design flaws.

- Updated LRS protocol. The Node sent in LRS requests use a special metadata "PROXYLESS_CLIENT_HOSTNAME" with value being the hostname (including port) for creating the gRPC channel. Management server is able to infer clusters that the gRPC client potentially sends load to. LRS initial request does not need to populate clusters it wants to report load for.

- Each ClusterStats message in LRS requests represents the loads for each (cluster, cluster_service), where cluster_service field is optional. EDS LB policy should track loads per (cluster, cluster_service) and populate cluster name from upstream CDS policy.

- Modified CdsUpdate, which is the converted data of a CDS response. edsServiceName field can be null when an CDS response does not give it. We want to preserve the null value for LRS requests.
2020-02-21 15:32:27 -08:00
Jihun Cho abed707385
grpclb: handles empty address from LB (#6734) 2020-02-21 10:55:57 -08:00
Chengyuan Zhang 88c027bac3
xds: report load stats for all clusters over a single LRS client (#6706)
Current implementation of client side load reporting is incorrect. Mainly each gRPC channel should have at most one LRS stream based on the current design of using a single management server. In this change:

- Each LoadStatsStore instance is associated with clusterName:clusterServiceName. clusterName and clusterServiceName (nullable) is required to construct an LoadStatsStore instance.
   - The semantics is that an LoadStatsStore is responsible for recording loads sent to that cluster service of the cluster.
The queried load report (via LoadStatsStore#generateLoadReport()) will have cluster_name and cluster_service_name (if not null) set.
   - A LoadReportClient is responsible for reporting loads for all clusters. Add LoadStatsStore to LoadReportClient via LoadReportClient#addLoadStatsStore(clusterName, clusterServiceName, loadStatsStore). This should be done before LoadReportClient#startLoadReporting() is called due to the above open question.

- An XdsClient contains a single LoadReportClient instance. Its APIs XdsClient#reportClientStats(clusterName, clusterServiceName, loadStatsStore) calls LoadReportClient#addLoadStatsStore(clusterName, clusterServiceName, loadStatsStore) and then starts it. XdsClient#cancelClientStatsReport(clusterName, clusterServiceName) calls LoadReportClient#removeLoadStatsStore(clusterName, clusterServiceName) and stops it. LoadReportClient#addLoadStatsStore(clusterName, clusterServiceName, loadStatsStore) cannot be called repeatedly as once the load reporting started, we cannot change the cluster to report loads for. However, we are able to do report then cancel then report then cancel and so on.

- Refactored EdsLoadBalancer a bit, to accommodate the new APIs of enabling/disabling load reporting. The ClusterEndpointsLoadBalancer instance carries its own LoadStatsStore and controls start/cancel of load reporting.

- The interface for LoadReportClient is eliminated. LoadReportClient will completely be a subcomponent of XdsClient.


Note: Currently we assume no cluster/eds service switch, which means we will report load for a single cluster/eds service. So we make the restriction to LoadReportClient#addLoadStatsStore() API that it cannot be called after load reporting has already started. This restriction will be removed after the above open question is resolved.
2020-02-19 18:07:44 -08:00
Chengyuan Zhang 19de229b7f
Update readme to specify 1.27.1 (#6730) 2020-02-19 14:36:47 -08:00
Chengyuan Zhang e6d8c27448
Revert "census: Set SpanKind on Client/Server traces (#6680)" (#6729)
This reverts commit 60bc74620f.
2020-02-19 13:59:58 -08:00
sanjaypujare 26def7f694
xds: support for xDS data types needed for server side SDS support (#6718) 2020-02-19 09:07:07 -08:00
Ziad Hatahet bb37524750
examples: Fix typo in comments (#6721) 2020-02-18 10:16:08 -08:00
Eric Gribkoff 161a26ecff
interop-testing: sync SimpleResponse definition with core and go (#6713) 2020-02-14 14:05:23 -08:00
ZHANG Dapeng 92c9237fe6
xds: have ClusterEndpointsBalancer cancel endpoint watcher only during shutdown
Previously when eds service name is changed, the old endpoint watcher is canceled immediately even it's in graceful switch period, so the old ClusterEndpointsBalancer won't receive any new updates. This behavior is not as good/clean as cancelling the old watch only once the old ClusterEndpointsBalancer is shutdown.
2020-02-14 11:11:15 -08:00
ZHANG Dapeng cd049ed48b
xds: have cluster balancer cancel cluster watcher only during shutdown
Previously when CdsConfig is changed, the old cluster watcher is canceled immediately even it's in graceful switch period, so the old cluster balancer won't receive any new updates. This behavior is not as good/clean as cancelling the old watch only once the old cluster balancer is shutdown.
2020-02-14 10:58:50 -08:00
Eric Gribkoff 5555ec9a35
buildscripts: fix url of grpc core repo (#6708) 2020-02-13 18:51:08 -08:00
Chengyuan Zhang e320b9bee5 Include xDS example's README.md when updating release tag version. 2020-02-13 14:54:11 -08:00
ZHANG Dapeng 941de0e80b
xds: refactor io.grpc.xds.sds to io.grpc.xds.internal.sds 2020-02-13 10:33:52 -08:00
Chengyuan Zhang a8bdf5cb1a
xds: support reporting loads for more than one cluster services (#6688)
Although current LRS client API takes in load stats data for multiple cluster services, it only expects the management server to ask loads for a single cluster services (the LRS response will be ignored if management server asks for more than one). This change removes that assumption/restriction, the actual loads to be reported will be the intersection of services that we have loads for and services that management server asks for.

This change also cleans up LRS client's tests.
2020-02-11 12:48:56 -08:00
Jihun Cho 659987185f
core: revert stickiness from round robin (#6698) 2020-02-11 10:58:32 -08:00
Jihun Cho 774f2763c9
grpclb: add serviceName config to grpclb policy config (#6563) 2020-02-11 10:27:47 -08:00
Eric Anderson 45bb403f8a Update README etc to reference 1.27.0 2020-02-11 10:06:58 -08:00
Chengyuan Zhang 043ab93b3b
xds: fix bug of return resolution error twice in xDS resolver (#6671) 2020-02-11 09:48:53 -08:00
Eric Anderson 255e5feb24 Sync grpc-proto to 1ff78907
This noticed that load_balancer.proto had local changes introduced
in #6549. This was not noticed by Bazel because grpclb was not using
the io_grpc_grpc_proto repository. These issues have been fixed.
2020-02-10 12:32:39 -08:00
Eric Gribkoff 84b10350eb buildscripts,interop-testing: Add xDS tests on GCP (#6662) 2020-02-09 19:43:11 -08:00
Georg Welzel 60bc74620f
census: Set SpanKind on Client/Server traces (#6680) 2020-02-07 09:48:29 -08:00
ZhenLian 557da62305
netty: Upgrade Netty (4.1.45.Final) & tcnative (2.0.28.Final) 2020-02-06 10:03:14 -08:00
ZHANG Dapeng 258fe12f02
interop-testing: fix bug of xds test missing transitive dependency
This fixes a bug introduced in #6675 .

grpc-interop-testing should have added all dependency e.g. enovy that grpc-xds needs.
2020-02-05 16:47:13 -08:00
ZHANG Dapeng cd35a8153c
interop-testing: fix bug for xds dependency not published yet
In v1.27.0 release the grpc-interop-testing artifact in maven includes grpc-xds, but grpc-xds is not yet published. It should be removed from the dependency list in maven artifact.
2020-02-04 14:53:31 -08:00