least_request LB strategy causes full TPS drop when upstream endpoint hang
- Lenguaje dominante
- Java
- Estrellas
- 12.1k
- Forks
- 4k
- Merge medio
- 2 d 17 h
- PR fusionados (30 d)
- 37
Descripción
### Is your feature request related to a problem?
**Yes.** The _least_request_ load balancing strategy can cause **a complete TPS drop** when a single upstream endpoint hangs. This occurs due to two primary factors:
1. Long request timeouts (like 30 seconds or more) make this much worse.
2. As shown in [LeastRequestLoadBalancer$ReadyPicker.nextChildToUse()](https://github.com/grpc/grpc-java/blob/master/xds/src/main/java/io/grpc/xds/LeastRequestLoadBalancer.java), the N_CHOICES selection method randomly picks two endpoints. It may select the same unhealthy endpoint twice(instead of two distinct endpoints).
When this occurs, all traffic is routed to the hanged up endpoint, causing a full service degradation, which is unacceptable.
### Describe the solution you'd like
1. Suport for FULL_SCAN mode of xDS LEAST_REQUEST Load Balancer Policy, which would check all endpoints before picking one.
2. Adjust the N_CHOICES algorithm to prevent it from picking the same endpoint twice, like record which endpoints were already chosen, or something else.
Guía de contribución
Línea de trabajo
Empieza por xds/src/main/java/io/grpc/xds/LeastRequestLoadBalancer.java, especialmente ReadyPicker.nextChildToUse(), y lee el flujo existente de la política least_request y xDS a su alrededor. Determina cómo se representa FULL_SCAN y cómo N_CHOICES selecciona actualmente los endpoints. Se considera terminado cuando FULL_SCAN es compatible y N_CHOICES no puede seleccionar el mismo endpoint dos veces, con un comportamiento que coincida con las garantías de balanceo de carga solicitadas.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- grpc, java
- Área
- backend-api-design, distributed-systems
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 38/100