De-duplicate cluster update information pushed to cluster watchers.
This only applies to CDS as the management server sends a response with all requested clusters while only some of. them have changed (or newly been subscribed).
This does not apply to EDS as the protocol is incremental and each EDS response will only contain ClusterLoadAssignments for clusters whose endpoints have changed.
This does not apply to LDS and RDS as at any time we will subscribe to a single resource and our TD implementation will not send extra (unrequested) resources. So each time, the received responses always contain updated resource information.
This can provide a ~2x performance increase to Netty and 40% increase
for OkHttp. Netty async saw a ~3x gain from MigratingDeframer, so
blocking trails behind a bit. But OkHttp's async gains from
MigratingDeframer were also 40%, so this provides the same gain to
blocking.
This provides a substantial ~3x performance increase to Netty async
streaming with small messages. It also increases OkHttp performance for
the same benchmark 40% and decreases unary latency by 3µs for Netty and
10µs for OkHttp.
We avoid calling listener after closure because the Executor used for
RPC callbacks may no longer be available. This issue was already
present in the ApplicationThreadDeframer, but full-stream compression is
not really deployed so was unnoticed.
DirectExecutor saw a 5-6µs latency increase via MigratingDeframer.
DirectExecutor usages should see no benefit from MigratingDeframer, so
disable it in that case.
Android Studio gives warning: "The minSdk version should not be declared in the android manifest file". Typically minSdkVersion should be configured in build.gradle, it was set in manifest since internally we use Blaze. cl/316513856 is created to update the internal BUILD file that configures minSdkVersion.
Create the counter for recording per locality stats upon creating the child balancer for that locality. When the locality is deactivated (due to EDS response update removes it), the counter is not deleted from the LoadStatsStore. Delete it when the child balancer for that locality is shut down. In this way, the lifecycle of the load stats counter for a certain locality stays same with the child balancer for that locality. This is exactly what will happen after we refactor LocalityStore to PriorityLoadBalancer and LrsLoadBalancer (i.e., when some priority is deactivated, its subtree is not deleted immediately, so the LrsLoadBalancer instances for localities still hold the load stats counters).
This fixes#6817 for the normal retry case, although it makes the hedging issue #7089 more broken, and there is still space of optimization for normal retry.
Implemented service config generation in the xDS resolver with xds_routing that supports all matchers. Reimplemented xds_routing config parsing with all matchers. Existing implementation for xds_routing LB policy is mostly deleted for now, as we would need to reimplement the route matching logic with matchers added.
Put Channel into TRANSIENT_FAILURE when CDS/EDS resource that is currently being watched becomes unavailable. CDS/EDS LB policies should shut down their downstream policy instances (stop using current Subchannels for new RPCs) and propagate TRANSIENT_FAILURE status to their parent policies (and may eventually to the Channel).
The original service config error handling design was unclear about the case when an updated resolution result with valid service config and empty address is returned to Channel, and the selected LB policy does not accept empty addresses. Existing implementation silently triggers resolver backoff after LB policy is changed, while leaving Channel being CONNECTING state, if there was an old service config resolved. This change converge the behaviors of whether the received service config is the first one or an update to a previous config, in both cases, Channel goes into TRANSIENT_FAILURE if the selected LB policy cannot handle empty addresses.
This splits server-side flow control from client-side, but tailors the API for
each case. Client-side continues having disableAutoRequestWithInitial(). While
client-side could have disableAutoRequest(), it seems like it will only rarely
be used and disableAutoRequestWithInitial(0) isn't that bad. So we leave it off
for now; we can always add it in the future.
To avoid having too many ShortBufferException thrown in ALTS code path on Java 8, we came up with this workaround creating new managed buffer, filling it, and passing it to underlying Conscrypt not to hit the code path throwing the exception. This might look to introduce another inefficiency but it's more like making it explicit because Conscrypt will do for non-managed buffer which gRPC uses.
Fix: #6761
Changed the logic of parsing Route to skip Routes with action that specifies cluster_header. Eliminate unnecessary validation logic in XdsClientImpl, of which is already covered in converters.