Drain mode VS MAINT mode

Dear community,

by reading some documentation about the dataplane API I got confused with regards to put out of production gracefully a backend server.

Seems there is two ways to do it :

  • disable server, will result in MAINT mode
  • set server either DRAIN or MAINT mode

That being said, I understood that using directly MAINT mode or disable server will result in dropping tcp connections currently active, am I right ?

So the cleanest way to put a backend out of production is to :

  • set Drain mode,
  • Verify connection is 0
  • set the node to Maint

Thank you !

I don’t think haproxy will ever drop existing connections, unless one of the following is true:

The exact difference between maint and drain mode will always depend on your configuration, but generally speaking you should be able to go to maint mode directly, and then figure out how to shutdown existing connections that don’t go away on their own (for example by issuing the shutdown-sessions command).