VOL-1497 : Add more control to kv/memory access
- Added kv locking mechanism (etcd only)
- (watch) control path access whenever possible
- (watch) use a transaction for updates and merge with memory
- cleaned up vendoring
- misc changes to fix exceptions found along the way
Amendments:
- Copyright header got removed in auto-generated file
- Changed default locking to false for KV list operation
- Updated backend api to allow the passing of locking parameter
Change-Id: Ie1a55d3ca8b9d92ae71a85ce42bb22fcf1419e2c
diff --git a/vendor/google.golang.org/grpc/balancer_conn_wrappers.go b/vendor/google.golang.org/grpc/balancer_conn_wrappers.go
index 77b6847..7233ade 100644
--- a/vendor/google.golang.org/grpc/balancer_conn_wrappers.go
+++ b/vendor/google.golang.org/grpc/balancer_conn_wrappers.go
@@ -178,6 +178,28 @@
}
func (ccb *ccBalancerWrapper) handleResolvedAddrs(addrs []resolver.Address, err error) {
+ if ccb.cc.curBalancerName != grpclbName {
+ var containsGRPCLB bool
+ for _, a := range addrs {
+ if a.Type == resolver.GRPCLB {
+ containsGRPCLB = true
+ break
+ }
+ }
+ if containsGRPCLB {
+ // The current balancer is not grpclb, but addresses contain grpclb
+ // address. This means we failed to switch to grpclb, most likely
+ // because grpclb is not registered. Filter out all grpclb addresses
+ // from addrs before sending to balancer.
+ tempAddrs := make([]resolver.Address, 0, len(addrs))
+ for _, a := range addrs {
+ if a.Type != resolver.GRPCLB {
+ tempAddrs = append(tempAddrs, a)
+ }
+ }
+ addrs = tempAddrs
+ }
+ }
select {
case <-ccb.resolverUpdateCh:
default: