Commit Graph

3906 Commits

Author SHA1 Message Date
Chengyuan Zhang d3d977d096
xds: extract channel creation out of XdsClient's implementation (#6494)
Introduce a `XdsChannelFactory` for gRPC components that instantiate `XdsClient` instances.
2019-12-08 19:10:12 -08:00
ZHANG Dapeng 30688a1eff
xds: remove xds balancer_name from resolved service config
`XdsNameResolver` will eventually send out a CDS config instead EDS config, but balancer_name should never be sent out from `XdsNameResolver` anyway.

This PR is mainly to unblock current staging test.
2019-12-06 14:36:31 -08:00
Liu sheng 470a4ab12d Add support for cross-compiling for aarch64 platform
This change modified the building scripts to support cross compile
grpc-java for aarch64 platform

For grpc/grpc-java#6364
2019-12-06 14:21:34 -08:00
sanjaypujare 3145ef0b7c
xds: implementation of file based plugin credential (#6485) 2019-12-06 10:27:51 -08:00
Chengyuan Zhang d168632f82
xds: support multiple xDS servers in bootstrap file (#6493)
Support bootstrap file containing multiple xDS servers, with each has its own server URI and channel credential options. Multiple xDS servers are provided in case of one not reachable. For now, we would only use the first one.

This change also formats JSON strings in bootstrap related tests and add several tests for parsing bootstrap JSON as completeness.

Implementation of XdsClient is changed to take in a list of xDS servers. But still, we only use the first one.
2019-12-05 16:45:28 -08:00
Tomo Suzuki 29638780ae build: Replaced outdated comments (#6492) 2019-12-05 13:53:51 -08:00
ZHANG Dapeng b739239e8d
xds: apply error handling for FallbackLb.handleResolvedAddresses
Apply the same error handling for `FallbackLb.handleResolvedAddresses()` as `LookasideLb` and `CdsLoadBalancer`.
2019-12-05 13:51:01 -08:00
Tomo Suzuki 80699f8be9 all: bump Animal-sniffer-annotation to 1.18 (#6488) 2019-12-05 13:15:59 -08:00
ZHANG Dapeng 9c2501f146
xds: add CdsLoadBalancer
- Contains `ClusterWatcher` implementation. On cluster update, `ClusterWatcherImpl` spawns an EDS child balancer if not created, then based on the ClusterUpdate data, it sends an edsConfig to the EDS child balancer.
- `CdsLoadBalancer` reads `XdsClientRef` and `CdsConfig` from `resolvedAddresses`. Base on `resolvedAddresses`, it register a `ClusterWatcherImpl` to `XdsClient`.
- For a different cluster resource name in CdsConfig when `handleResolvedAddresses()`, `CdsLoadBalancer` will gracefully switch to the new cluster.
2019-12-05 11:04:54 -08:00
ZHANG Dapeng b833aae615
xds: fix build
Fix build failure of 96da68bab3
https://travis-ci.org/grpc/grpc-java/builds/620854037?utm_source=github_status&utm_medium=notification
2019-12-04 16:00:06 -08:00
Chengyuan Zhang 96da68bab3
xds: modify LRS client interface (#6483)
Add two APIs to LoadReportClient interface:

- addLoadStatsStore(String, LoadStatsStore)

- removeLoadStatsStore(String)

Each LoadReportClient is responsible for reporting loads for a single cluster. But a gRPC client can spread loads to multiple EDS services per cluster, while loads for each EDS service should be aggregated separately.

With this change, starting a LoadReportClient only starts LRS RPC, the source of load data to be reported is added via addLoadStatsStore API.
2019-12-04 14:22:30 -08:00
sanjaypujare 5b837c4a59
xds: add UpstreamTlsContext to ClusterUpdate (#6481) 2019-12-04 13:18:42 -08:00
ZHANG Dapeng 6b2e754746
xds: refactor EDS policy to use ObjectPool<XdsClient> with error handling fixes (#6450) 2019-12-04 10:40:20 -08:00
Eric Gribkoff bfa085a1cf
Start 1.27.0 development cycle (#6480) 2019-12-03 17:27:55 -08:00
Eric Anderson 2d592642ad Update Bazel+Javalite to 3.11
Bazel was stuck on the javalite branch of protobuf because the master
branch was lacking the toolchain necessary for javalite. The fix was
backported to 3.11 in protocolbuffers/protobuf#6976
2019-12-03 17:01:08 -08:00
Jihun Cho 1573e0d400
netty: log NativeIoException as FINE level (#6477)
resolves #6478
2019-12-03 13:05:04 -08:00
Eric Anderson 54b7847a7f Update protobuf to 3.11.0 and gson to 2.8.6
Updating Protobuf to bring in improvements for Android.

Protobuf pulls in the newer version of gson and we are happy to update
to it.
2019-12-02 16:43:06 -08:00
Jiangtao Li 0dfda93395
alts: fix lazychannel close (#6475) 2019-12-02 15:33:31 -08:00
Chengyuan Zhang 06dd24e248
xds: integrate CDS protocol in XdsClient (#6416)
Add CDS protocol integration into XdsClient. gRPC client interacts with XdsClient for CDS results via adding a cluster watcher to receive cluster information from traffic director. Multiple watchers can exist to receive cluster information for the same or different clusters.
2019-12-02 13:57:36 -08:00
ZHANG Dapeng 8062406afc
interop-testing,core: interop test to get remote address attributes
Adding interop-test for getting remote server address from client interceptor. Also added this feature to inprocess transport.
2019-12-02 13:30:55 -08:00
sanjaypujare 7b6ab2558c
xds: Implementation of SdsSslContextProvider using SdsClient (#6444) 2019-11-27 15:17:12 -08:00
Jihun Cho 09d5093295
xds: simplify condition (#6463) 2019-11-25 13:22:38 -08:00
Jihun Cho 7db873f1f6
Roll-forward of stub,compiler: generated stub extends Abstract{Async,Future,Blocking}Stub #6196 (#6458)
This reverts commit 2eb3f8c34e (#6317).
2019-11-25 09:41:16 -08:00
Chengyuan Zhang 0a0d9f6684
xds: integrate EDS protocol into XdsClient (#6370)
This change implements EDS protocol in XdsClient, which requests for endpoint information for a given cluster for gRPC's load balancing usage. Note EDS is a quasi-incremental protocol, which means each response may contain only a subset of present resources. Absence of resources should be revealed by response timeout. Currently, timeout is not implemented, endpoint watchers will wait indefinitely if endpoints for the cluster interested in does not exist.
2019-11-24 23:35:58 -08:00
Kun Zhang b0e00fd4ba
netty: enable io.grpc.netty.useCustomAllocator by default (#6459) 2019-11-22 16:13:35 -08:00
Chengyuan Zhang eb21c646b2
api, core: make scheduled executor service accessible for NameResolver.Args (#6455)
Added new API on NameResolver.Args to access ScheduledExecutorService, which is wrapped transport executor.
2019-11-21 16:14:13 -08:00
ZHANG Dapeng 81efecd86a
remove getLoadStatsStore method from LocalityStore
Currently `LoadStatsStore` is create by `LocalityStore` and `LoadReportClient` retrieves `LoadStatsStore` from `LocalityStore.getLoadStatsStore()`.

But `LocalityStore` is create by EDS policy, whereas `LoadReportClient` and `LoadStatsStore` should be created by CDS (if not EDS-only), before `LocalityStore` is created. If `LoadReportClient` is embedded in `XdsClientImpl`, it need a `LoadStatsStore` which shouldn't be created by `LocalityStore`.

Instead, `LoadStatsStore` should be create before `LocalityStore` is created, and be passed to `LocalityStore`'s constructor. A getter is not needed.
2019-11-21 12:37:48 -08:00
Jihun Cho eaf99cf7fe
core,xds: add missing JUnit RunWith annotation (#6457) 2019-11-21 11:52:34 -08:00
Eric Anderson 44b26dab9d stub: Provide bread-crumb to user how to configure StreamObserver before start
This is already in the documentation in CallStreamObserver, but if the user
gets here the error didn't provide an actionable next step. The message now
provides more help of how they should have called the methods instead of
feeling more like a brick wall.
2019-11-20 15:10:39 -08:00
Chengyuan Zhang d4e8962277
cronet: disable code shrinking for library build (#6448) 2019-11-20 12:12:53 -08:00
Chengyuan Zhang c2d68039ba
xds: implement LDS/RDS over ADS in XdsClient (#6320)
Implement envoy's LDS and RDS protocols in XdsClient. gRPC has a special purpose xDS resolver to instantiate an XdsClient object and add a watcher to initiate xDS communication with management server to retrieve information used in service config, which configures gRPC's load balancing plugin.
2019-11-20 00:43:08 -08:00
ZHANG Dapeng 17c3e48240
xds: refactor to eliminate LookasideChannelLb
This is a followup of #6425 to further refactor/cleanup. Now that `LookasideChannelLb` does very little thing, it does not need to be a class anymore.
2019-11-19 17:46:43 -08:00
Chengyuan Zhang c7a6f62831
xds: add gRPC-Java build version into Node parsed for xDS protocol (#6443) 2019-11-19 14:14:18 -08:00
Eric Anderson 31a192dd40 protobuf: Exclude new javalite artifact name
In 48929c4 the protobuf lite artifact name changed from protobuf-lite to
protobuf-javalite. However, the exclusion in grpc-protobuf was missed in the
update, allowing protobuf lite to leak into the classpath. This restores the
previous behavior of only having one protobuf implementation on the classpath.
2019-11-19 09:13:08 -08:00
ZHANG Dapeng 2d454d478c
Revert "Revert "all: remove deprecated usePlaintext(boolean)""
This reverts commit 316a739e67.
2019-11-18 16:53:52 -08:00
Chengyuan Zhang 86bfefdaf2
api, core: make channel logger accessible through NameResolver.Args (#6430) 2019-11-18 16:33:39 -08:00
Kun Zhang d77419557a
netty: reduce default worker ELG thread number by half, to number of CPU cores (#6439)
This would cut the amount of per-thread direct buffer allocations by half, especially with light traffic. This will also cut the amount of file descriptors that's created per thread by half.

Internal benchmark results (median of 5 runs) doesn't show any significant change:
```
                          Before (STDEV)           After (STDEV)
grpc-java-java-multi-qps-integrity_only
Actual QPS               711,004 (6,246)         704,372 (6,873) 
QPS per Client CPU        23,921   (252)          24,188   (252)

grpc-java-java-multi-throughput-integrity_only
Actual QPS                35,326    (48)          35,294    (29) 
QPS per Client CPU         3,362    (17)           3,440    (13)

grpc-java-java-single-latency-integrity_only
Median latency (us)          127  (2.77)             129  (3.13)

grpc-java-java-single-throughput-integrity_only
Actual QPS                   581 (11.60)             590  (7.08)
QPS per Client CPU           490 (10.98)             498  (5.63)
```
2019-11-18 16:26:37 -08:00
Chengyuan Zhang 94eb93bd3a
api: enforce NameResolver.Args creation with builder (#6437) 2019-11-18 15:31:44 -08:00
ZHANG Dapeng bd1f819024
xds: add an Attributes for XdsClient reference 2019-11-18 15:20:38 -08:00
sanjaypujare b05ce13df2
xds: implementation of SdsClient to be used by SDS based SslContextProviders (#6400) 2019-11-18 10:36:42 -08:00
Yongwoo Noh add020fd19 core: fix typo in javadoc (#6431) 2019-11-15 11:19:28 -08:00
Chengyuan Zhang a49bd6efaa
xds: do not globally cache results of reading bootstrap file (#6420)
Do not cache content read from bootstrap file. Each call of readBootstrap() should just trigger reading file explicitly.
2019-11-14 17:04:34 -08:00
Kun Zhang 89cd64328d
netty: provide an option to lower netty allocator chunk size from 16MB to 2MB (#6407)
This would reduce the amount of direct buffer allocations, especially with light traffic. This should mitigate internal issue b/143075435

The change is currently optional and is only effective if system property "io.grpc.netty.useCustomAllocator" is set to "true" ignoring the case.

Internal benchmark results (median of 5 runs) doesn't show any significant change:
```
                          Before (STDEV)           After (STDEV)
grpc-java-java-multi-qps-integrity_only
Actual QPS               717,848 (7,445)         715,061 (2,122) 
QPS per Client CPU        23,768   (799)          23,842   (295)

grpc-java-java-multi-throughput-integrity_only
Actual QPS                35,631   (204)          35,298    (25) 
QPS per Client CPU         3,362    (56)           3,316    (18)

grpc-java-java-single-latency-integrity_only
Median latency (us)          130  (1.82)             125  (5.36)

grpc-java-java-single-throughput-integrity_only
Actual QPS                    593 (5.14)             587  (3.76)
QPS per Client CPU            502 (4.51)             494  (6.92)

```
2019-11-14 15:50:11 -08:00
ZHANG Dapeng 194d1512c0
xds: refactor xds policy to use XdsClient
This is a refactor of the existing xds policy to use XdsClient. It does neither create a copy of EDS policy as in #6371 nor re-implement an EDS policy. This should be similar to the idea of https://github.com/grpc/grpc/pull/20368 in C-core. 

Here it refactors `XdsComms2` to an implementation of `XdsClient`, which can be drop-in replaced by `XdsClientImp` when it's available.
2019-11-14 15:10:44 -08:00
Ran b80a07a1ca
core: delay attaching cancellation listener to context on server-side. (#6333) 2019-11-14 14:29:34 -08:00
sanjaypujare 80c78ddede
xds: add inline bytes support to CertificationValidationContext we use in SdsTrustManagerFactory (#6429) 2019-11-14 10:51:42 -08:00
Eric Anderson 48929c4d50
Upgrade to protobuf lite 3.10
This finally brings lite into version number sync with full proto.

Well-known protos for javalite are now pre-generated.
2019-11-14 10:26:20 -08:00
Chengyuan Zhang b38134eebd
xds: add APIs for initiating LRS in XdsClient (#6419) 2019-11-13 16:05:36 -08:00
Nayana-ibm 198ca2904a Adding s390x suport ot grpc-java 2019-11-13 14:43:59 -08:00
ZHANG Dapeng ce2b0174b2
xds: ignore endpoints with health_status != HEALTHY or UNKNOWN
Let child balancer (currently is Round Robin) handle the address list with only healthy addresses for its locality. If no healthy address available, let the child balancer handleNameResolutionError.
2019-11-12 13:40:25 -08:00