Commit Graph

112 Commits

Author SHA1 Message Date
Ning Xie c0122323a5 fix typo for grpclb token key (#3094) 2019-10-14 08:57:17 -07:00
Doug Fawley df162eae76
test: embed Unimplemented___Server in every service (#3076) 2019-10-04 13:22:31 -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
Doug Fawley e2cfd1c28f
internal: update proto library version (#3025)
Also, two fixes:

- Fix long-standing `.travis.yml` bug where `VET_SKIP_PROTO` was not `export`ed (so not seen by `vet.sh`).
- Update `vet.sh` to work with new `goimports -l` that does not print a `:` after filenames.
2019-09-17 13:49:26 -07:00
Menghan Li ac35b67779
grpclb: fix deadlock in grpclb connection cache (#3017)
Before the fix, if the timer to remove a SubConn fires at the same time
NewSubConn cancels the timer, it caused a mutex leak and deadlock.
2019-09-10 12:40:48 -07:00
Easwar Swaminathan 36ddeccf18
Move code out of balancer/xds. (#2950)
We will have a root level xds/ directory which will eventually contain
all xDS implementation including balancer, resolver, client etc.

The new structure looks something like this:

grpc/
|
+--xds/
    |
    +--internal/
    |  |
    |  +--balancer/
    |     |
    |     +--edsbalancer/
    |     |
    |     +--lrs/
    |     |
    |     +--orca/
    |
    +--experimental/

Users need to import grpc/xds/experimental package to get all xds
functionality, and this will eventually be moved to grpc/xds.

Also, moved grpc/balancer/internal/wrr to grpc/internal/wrr.
2019-08-07 14:46:10 -07:00
Andrew Lazarev a2bdfb40ff balancer: populate endpoint weight by edsbalancer for weighted_round_robin (#2945) 2019-08-06 09:34:46 -07:00
Fabian Holler 120728e1f7 client: log balancer info messages only for verbosity level >=2 (#2908)
The pickfirstBalancer and baseBalancer are logging a lot of messages under normal operation.  Those messages can not be associated to a server connection because no connection address is part of the messages. They are messages that are only useful when debugging issues.

Only log them when the verbose level is at least 2, to reduce the amount of log messages under normal operation.
2019-07-25 13:25:20 -07:00
Doug Fawley 977142214c
client: fix race between transport draining and new RPCs (#2919)
Before these fixes, it was possible to see errors on new RPCs after a
connection began draining, and before establishing a new connection.  There is
an inherent race between choosing a SubConn and attempting to creating a stream
on it.  We should be able to avoid application-visible RPC errors due to this
with transparent retry.  However, several bugs were preventing this from
working correctly:

1. Non-wait-for-ready RPCs were skipping transparent retry, though the retry
design calls for retrying them.

2. The transport closed itself (and would consequently error new RPCs) before
notifying the SubConn that it was draining.

3. The SubConn wasn't synchronously updating itself once it was notified about
the closing or draining state.

4. The SubConn would go into the TRANSIENT_FAILURE state instantaneously,
causing RPCs to fail instead of queue.
2019-07-22 16:07:55 -07:00
Menghan Li a975db9349
grpclb: enable keepalive (#2918)
So grpclb client will reconnect when the connection is down (e.g. proxy
drops the server side connection but keeps the client side).
2019-07-22 12:44:59 -07:00
Menghan Li 207b5d8038
xds: instructions for regenerating proto (#2898) 2019-07-18 13:52:50 -07:00
Doug Fawley 24b2fb8959
client: remove option to send RPCs before HTTP/2 handshake is completed (#2904) 2019-07-12 13:37:27 -07:00
Menghan Li 08d23162a9
grpclb: recreate SubConns when switching fallback (#2899)
With pickfirst, the same SubConn is reused, only addresses are updated.
But backends and fallbacks may need different credentials. This change
force-removes all SubConns when switching fallback.
2019-07-10 13:56:55 -07:00
Menghan Li 8e511dc15f
xds: update proto (#2896) 2019-07-08 16:47:29 -07:00
lyuxuan 73b304d882
xds: bazel proto gen code generation scripts (#2775) 2019-06-27 15:18:59 -07:00
Menghan Li 95da23bbf9
xds: load report for server loads (from trailer) (#2870) 2019-06-26 12:49:37 -07:00
Menghan Li e8b58ff637
[xds_ignore_weight_0_localities] xds: ignore localities with weight 0 (#2875)
Locality weighted load balancer can be enabled by setting an option in
CDS, and the weight of each locality. Currently, without the guarantee
that CDS is always sent, we assume locality weighted load balance is
always enabled, and ignore all weight 0 localities.
In the future, we should look at the config in CDS response and decide
whether locality weight matters.
2019-06-24 09:40:15 -07:00
Menghan Li 43c0599b22
test: fix flaky grpclb TestDropRequest (#2865) 2019-06-24 09:38:28 -07:00
Menghan Li d33cecdadd
xds: fix difference between user target name and resource name (#2845) 2019-06-05 10:52:48 -07:00
Menghan Li 914c27f822 internal: ignore unexported fields when comparing struct fields (#2853) 2019-06-05 09:54:21 -07:00
Menghan Li 2df9cb80d4
xds: rpc counts (start/end) per locality (#2805) 2019-06-04 12:47:23 -07:00
Menghan Li 532a0b98cb
only force update picker when cache is used (sub-balancer is round-robin) (#2843) 2019-06-03 10:43:53 -07:00
Doug Fawley 99aff99e53 xds: rename balancer to xds_experimental during testing (#2850) 2019-06-03 10:08:20 -07:00
Menghan Li a69f97005b
internal: lint receiver name not x (#2844) 2019-05-30 16:20:18 -07:00
Menghan Li 58c136ca0f
[xds_112] internal: balancer/xds remove build contrain >= 1.12 (#2834)
This reverts commit b03f6fd5e3.
2019-05-30 13:08:45 -07:00
Doug Fawley d40a995895
balancer/resolver: add loadBalancingConfig and pre-parsing support (#2732) 2019-05-30 09:12:58 -07:00
Menghan Li b3e4b49ddb
xds: fix eds balancer nil pointer panic without addresses (#2809) 2019-05-28 11:14:10 -07:00
Menghan Li f34abd9513
xds: add orca generated file, and move orca to xds folder (#2804) 2019-05-24 12:35:57 -07:00
Doug Fawley b7325a3150
Update go.mod for golang/x/tools and staticcheck (#2832) 2019-05-24 11:13:46 -07:00
Menghan Li 4a199db194
xds: split proto imports for message and service (#2812) 2019-05-14 15:15:08 -07:00
lyuxuan a0be99ad32
xds: use BuildOptions.Target.endpoint string instead of deprecated cc.Target (#2807) 2019-05-10 10:45:05 -07:00
lyuxuan 4748a040c8
balancer: provide parsed target through BuildOptions (#2803) 2019-05-09 13:27:41 -07:00
Menghan Li 39ed87fce2
xds: report loads to traffic director (#2789) 2019-05-07 13:58:58 -07:00
Menghan Li 9949ee0c45
xds: lrs load store (#2779) 2019-05-07 10:06:40 -07:00
lyuxuan 028242f874
xds: fix flaky test due to balancerV2 API update (#2799) 2019-05-02 16:14:08 -07:00
lyuxuan d5973a9170
xds: support BalancerV2 API (#2781) 2019-04-29 15:50:08 -07:00
Menghan Li a90198c718
internal: seed random for wrr tests (#2791) 2019-04-26 14:47:55 -07:00
Menghan Li b78962e503
xds: save category in dropper (#2780) 2019-04-26 10:39:49 -07:00
Menghan Li a8b5bd3c39
xds: wrr with random (#2745) 2019-04-23 13:48:02 -07:00
lyuxuan 5b263177f2
xds: make local proto generated files (#2750) 2019-04-16 13:35:16 -07:00
Menghan Li 3f98697f44
grpclb: handle service config and switch to pickfirst (#2719) 2019-04-11 11:25:27 -07:00
Menghan Li b03f6fd5e3
internal: balancer/xds go1.12 only (#2748)
Until https://github.com/envoyproxy/go-control-plane/issues/168 is fixed
2019-04-05 13:51:39 -07:00
Menghan Li 4745f6ae0d
grpclb: fallback after init (#2681)
regenerate picker when switching between fallback/non-fallback, because new SubConn state might not be updated for cached SubConns
2019-04-02 16:27:52 -07:00
Menghan Li d389f9fac6
balancer: add server loads from RPC trailers to DoneInfo (#2641) 2019-04-02 11:15:36 -07:00
Doug Fawley 3910b873d3
bar: add ability to update resolver state atomically and pass directly to the balancer (#2693) 2019-03-22 10:48:55 -07:00
Nathan Herring bcfa7b30ac Downgrade grpclb package info logs to V(2). (#2710)
Fixes #2709.
2019-03-22 10:11:37 -07:00
Menghan Li ce45558927
balancer: make sure non-nil done returned by Pick is called (#2688)
Special case: when SubConn returned by Picker is not Ready, call done before
looping back to re-pick.
2019-03-19 10:47:09 -07:00
Menghan Li d7d977965e
grpclb: support pickfirst (#2652)
Use pickfirst as balancing policy for backends. It can only set at init time.
Does not support changing with service config now.
2019-03-19 10:17:31 -07:00
Doug Fawley 3c84def893
balancer: remove Header from PickOptions; it is also available through context (#2674) 2019-03-15 09:00:55 -07:00