3350 Commits

Author SHA1 Message Date
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
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
5bc9b325fa fix lbpb package name typo (#3290) 2020-01-02 12:10:08 -08:00
5f3da2a013 Fix resolver.ClientConnection to resolver.ClientConn (#3288) 2019-12-30 10:01:47 -08:00
8a65b8453b xds: client test cleanup. (#3284) 2019-12-27 15:00:59 -08:00
c618975385 internal: fix profiling go generate proto file path (#3285) 2019-12-27 10:20:02 -08:00
aa428f8ea4 xds: fix RDS flaky tests due to ACK (#3279)
Clear ACK request before starting the real RDS tests. This should only be necessary for RDS tests because RDS needs an existing LDS.
2019-12-23 15:08:16 -08:00
d14c83465f xds: client test cleanup (#3267) 2019-12-23 15:06:49 -08:00
01d201eb8d examples: add profiling (#3265) 2019-12-20 15:33:45 -08:00
a2a5ae5d4d credentials/alts: Add Client Authorization Utility API (#3271)
Add client authorization util API
2019-12-20 10:01:56 -08:00
642675125e codec/proto: reuse of marshal byte buffers (#3167)
Performance benchmarks can be found below. Obviously, a 8 KiB
request/response is tailored to showcase this improvement as this is
where codec buffer reuse shines, but I've run other benchmarks too (like
1-byte requests and responses) and there's no discernable impact on
performance.

We do not allow reuse of buffers when stat handlers or binlogs are
turned on. This is because those two may need access to the data and
payload even after the data has been written to the wire. In such cases,
we never return the data back to the pool.

A buffer reuse threshold of 1 KiB was determined after several
experiments. There's diminished returns when buffer reuse is enabled for
smaller messages (actually, a negative impact).

unary-networkMode_none-bufConn_false-keepalive_false-benchTime_40s-trace_false-latency_0s-kbps_0-MTU_0-maxConcurrentCalls_6-reqSize_8192B-respSize_8192B-compressor_off-channelz_false-preloader_false
               Title       Before        After Percentage
            TotalOps       839638       906223     7.93%
             SendOps            0            0      NaN%
             RecvOps            0            0      NaN%
            Bytes/op    103788.29     80592.47   -22.35%
           Allocs/op       183.33       189.30     3.27%
             ReqT/op 1375662899.20 1484755763.20     7.93%
            RespT/op 1375662899.20 1484755763.20     7.93%
            50th-Lat    238.746µs    225.019µs    -5.75%
            90th-Lat    514.253µs    456.439µs   -11.24%
            99th-Lat    711.083µs    702.466µs    -1.21%
             Avg-Lat     285.45µs    264.456µs    -7.35%
2019-12-20 09:41:23 -08:00
ffcdcbc762 profiling: add cmd binary for retrieving and processing data (#3161) 2019-12-20 09:28:08 -08:00
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
f42dee19bb trace: fix getting family for the method (#3216) 2019-12-19 13:23:11 -08:00
9819552c93 xds: Improve xds_resolver_test.go (#3259)
Also get rid of the testutils.XDSClient type. We have a new
testutils/fakexds/Client type which will be used in tests going forward.
2019-12-19 09:21:11 -08:00
d44b1112a2 profiling: add proto and service (#3160) 2019-12-19 08:54:38 -08:00
fcf817f67c dns: report errors from A record lookups instead of zero addresses (#3258) 2019-12-19 08:53:07 -08:00
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
04c179315b xds: support multiple xds servers in bootstrap file (#3247)
Changes to "xds_server" field in bootstrap file:

1. Field name is changed "xds_servers" (plural).
2. Field value should be a list of objects instead of a single object.

For now, we can ignore all entries except the first one.  In the future, we will add support for falling back to a secondary server when the primary is not reachable.
2019-12-18 13:50:05 -08:00
f324900496 dns: fix timing-based test to be more reliable (#3269)
Also, changed the test to make it run in less time and perform more iterations.
2019-12-18 12:46:31 -08:00
a281b506e1 xds test: read ACK to clear req chan (#3266)
The real test relies on req chan to know when the fake xds server
receives the request. Without this, req chan may unblock for the ack,
before the real watch handler is ready.
2019-12-18 12:35:58 -08:00
9efef0360f Change version to 1.27.0-dev (#3263) 2019-12-17 14:10:24 -08:00
d01454da4a xds: Improve balancere/xds_test.go. (#3256) 2019-12-17 11:42:43 -08:00
f7b39d80aa profiling: Fix a data race in the circular buffer. (#3254) 2019-12-13 15:56:14 -08:00
e3baa761f4 grpc: Defer the unlock in newCCResolverWrapper (#3255)
Although the existing code wasn't causing a deadlock or causing
goroutines to hang forever, this is cleaner and prevents any such thing
from happening in the future.
2019-12-13 10:55:51 -08:00
085c980048 grpclb: do not send redundant empty load reports to remote LB (#3249)
Small refactor of tests:

- Add a channel to remoteBalancer on which to send received stats messages
- Change runAndGetStats to runAndCheckStats to allow for faster successful test
  runs (no longer need to sleep for one whole second per test).
- Remove redundant leak check from runAndCheckStats, otherwise excess load
  report messages not read from the channel will result in an infinite loop.
- Add String method to rpcStats to avoid data race between merging and printing.
2019-12-12 14:10:47 -08:00
df18b5433b xds: support ack/nack (#3227)
The client will send a request with version/nonce after receiving a
response, to ack/nack.

Ack versions for different xds types are independent.

Some other changes
- merge sendRequests to one shared function, with fields for version/nonce
- deleted enum for xds types, and always use const URL string
2019-12-12 13:39:56 -08:00
032a3799b2 godoc: clarify WithTimeout deprecation note (#3226)
Tell people to replace Dial + WithTimeout with DialContext + context.WithTimeout.
2019-12-12 13:29:02 -08:00
cb0e11b54f benchmark: include go and grpc version in result files (#3242) 2019-12-12 13:18:36 -08:00
d5c817b906 xds: Improve xds_lrs_test.go (#3251) 2019-12-12 12:04:14 -08:00
4323b783fd Update README.md (#3231) 2019-12-11 13:12:25 -08:00
9f02faeffa credentials: move TLS implementation to a separate file (#3243) 2019-12-11 13:11:24 -08:00
021bd5734e profiling: add internal changes to support profiling of gRPC (#3158) 2019-12-11 09:06:38 -08:00
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
81a07a98fe internal: Improve documentation around buffer.Unbounded (#3241) 2019-12-10 13:45:32 -08:00
3a4f66e0ed xds: small fixes (#3238)
- install cds balancer by importing package cdsbalancer
 - `net.SplitHostPort` fails when target doesn't have port, but we want to use the original string instead
2019-12-10 12:49:47 -08:00
11399004a9 xds: resolver test cleanup (#3233)
This PR also adds a new testutils directory with a fake client and a
channel which supports a timed receive operation. In follow up PRs, we
can move other common test stuff like the fake server etc to this
directory and cleanup more tests.
2019-12-10 11:20:06 -08:00
a4e9d9553d xds: Update the check for match field when handling an RDS response. (#3239)
The client will look only at the last route in the list (the default
route), whose match field must contain a prefix field whose value is the
empty string and whose route field must be set.
2019-12-10 10:47:05 -08:00
86c8a0cb87 xds/resolver: Add missing double quote in json SC (#3232) 2019-12-06 15:39:45 -08:00
3180dcb49d server.go: combine defers to reduce stack usage (#3208)
Continuing the war on stacks, we can reduce the amount of stack required
per-RPC by combining defers from different components into one.

Each defer statement in process{Unary,Streaming}RPC goes on the stack
and occupies about 56-64 bytes the entire lifetime of an RPC, which
could be very long. More importantly, a call to runtime.morestack is
often required to allocate a new, larger stack when the handler
goroutine runs out of stack memory (Go's default stack size is 2 KiB).

Before:

    $ go tool objdump <binary> | grep "TEXT.*processUnaryRPC(SB)" -A 10 | grep "SUBQ.*SP"
      server.go:867   0x9132fb    4881ec80030000      SUBQ $0x380, SP
    $ go tool objdump <binary> | grep "TEXT.*processStreamingRPC(SB)" -A 10 | grep "SUBQ.*SP"
      server.go:1099  0x9151bb    4881ec68020000      SUBQ $0x268, SP

After:

    $ go tool objdump <binary> | grep "TEXT.*processUnaryRPC(SB)" -A 10 | grep "SUBQ.*SP"
      server.go:867   0x9132fb    4881ecd0020000      SUBQ $0x2d0, SP
    $ go tool objdump <binary> | grep "TEXT.*processStreamingRPC(SB)" -A 10 | grep "SUBQ.*SP"
      server.go:1116  0x9150fb    4881ecf8010000      SUBQ $0x1f8, SP

As one can observe, the processUnaryRPC's stack goes down from 0x380
bytes to 0x2d0 bytes (896 - 720 = 176 bytes) while processStreamingRPC's
stack goes down from 0x2d8 bytes to 0x1f8 bytes (616 - 504 = 112 bytes).

There are probably other things we can do here, but these are some low
hanging fruits to pick off.
2019-12-05 14:50:20 -08:00
da3b1eb45e xds: Implementation of the CDS LB policy. (#3224) 2019-12-05 09:52:43 -08:00
6f8ce09297 dns: reapply "dns: stop polling for updates; use UpdateState API" (#3228) 2019-12-05 08:08:29 -08:00
895b36ddf2 travis: run interop tests with examples (#3229) 2019-12-04 15:55:45 -08:00
14426e9c3a credentials/alts: Ensure that GetBytesConsumed is in-bound (#3225) 2019-12-03 22:21:17 -08:00
22854c88e0 credentials/alts: Simplify ALTS acquire and release APIs (#3221) 2019-12-03 15:43:33 -08:00
645dd12f13 alts: Update handshaker.pb.go 2019-12-03 15:28:59 -08:00
1e36139a79 credentials/alts: Set the handshake extra slice correctly (#3222) 2019-12-03 11:01:32 -08:00
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
9dc72d1df0 Revert "dns: stop polling for updates; use UpdateState API" (#3213)
This reverts commit e5e980f2766388fc243cc4cf20c59b9c13affa8c.
2019-11-26 16:07:43 -08:00
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