Hi all, 

still trying to figure out the right way to to this. 

Any suggestions to share with me? 


Thanks, 
Matteo 

----- Messaggio originale -----


Da: "Matteo Piva" <matteo.p...@dbmsrl.com> 
A: "HAProxy" <haproxy@formilux.org> 
Inviato: Giovedì, 11 maggio 2023 11:04:11 
Oggetto: maint, drain: the right approach 

Hi, 

I'm trying to get into the right maintenance procedure when I have to put down 
an HTTP backend for maintenance. 

When I put one of the two backends in MAINT mode (disabled), the traffic is 
then immediately routed only to the active backend. And this includes 
persistent connections as well. 

Once the activity on the underlying service has been completed and they are 
starting up, I switch back from MAINT to READY (without waiting the service to 
be really up). 
The haproxy backend got immediately back in the roundrobin pool, even if the L4 
and L7 checks are still validating that the underlying service is still DOWN 
(service is still starting, could take time). 

So we have: 

- HAPROXY backend: ready->maint 
- Stopping service 
- Starting service 
- HAPROXY backend: maint->ready 
>From now we have the backend in the pool, haproxy is still checking if the 
>service is UP or DOWN (L4) - We have http/503s calling the frontend 
- HAPROXY backend: down (checked, L4) 
- Service up 
- HAPROXY backend: up (checked, L4/L7) 

During the window between maint->ready and L4 check DOWN, the clients got 
http/503 response when being routed to the starting backend. 



Now, I know that using DRAIN the L4/L7 checks can still be ongoing, and this 
can solve such issue. 
But this also means that I can't avoid persistent connections to be routed to 
this backend, so I could have http/503s during the maintenance window. 

Which is the right approach? 
Is there a way to let maint->ready transition to be pessimistic, and wait for 
the checks to complete before the backend be back in the pool? 
Or maybe is there a way to use drain the same as maint, so that can also 
consider persistant connection to be forcefully routed only to active backends? 


Thanks, 

Matteo 

Reply via email to