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.
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.
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.
Also, deprecate WithBalancerName (was experimental).
The decision of whether something may be removed is based on if it was marked experimental as of v1.0/GA or upon its introduction, in accordance with Documentation/versioning.md.
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.
- Seperated and documented the options for client and server sides.
- Better support for multiple grpc.Servers. This will be used in other
improvements that I have in the works.
- Moved some common functionality from channelz_test.go to
end2end_test.go.
- Added an option to use the default health service implementation, instead
of each test creating a new health.Server and passing it in. The
inidividual tests have not been changed in this PR. I will do that in a
follow up PR to keep the changes to a reasonable size.
- Fixed one of the tests which had to be fixed because of the separation
of client and server configs.
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.
* end2end test cleanup #1
- Removed some old code which has a TODO asking for it's removal once
Go1.6 and Go1.7 support is gone.
- Cleaned up a couple of error messages along with it.
In the end of the test, 10 RPCs are made to make sure data is sent to
the second server. The first RPC of these 10 is made right after the
second server's listener receives a connection. But at this time, the
connectivity state on the client side is not set to READY yet (though
ac's state should be either connecting or ready, the race between ac
and balancer could cause cc to still be in transient failure). So the
first RPC fails due to transient failure, but the following 9 will
succeed.
This test sometimes fails with error creating stream due to
DeadlineExceeded. It's very hard to reproduce (failed twice in 100000
runs). Extend the RPC timeout in case it's too short.
I was trying to run this test and I had copied the name of the function
from the comment, and it took a good while to figure out why
`go test -run` was returning `testing: warning: no tests to run`.