grpc / grpc/grpc-java

least_request LB strategy causes full TPS drop when upstream endpoint hang

Aperta
#12,237 7 commenti 0 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
Java
Stelle
12.1k
Fork
4k
Merge medio
2g 17h
PR unite (30g)
37

Descrizione

### 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.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia da xds/src/main/java/io/grpc/xds/LeastRequestLoadBalancer.java, in particolare ReadyPicker.nextChildToUse(), e leggi il flusso esistente delle policy least_request e xDS circostante. Determina come viene rappresentato FULL_SCAN e come N_CHOICES seleziona attualmente gli endpoint. Il lavoro è completato quando FULL_SCAN è supportato e N_CHOICES non può selezionare due volte lo stesso endpoint, con un comportamento conforme alle garanzie di bilanciamento del carico richieste.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
grpc, java
Ambito
backend-api-design, distributed-systems
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
38/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.