Commit Graph

256 Commits

Author SHA1 Message Date
Zach Reyes 633fbe4dfe
xds: generate per-request hash config selector (#4525)
* xds: generate per-request hash in config selector
2021-06-17 09:00:05 -04:00
Menghan Li 4c651eda23
xds: move eds package to cluster_resolver (#4545) 2021-06-16 11:04:33 -07:00
Menghan Li 549c53a90c
xds/eds: rewrite EDS policy using child policies (#4457) 2021-06-15 14:03:10 -07:00
Menghan Li cd9f53ac49
xds/cds: update CDS balancer to partially handle aggregated cluster (#4539) 2021-06-15 11:09:10 -07:00
Doug Fawley 6351a55c38
xds: remove env var protetion of advanced routing features (#4529) 2021-06-10 09:33:06 -07:00
Menghan Li b1418a6e74
xds: export XDSClient interface and use it in balancer tests (#4510)
- xdsclient.New returns the interface now
- xdsclient.SetClient and xdsclient.FromResolverState take and return the interface now
- cleanup xds balancer tests to pass xds_client in resolver state
2021-06-08 16:05:50 -07:00
Doug Fawley 656cad9ae5
xds: standardize xds client field name (xdsClient) (#4518) 2021-06-04 12:00:13 -07:00
Doug Fawley 7f9eeeae36
xds: standardize builder type names (bb) and balancer receiver names (b) (#4517) 2021-06-04 11:40:23 -07:00
Doug Fawley 7beddeea91
cleanup: remove "Interface" as suffix of (almost all) interface names (#4512) 2021-06-04 08:58:26 -07:00
Doug Fawley 5c164e2b8f
xds: rename xds/internal/client package to xdsclient (#4511) 2021-06-03 16:10:21 -07:00
Menghan Li e7b12ef3b1
cluster_resolver: add functions to build child balancer config (#4429) 2021-06-02 15:58:39 -07:00
Doug Fawley 3508452162
xds: add test-only injection of xds config to client and server (#4476) 2021-06-02 10:48:18 -07:00
Menghan Li 584fa41822
xds/testing: export variables for testing (#4449)
The exported variables will be used by tests (to be added in a future
PR, in another package) that use these balancers as child balancer.
2021-05-18 10:30:43 -07:00
Zach Reyes b759b408e8
xds: moved shared matchers to internal/xds (#4441)
* Moved shared matchers to internal/xds
2021-05-14 17:02:10 -04:00
Menghan Li a712a73889
xds/cds: add separate fields for cluster name and eds service name (#4414) 2021-05-12 16:25:07 -07:00
Menghan Li 9cb99a5211
xds: pretty print xDS updates and service config (#4405) 2021-05-12 15:48:16 -07:00
Zach Reyes 45e60095da
xds: add support for aggregate clusters (#4332)
Add support for aggregate clusters in CDS Balancer
2021-05-12 17:28:49 -04:00
Easwar Swaminathan 40b25c5b2c
xds: set correct order of certificate providers in handshake info (#4350) 2021-05-05 12:34:15 -07:00
Easwar Swaminathan 0fc0397d77
xds: actually close stuff in cds/eds `Close()` (#4381) 2021-05-04 16:54:57 -07:00
Menghan Li ebd6aba675
Revert "xds/cds: add separate fields for cluster name and eds service name" (#4382)
This reverts PRs #4352 (and two follow up fixes #4372 #4378).
Because the xds interop tests were flaky.

Revert before the branch cut.
2021-05-03 15:16:49 -07:00
Menghan Li b418de839e
xds/eds: restart EDS watch after previous was canceled (#4378) 2021-04-30 11:53:31 -07:00
Menghan Li c3b66015bd
xds/circuit_breaking: use cluster name as key, not EDS service name (#4372) 2021-04-29 11:56:50 -07:00
Menghan Li 24d03d9f76
xds/priority: add ignore reresolution boolean to config (#4275) 2021-04-27 15:22:25 -07:00
Menghan Li 7c5e73795d
xds/cds: add separate fields for cluster name and eds service name (#4352) 2021-04-27 13:37:48 -07:00
Menghan Li e158e3e82c
xds/lrs: server name is not required to be non-empty (#4356) 2021-04-23 13:15:21 -07:00
Doug Fawley 74fe6eaa41
github: testing action workflow improvements and update to test Go1.16 (#4358) 2021-04-22 14:59:51 -07:00
Menghan Li 671707bdf3
internal: fix symbol undefined build failure (#4353)
Caused by git merge
2021-04-21 14:06:54 -07:00
Menghan Li 970aa09283
xds/balancers: export balancer names and config structs (#4334) 2021-04-21 10:11:28 -07:00
Menghan Li 1a870aec2f
xds/clusterimpl: trigger re-resolution on subconn transient_failure (#4314) 2021-04-15 15:08:03 -07:00
Doug Fawley 87eb5b7502
credentials/google: remove unnecessary dependency on xds protos (#4339) 2021-04-13 16:19:17 -07:00
Menghan Li 950ddd3c37
xds/google_default_creds: handshake based on cluster name in address attributes (#4310) 2021-04-12 09:56:37 -07:00
Menghan Li 1d1bbb55b3
weightedtarget: handle updating child policy name (#4309) 2021-04-08 16:11:44 -07:00
Menghan Li 004ef8ade6
xds/clusterimpl: fix picker update race after balancer is closed (#4318) 2021-04-06 13:47:15 -07:00
Menghan Li 9a10f35787
balancergroup: fix leak child balancer not closed (#4308) 2021-04-06 13:11:49 -07:00
Menghan Li d26af8e391
admin: implement admin services (#4274) 2021-03-22 15:14:11 -07:00
Menghan Li 967933baf5
xds/cdsbalancer: move xds client close to run() (#4273)
Otherwise client may be used by run() after closed.
2021-03-16 14:50:07 -07:00
Easwar Swaminathan 1e7119b136
xds: support all matchers for SANs (#4246) 2021-03-15 14:13:13 -07:00
Easwar Swaminathan c949703b4b
xds/cdsbalancer: Override UpdateAddresses() (#4227) 2021-02-26 08:45:26 -08:00
Menghan Li 26c143bd5f
circuit breaking: update picker inline when there's a counter update (#4212) 2021-02-18 10:12:25 -08:00
Menghan Li 1b75f7144d
circuit breaking: keep max_count per picker, instead of globally, and add support in cluster_impl balancer (#4203)
Also changed circuit breaking counter implementation to move max_count into the
picker, because this is how cluster_impl is designed. Implementation in EDS is
also modified to keep max_count in picker.
2021-02-17 10:46:07 -08:00
Menghan Li 9f3606cd0f
xds: xds_cluster_impl_balancer part 1 (#4154)
Part of C2P fallback. To support fallback to a DNS cluster.

This PR adds implementation of xds_cluster_impl_balancer, which will be responsible for circuit breaking and rpc dropping.

This PR only added RPC dropping. Circuit breaking will be done in a followup PR, after some necessary refactoring.
2021-02-11 15:03:39 -08:00
Menghan Li c9217c7195
priority: pass build options to balancergroup (#4202) 2021-02-11 14:30:32 -08:00
Menghan Li ad24ab52b1
priority: the implementation (#4070) 2021-02-10 10:38:04 -08:00
Easwar Swaminathan 9280052d36
balancergroup: Propagate balancer.BuildOptions to child policies (#4184) 2021-02-07 19:55:33 -08:00
Menghan Li 0bc741730b
xds: report drops by circuit breaking (#4171) 2021-01-28 16:47:07 -08:00
Menghan Li 0bd76be2bb
lrs: use JSON for locality's String representation (#4135) 2021-01-07 14:53:43 -08:00
Easwar Swaminathan d79063fdde
credentials/xds: Move non-user facing functionality to an internal package (#4117) 2020-12-16 15:46:56 -08:00
Doug Fawley 4cd551eca7
xds: split routing balancer into config selector + cluster manager (#4083) 2020-12-15 14:01:04 -08:00
Garrett Gutierrez ff16195790
xds: Implement circuit breaking support. (#4050) 2020-12-08 14:33:48 -08:00
Menghan Li bce1fdfad9
eds/lrs: handle nil when LRS is disabled (#4086) 2020-12-07 15:10:33 -08:00
Easwar Swaminathan 5b1874ab74
xds: Handle child policy configs properly (#4071) 2020-12-03 09:00:33 -08:00
Menghan Li 40076094f6
xds: call xdsclient.New instead of getting xds_client from attributes (#4032) 2020-11-19 13:15:38 -08:00
Easwar Swaminathan f5c42ca714
xds/client: Export a method to return bootstrap config. (#4033) 2020-11-17 13:31:38 -08:00
Easwar Swaminathan bc01f3fa87
certprovider: API tweaks. (#3987) 2020-11-06 11:24:57 -08:00
Menghan Li 25ddfddb4f
rds: allow case_insensitive path matching (#3997)
- in xds_client, accept (not NACK) RDS resp with case_insensitive=true
- pass case_insensitive to xds resolver and routing balancer
  - Note that after the config selector change, the routing balancer will be removed, and
    this will be handled in the resolver config selector
2020-11-05 15:04:08 -08:00
Menghan Li 9a3c6618ee
xds: remove xdsclient.New from EDS balancer (#4001) 2020-11-03 15:34:12 -08:00
Easwar Swaminathan fe9c99ff4c
xds: CDS balancer security integration. (#3955) 2020-10-30 15:52:14 -07:00
Menghan Li b045bc88c6
priority: add policy config parsing (#3936) 2020-10-29 10:16:05 -07:00
Menghan Li a223251d8b
lrs: handle multiple clusters in LRS stream (#3935) 2020-10-26 15:47:47 -07:00
Menghan Li 5af60402cd
lrs: add Store.Stats() to report loads for multiple clusters (#3905)
- unexport `perClusterStore` and it's `stats()`
- add `Store.Stats(clusterNames)` to report loads for the given clusters
  - refactor store's map to a two layer map
- move `lastLoadReportAt` from client ton the load store, because a client can now have multiple clusters, each with a different `lastLoadReportAt`
  - all tests will ignore `ReportInterval` when comparing Data
2020-10-07 10:39:58 -07:00
Easwar Swaminathan c07366085d
xds: Cleanup CDS balancer code and tests. (#3916) 2020-10-06 16:16:56 -07:00
Easwar Swaminathan e4ae8742c7
xds/cdsbalancer: Use testutils.TestClientConn. (#3899) 2020-09-22 15:01:00 -07:00
Menghan Li 0dc9986169
lrs: add a layer for clusters in load store (#3880) 2020-09-22 14:26:20 -07:00
Easwar Swaminathan 64c4c37350
xds: Use a grpcsync.Event to represent close in CDS LB policy. (#3894) 2020-09-22 10:00:31 -07:00
Easwar Swaminathan d81def4352
xds: Rename xdsclientWrapper type to xdsClientWrapper in EDS. (#3896) 2020-09-21 16:59:02 -07:00
Easwar Swaminathan 924b48b046
xds: Use a grpcsync.Event to represent close in EDS LB policy (#3895) 2020-09-21 16:58:50 -07:00
Menghan Li 4270c3cfce
xds bootstrap: support insecure and make Creds required (#3881) 2020-09-17 11:05:45 -07:00
Menghan Li 8630cac324
xds: update balancer group ID type to string (#3862) 2020-09-02 14:02:33 -07:00
Easwar Swaminathan b5802b5f3b
xds: v3 support for LRS. (#3856) 2020-09-01 16:56:52 -07:00
Easwar Swaminathan d25c71b543
testutils: Add a context parameter to the Receive() method. (#3835) 2020-08-27 13:55:15 -07:00
Menghan Li 410880dd7d
eds: fix priority timeout failure when EDS removes all priorities (#3830)
Without this fix, when the EDS response removes all priorities, after the timeout, the priority check panics because priority is unset.
2020-08-24 11:09:31 -07:00
Menghan Li 1605756d15
xds: add LRS balancing policy (#3799) 2020-08-13 11:47:23 -07:00
Easwar Swaminathan 7419b444ee
xds: Improve TestClientWrapperWatchEDS. (#3783)
* One subtest should not depend on a previous one. So, refactored the test to be a single one, instead of having multiple subtests.
* Added a channel on the fake server to notify when it receives a connection. This test was sometimes failing because it went ahead and sent EDS requests and expected responses, before the connection to the fake server was up.
2020-08-06 15:36:15 -07:00
Easwar Swaminathan 97c30a1419
xds: Client refactor in preparation for xDS v3 support (#3743) 2020-07-30 10:27:09 -07:00
Doug Fawley 1c32b02682
typo: upate->update (#3765) 2020-07-28 12:49:56 -07:00
Menghan Li 5f0e72845e
xdsrouting: balancer implementation (#3746) 2020-07-21 11:55:49 -07:00
Menghan Li 266c7b6f82
xdsrouting: add fake headers (#3748) 2020-07-20 13:40:03 -07:00
Menghan Li 6dc7938fe8
xdsrouting: balancer config parsing (#3734) 2020-07-16 16:38:30 -07:00
Menghan Li e2f575e56f
xdsrouting: all matchers (#3733) 2020-07-16 16:05:47 -07:00
Doug Fawley 1154df9a4e
balancer: remove deprecated type aliases as planned (#3742) 2020-07-16 13:20:46 -07:00
Easwar Swaminathan d8193ee9cc
xds: Add v3 support for client bootstrap. (#3723) 2020-07-09 16:23:28 -07:00
Menghan Li 9af290fac4
balancergroup: move balancer state (connectivity state and picker) building out (#3685) 2020-07-08 17:41:40 -07:00
Menghan Li 3de8449f85
xds: use logging components (#3718) 2020-06-30 12:04:42 -07:00
Garrett Gutierrez 506b773066
Implemented component logging (#3617) 2020-06-26 12:04:47 -07:00
Easwar Swaminathan 4241954407
xds: Move test only utility method to testutils. (#3715) 2020-06-25 20:03:47 -07:00
Menghan Li 806b6fc596
xds: handle errors in cds balancer (#3649) 2020-05-29 09:43:40 -07:00
Menghan Li acd5f84904
xds: handle errors in eds balancer (#3645) 2020-05-28 09:54:18 -07:00
Menghan Li e786c2dfb2
xds: eds balancer handleEDSUpdate cleanup (#3639) 2020-05-27 09:55:12 -07:00
Menghan Li d071d56834
xds: handle weighted cluster as route action (#3613) 2020-05-26 13:58:04 -07:00
Zou Nengren d6e95de140
xds: rename subBalancerWithConfig to subBalancerWrapper (#3608) 2020-05-21 13:45:46 -07:00
Menghan Li a906ca0441
balancergroup: fix connectivity state (#3585)
- Stop sending empty update to sub-balancers at init time
 - At init, when only one sub-balancer reports transient failure, wait for other sub-balancers
 - When aggregating states, consider a sub-balancer turns Connecting from TransientFailure still in TransientFailure, so aggregated state doesn't stay connecting for a long time
2020-04-30 14:24:06 -07:00
Menghan Li fe604e1fdf
xds: add weighted_target balancer (#3541) 2020-04-29 12:56:03 -07:00
Doug Fawley 4eb418e5b2
balancer: move Balancer and Picker to V2; delete legacy API (#3431) 2020-04-28 14:52:49 -07:00
Easwar Swaminathan b2df44eac8
Pass weights to wrr balancer through attributes. (#3530) 2020-04-27 20:55:58 -07:00
Zou Nengren 18b6aa7728
xds: unexport edsBalancerImplInterface's function (#3550)
Signed-off-by: Zou Nengren <zouyee1989@gmail.com>
2020-04-22 15:55:30 -07:00
Menghan Li ff40ef4227
xds: refactor xds_client (#3477)
This PR refactors xds_client to support multiples watches. Those watches can be for the same type and same resource_name.

There's upper level `Client` and lower level `v2client`. Before this change, all logic was in `v2client`, and `Client` was a thin wrapper.

This PR moves some of the functionality from `v2client` to `Client`. New layers:

- Upper level `Client`
  - keeps a list of watchers
    - provides method `func WatchXXX() (cancel func())`
    - has `WatchService()` which involves `LDS` and `RDS`
  - handles resources from the xDS responses and dispatch to the watchers
    - including multiple watchers for the same resource_name
  - keeps cache
    - and checks cache for new watches

- Lower level `v2client`
  - is a dumb client that
    - manages ADS stream
    - sends a new xDS request when add/remove watch
    - parses xDS responses
      - It doesn't call watchers, but forwards all parsed results to upper Client
    - handles ACK/NACK
  - supports `addWatch(type, name)` and `removeWatch(type, name)`
    - instead of `func watchCDS() func()`, which is now moved up to upper `Client`

Also includes other changes:
 - Corresponding test changes (some tests for `v2client` were moved to `Client`)
 - Method and type renaming
   - CDS/EDS -> Cluster/Endpoints
 - callback functions all accept updates as non-pointers
2020-04-15 14:32:31 -07:00
Zou Nengren 46c755aff1
rename to LocalityID (#3522) 2020-04-14 09:04:53 -07:00
Menghan Li a9555d046f
balancergroup: update methods to V2balancer (#3505)
And make balancergroup stop load reporting is load store is not set
2020-04-09 11:20:37 -07:00
Menghan Li 98e4c7ad3e
xds: move balancer group to a separate package (#3493)
This PR moves balancer group to a separate package and exports the type with some methods. Balancer group will be used by the weighted_target policy.
2020-04-06 15:12:58 -07:00
Menghan Li aedb1362d5
balancer: change roundrobin to accept empty address list (#3491)
Roundrobin will remove all SubConns. The ClientConn will set SubConn state change to shutdown, and the overall state will turn transient failure.
2020-04-03 09:47:59 -07:00
Menghan Li fe1d8e7181
xds: add temporary logging to LRS (#3490) 2020-04-02 16:55:06 -07:00
Damien Neil 197c621dff
xds: use generated protos from github.com/cncf/udpa/go (#3449)
The upstream repo contains generated Go packages, so there's no need to
generate a separate version here.
2020-03-19 13:15:44 -07:00
Menghan Li 4e487c1661
xds: rename WatchEDS to WatchEndpoints in xds_client (#3447) 2020-03-12 13:42:44 -07:00
Menghan Li ecea6ed1fc
xds: better way to compare and update dropper in EDS (#3434) 2020-03-12 13:41:54 -07:00
Menghan Li 9a1081e29e
xds: handle removing drops (#3433) 2020-03-10 08:50:16 -07:00
Easwar Swaminathan d179e8f5cd
xds: Update an error log message. (#3429) 2020-03-06 08:31:55 -08:00
Menghan Li cfc5fec35a
eds: handle child balancer state asynchronously (#3418)
Before this change, in EDS balancer, child balancer's state update is handled synchronously, which includes priority handling. This would cause a deadlock if the child policy sends a state update inline when handling addresses (e.g. when roundrobin handles empty address list).

This change moves the child balancer state handling into a goroutine, to avoid the problem.
2020-03-04 17:53:51 -08:00
Easwar Swaminathan c0d37940ad
xds: Eliminate calls to reflect.DeepEqual from xds code. (#3414) 2020-03-02 15:49:25 -08:00
Menghan Li 73cf2d2ad6
xds: LRS send hostname in metadata (#3394)
- The first LRS req will send hostname in metadata
   - With key "PROXYLESS_CLIENT_HOSTNAME"
2020-02-28 09:41:56 -08:00
Menghan Li 7f5ddc8aee
xds: improve logging (#3386)
- More logs in xds bootstrap/resolver/cds/eds
  - Bootstrap file content/error
  - Request/response on ADS stream
  - Actions by client/resolver/balancer
  - Content of updates
- Logs prefixed with component name and id
  - `[xds-bootstrap]`
  - `[xds-client <address>]`
  - `[cds-lb <address>]`
  - `[eds-lb <address>]`
2020-02-26 17:50:07 -08:00
Menghan Li c02d9d1775
xds: LRS handle response contains multiple cluster names (#3393)
- The LRS client will find known clusters from the response, and send the loads
   - The LRS client support only one cluster now, will be extended to support multiple
2020-02-26 12:41:45 -08:00
Egon Elbre b1a5073a2c
Fix vet issues (#3396)
* internal/wrr: fix copying lock

* internal/transport: don't use unkeyed fields

* xds/internal/balancer/edsbalancer: don't use unkeyed fields

* profiling/cmd: don't discard cancel
2020-02-25 10:56:49 -08:00
Garrett Gutierrez 132187f04c
Modified tests to use tlogger. (#3343)
* Modified tests to use tlogger.

* Fail on errors, with error expectations.

* Added expects and MixedCapsed grpclb_config tests

* Moved tlogger to grpctest, moved leakcheck tester to grpctest.go

* Added ExpectErrorN()

* Removed redundant leak checks

* Fixed new test

* Made tlogger globals into tlogger methods

* ErrorsLeft -> EndTest

* Removed some redundant lines

* Fixed error in test and empty map in EndTest
2020-02-06 13:03:20 -08:00
Menghan Li e0e0cbc795
xds: move "_experimental" to suffix for all balancers (#3356) 2020-02-03 15:39:32 -08:00
Menghan Li 1f66bc9efb
xds: propogate bootstrap error to grpc.Dial (#3330) 2020-01-23 12:45:58 -08:00
Doug Fawley c35a580b0c
Revert "balancer: move Balancer and Picker to V2; delete legacy… (#3315)
This reverts commit 336cf8d761.
2020-01-13 13:12:55 -08:00
Doug Fawley 336cf8d761
balancer: move Balancer and Picker to V2; delete legacy API (#3301) 2020-01-10 13:44:48 -08:00
Menghan Li 1a3212aaf5
lint: add missing package level comments (#3302) 2020-01-08 11:31:36 -08:00
Menghan Li 287dc3e58a
eds: move edsBalancer to the package `edsbalancer` (#3294)
edsBalancer (the old xds balancer) was in `package balancer`, one level above the eds implementation. It's a thin wrapper of the eds impl (and fallback in the future).

This change moves the thin wrapper to `package edsbalancer`, and also renames some structs.
2020-01-03 11:08:28 -08:00
Menghan Li 1f28521e57
eds: delete fallback related code from the EDS balancer (#3287)
We will add fallback support back when the design is finalized. Before that, fallback makes the code quite hard to follow.
2020-01-02 15:32:38 -08:00
Easwar Swaminathan 8a65b8453b
xds: client test cleanup. (#3284) 2019-12-27 15:00:59 -08:00
Easwar Swaminathan fb8a097792
xds: Improve cdsbalancer_test.go (#3277)
* Use the fakexds.Client object instead of defining a new one
* Add CDS watch functionality to the fakexds.Client object
2019-12-19 13:47:34 -08:00
Easwar Swaminathan 660df6a06b
xds: Improve xds_client_test.go (#3270)
Simplified the tests by only testing what is required and faking out
whatever can be faked out.

Also added a fakexds.Server implementation. Will switch other users of
the existing fakeserver implementation after this PR is merged.
2019-12-18 14:17:35 -08:00
Easwar Swaminathan d01454da4a
xds: Improve balancere/xds_test.go. (#3256) 2019-12-17 11:42:43 -08:00
Easwar Swaminathan d5c817b906
xds: Improve xds_lrs_test.go (#3251) 2019-12-12 12:04:14 -08:00
Menghan Li 505c0d6440
xds: skip callback if xds client reports error (#3240)
Errors will be handled specifically, depending on whether it's a
connection error or other types of errors.

Without this fix, balancer's callback will be called with <nil> update,
causing nil panic later.
2019-12-10 14:03:21 -08:00
Easwar Swaminathan da3b1eb45e
xds: Implementation of the CDS LB policy. (#3224) 2019-12-05 09:52:43 -08:00
Menghan Li 4b2104f1fb
xds: change lrs server name field in xds balancer config to a string pointer (#3210)
LRS is disabled if this field is nil (is unset in json). The xds server
will be used if it's a pointer to an empty string.
2019-11-27 15:11:47 -08:00
Menghan Li 157dc9f3e4
xds: cleanup eds tests to use fakexds server (#3209)
And move LRS test server to fakexds package.
2019-11-26 15:53:20 -08:00
Menghan Li d8e3da36ac
xds: in EDS balancer, use xds_client from attibutes (#3205) 2019-11-25 14:50:28 -08:00
Menghan Li da649b3624
xds: use the shared xds client in eds balancer (#3197)
This PR removes the xds_client implementation from eds balancer, and replaces it with a xds_client wrapper. (The xds_client wrapper has very similar API as the old xds_client implementation, so the change in the eds balancer is minimal).

The eds balancer currently doesn't look for xds_client from attributes, and always creates a new xds_client. The attributes change will be done in a following up change.
2019-11-21 14:10:04 -08:00
Doug Fawley dc49de8acd
balancer: add V2Picker, ClientConn.UpdateState, SubConnState.ConnectionError (#3186)
Also implement V2 versions of base.*, xds, pickfirst, grpclb, and round robin balancers.
2019-11-21 10:27:29 -08:00
Easwar Swaminathan 5d4cc8affe
xds: Implementation of xds_resolver using LDS/RDS (#3183)
xds: Implementation of xds_resolver using LDS/RDS
2019-11-18 17:46:14 -08:00
Menghan Li 71ba135a58
xds: handle EDS in xds client (#3181) 2019-11-18 15:17:21 -08:00
Menghan Li 448c8c628c
xds: replace eds proto message with xdsclient defined struct in eds balancer (#3174)
The xds client will parse the EDS response, and give the parse result to eds balancer, so the balancer doesn't need to deal with proto directly.

Also moved `ClusterLoadAssignmentBuilder` to another pacakge to be shared by tests in different packages.
2019-11-14 10:11:01 -08:00
Easwar Swaminathan 0b3a5cc266
Move bootstrap functionality to a new package. (#3176) 2019-11-13 09:58:04 -08:00
Doug Fawley 2cb07fcd90
resolver: rename Option to Options, leaving type aliases for now (#3175) 2019-11-12 15:23:46 -08:00
Menghan Li 2548a2203d
internal: fix EDS test race in cmp/sort (#3154) 2019-11-06 19:38:51 -08:00
Joe Tsai 2d2f65684c cleanup: fix generic comparisons on protobuf messages (#3153)
Generated protobuf messages contain internal data structures
that general purpose comparison functions (e.g., reflect.DeepEqual,
pretty.Compare, etc) do not properly compare. It is already the case
today that these functions may report a difference when two messages
are actually semantically equivalent.

Fix all usages by either calling proto.Equal directly if
the top-level types are themselves proto.Message, or by calling
cmp.Equal with the cmp.Comparer(proto.Equal) option specified.
This option teaches cmp to use proto.Equal anytime it encounters
proto.Message types.
2019-11-06 14:25:07 -08:00
Menghan Li dd568c0669
xds: support priority (#3066)
Each priority maps to a balancer group.

When a priority is in use, its balancer group is started, and it will close the balancer groups with lower priorities. When a priority is down (no connection ready), it will start the next priority balancer group.
2019-11-06 13:09:11 -08:00
Menghan Li b09352fc84
xds: add new fields to XDSConfig (#3100)
Fields are added in: https://github.com/grpc/grpc-proto/pull/64

Other changes:
 - Move XDSConfig from internal to balancer
   - Later we will add a separate config for CDS balancer
 - generate service_config.pb.go and test with json generated from proto message
2019-11-05 09:17:10 -08:00
Menghan Li bbd4b7ae28
eds: skip unhealthy endpoints (#3137)
Unknown and healthy are both considered healthy.

https://www.envoyproxy.io/docs/envoy/latest/api-v2/api/v2/core/health_check.proto#envoy-api-enum-core-healthstatus
2019-11-05 09:03:22 -08:00
Menghan Li 8eafb5b7d5
xds: remove cds from the current xds balancer (#3085)
cds will be done in a separate cds balancer.
2019-10-31 09:44:09 -07:00
Menghan Li ff5f0e93f5
xds: add script to regenerate orca (#3131) 2019-10-30 10:14:39 -07:00
Menghan Li a8f166a036
xds: use generated files from go-control-plane (#3083)
validate needs to be removed, otherwise build fails due to duplicate
proto type registered.
2019-10-29 11:14:20 -07:00
Menghan Li 041ead0785
xds: cache locality (sub-balancer) (#3067)
When a locality is removed from EDS response, it's corresponding
sub-balancer will be removed from balancer group.

With this change, the sub-balancer won't be removed immediately. It will
be kept in a cache (for 15 minutes by default). If the locality is
re-added within the timeout, the sub-balancer in cache will be picked
and re-used.
2019-10-21 15:20:28 -07:00
Menghan Li 0859afa33d
xds: set dial target in request resource_names (#3081) 2019-10-14 09:31:56 -07:00
Ben Wells 691f3b44ba cleanup: fix various misspellings (#3075) 2019-10-04 13:07:47 -07:00
Doug Fawley ed563a02ea
resolver: add State fields to support error handling (#2951) 2019-10-04 12:59:43 -07:00
Easwar Swaminathan 31911ed09e
client: add WithConnectParams to configure connection backoff and timeout (#2960)
* Implement missing pieces for connection backoff.

Spec can be found here:
https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md

Summary of changes:
* Added a new type (marked experimental), ConnectParams, which contains
  the knobs defined in the spec (except for minConnectTimeout).
* Added a new API (marked experimental), WithConnectParams() to return a
  DialOption to dial with the provided parameters.
* Added new fields to the implementation of the exponential backoff in
  internal/backoff which mirror the ones in ConnectParams.
* Marked existing APIs WithBackoffMaxDelay() and WithBackoffConfig() as
  deprecated.
* Added a default exponential backoff implementation, for easy use of
  internal callers.

Added a new backoff package which defines the backoff configuration
options, and is used by both the grpc package and the internal/backoff
package. This allows us to have all backoff related options in a
separate package.
2019-10-03 16:47:13 -07:00